7 if test -z "$VERSION_FILE";then
11 if test -z "$OUTPUT_FILE";then
12 OUTPUT_FILE
="include/version.h"
17 SAMBA_VERSION_MAJOR
=`sed -n 's/^SAMBA_VERSION_MAJOR=//p' $SOURCE_DIR$VERSION_FILE`
18 SAMBA_VERSION_MINOR
=`sed -n 's/^SAMBA_VERSION_MINOR=//p' $SOURCE_DIR$VERSION_FILE`
19 SAMBA_VERSION_RELEASE
=`sed -n 's/^SAMBA_VERSION_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
21 SAMBA_VERSION_PRE_RELEASE
=`sed -n 's/^SAMBA_VERSION_PRE_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
23 SAMBA_VERSION_RC_RELEASE
=`sed -n 's/^SAMBA_VERSION_RC_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
25 SAMBA_VERSION_IS_SVN_SNAPSHOT
=`sed -n 's/^SAMBA_VERSION_IS_SVN_SNAPSHOT=//p' $SOURCE_DIR$VERSION_FILE`
27 SAMBA_VERSION_VENDOR_SUFFIX
=`sed -n 's/^SAMBA_VERSION_VENDOR_SUFFIX=//p' $SOURCE_DIR$VERSION_FILE`
29 echo "/* Autogenerated by script/mkversion.sh */" > $OUTPUT_FILE
31 echo "#define SAMBA_VERSION_MAJOR ${SAMBA_VERSION_MAJOR}" >> $OUTPUT_FILE
32 echo "#define SAMBA_VERSION_MINOR ${SAMBA_VERSION_MINOR}" >> $OUTPUT_FILE
33 echo "#define SAMBA_VERSION_RELEASE ${SAMBA_VERSION_RELEASE}" >> $OUTPUT_FILE
36 SAMBA_VERSION_STRING
="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}"
39 if test -n "${SAMBA_VERSION_PRE_RELEASE}";then
40 SAMBA_VERSION_STRING
="${SAMBA_VERSION_STRING}pre${SAMBA_VERSION_PRE_RELEASE}"
41 echo "#define SAMBA_VERSION_PRE_RELEASE ${SAMBA_VERSION_PRE_RELEASE}" >> $OUTPUT_FILE
42 elif test -n "${SAMBA_VERSION_RC_RELEASE}";then
43 SAMBA_VERSION_STRING
="${SAMBA_VERSION_STRING}rc${SAMBA_VERSION_RC_RELEASE}"
44 echo "#define SAMBA_VERSION_RC_RELEASE ${SAMBA_VERSION_RC_RELEASE}" >> $OUTPUT_FILE
48 if test x
"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x
"yes";then
52 svn info
${SOURCE_DIR} >/dev
/null
2>&1 && HAVESVN
=yes
53 TMP_REVISION
=`(svn info ${SOURCE_DIR} 2>/dev/null || svk info ${SOURCE_DIR} 2>/dev/null) |grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'`
54 if test x
"${HAVESVN}" = x
"no";then
56 svk info
${SOURCE_DIR} >/dev
/null
2>&1 && HAVESVK
=yes
57 TMP_MIRRORED_REVISION
=`(svk info ${SOURCE_DIR} 2>/dev/null) |grep 'Mirrored From:.*samba\.org.*' |sed -e 's/Mirrored From: .* Rev\..* \([0-9]*\).*/\1/'`
58 if test -n "$TMP_MIRRORED_REVISION"; then
59 TMP_SVK_REVISION_STR
="${TMP_REVISION}-${USER}@${HOSTNAME}-[SVN-${TMP_MIRRORED_REVISION}]"
61 TMP_SVK_REVISION_STR
="${TMP_REVISION}-${USER}@${HOSTNAME}"
65 if test x
"${HAVESVN}" = x
"yes";then
66 SAMBA_VERSION_STRING
="${SAMBA_VERSION_STRING}-SVN-build-${TMP_REVISION}"
67 echo "#define SAMBA_VERSION_SVN_REVISION ${TMP_REVISION}" >> $OUTPUT_FILE
68 elif test x
"${HAVESVK}" = x
"yes";then
69 SAMBA_VERSION_STRING
="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}"
71 SAMBA_VERSION_STRING
="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN"
76 if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
77 echo "#define SAMBA_VERSION_VENDOR_SUFFIX ${SAMBA_VERSION_VENDOR_SUFFIX}" >> $OUTPUT_FILE
80 echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
82 echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
84 echo "$0: 'include/version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
86 if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
87 echo "$0: with VENDOR_SUFFIX = ${SAMBA_VERSION_VENDOR_SUFFIX}"