summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/VERSION19
-rw-r--r--source4/lib/version.c28
-rwxr-xr-xsource4/script/mkversion.sh20
3 files changed, 54 insertions, 13 deletions
diff --git a/source4/VERSION b/source4/VERSION
index f318e55e5f..c0b066cca1 100644
--- a/source4/VERSION
+++ b/source4/VERSION
@@ -34,6 +34,16 @@ SAMBA_VERSION_RELEASE=0
SAMBA_VERSION_REVISION=
########################################################
+# For 'tp' releases the version will be #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>tp<TP_RELEASE> #
+# #
+# e.g. SAMBA_VERSION_PRE_RELEASE=1 #
+# -> "4.0.0tp1" #
+########################################################
+SAMBA_VERSION_TP_RELEASE=
+
+########################################################
# For 'pre' releases the version will be #
# #
# <MAJOR>.<MINOR>.<RELEASE>pre<PRE_RELEASE> #
@@ -66,6 +76,15 @@ SAMBA_VERSION_RC_RELEASE=
SAMBA_VERSION_IS_SVN_SNAPSHOT=yes
########################################################
+# This is for specifying a release nickname #
+# #
+# e.g. SAMBA_VERSION_RELEASE_NICKNAME="Nicky Nickname" #
+# smbd --version will then give: #
+# -> "4.0.0-tp1-VendorVersion (Nicky Nickname)" #
+########################################################
+SAMBA_VERSION_RELEASE_NICKNAME=
+
+########################################################
# This can be set by vendors if they want... #
# This can be a string constant or a function which #
# returns a string (const char *) #
diff --git a/source4/lib/version.c b/source4/lib/version.c
index 1adbc91385..a5733a953d 100644
--- a/source4/lib/version.c
+++ b/source4/lib/version.c
@@ -24,21 +24,33 @@
const char *samba_version_string(void)
{
-#ifndef SAMBA_VERSION_VENDOR_SUFFIX
- return SAMBA_VERSION_OFFICIAL_STRING;
+ const char *official_string = SAMBA_VERSION_OFFICIAL_STRING;
+#ifdef SAMBA_VERSION_RELEASE_NICKNAME
+ const char *release_nickname = SAMBA_VERSION_RELEASE_NICKNAME;
#else
+ const char *release_nickname = NULL;
+#endif
+#ifdef SAMBA_VERSION_VENDOR_SUFFIX
+ const char *vendor_suffix = SAMBA_VERSION_VENDOR_SUFFIX;
+#else
+ const char *vendor_suffix = NULL;
+#endif
static char *samba_version;
static BOOL init_samba_version;
- if (init_samba_version)
+ if (init_samba_version) {
return samba_version;
+ }
- samba_version = talloc_asprintf(
- talloc_autofree_context(), "%s-%s",
- SAMBA_VERSION_OFFICIAL_STRING,
- SAMBA_VERSION_VENDOR_SUFFIX);
+ samba_version = talloc_asprintf(talloc_autofree_context(),
+ "%s%s%s%s%s%s",
+ official_string,
+ (vendor_suffix?"-":""),
+ (vendor_suffix?vendor_suffix:""),
+ (release_nickname?" (":""),
+ (release_nickname?release_nickname:""),
+ (release_nickname?")":""));
init_samba_version = True;
return samba_version;
-#endif
}
diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh
index 8e5fea5c8b..814b47e9d0 100755
--- a/source4/script/mkversion.sh
+++ b/source4/script/mkversion.sh
@@ -19,14 +19,16 @@ SAMBA_VERSION_RELEASE=`sed -n 's/^SAMBA_VERSION_RELEASE=//p' $SOURCE_DIR$VERSION
SAMBA_VERSION_REVISION=`sed -n 's/^SAMBA_VERSION_REVISION=//p' $SOURCE_DIR$VERSION_FILE`
+SAMBA_VERSION_TP_RELEASE=`sed -n 's/^SAMBA_VERSION_TP_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
SAMBA_VERSION_PRE_RELEASE=`sed -n 's/^SAMBA_VERSION_PRE_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
SAMBA_VERSION_RC_RELEASE=`sed -n 's/^SAMBA_VERSION_RC_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
-SAMBA_VERSION_TP_RELEASE=`sed -n 's/^SAMBA_VERSION_TP_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
-
SAMBA_VERSION_IS_SVN_SNAPSHOT=`sed -n 's/^SAMBA_VERSION_IS_SVN_SNAPSHOT=//p' $SOURCE_DIR$VERSION_FILE`
+SAMBA_VERSION_RELEASE_NICKNAME=`sed -n 's/^SAMBA_VERSION_RELEASE_NICKNAME=//p' $SOURCE_DIR$VERSION_FILE`
+
SAMBA_VERSION_VENDOR_SUFFIX=`sed -n 's/^SAMBA_VERSION_VENDOR_SUFFIX=//p' $SOURCE_DIR$VERSION_FILE`
echo "/* Autogenerated by script/mkversion.sh */" > $OUTPUT_FILE
@@ -42,15 +44,15 @@ SAMBA_VERSION_STRING="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERS
if test -n "${SAMBA_VERSION_REVISION}";then
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}${SAMBA_VERSION_REVISION}"
echo "#define SAMBA_VERSION_REVISION \"${SAMBA_VERSION_REVISION}\"" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_TP_RELEASE}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}tp${SAMBA_VERSION_TP_RELEASE}"
+ echo "#define SAMBA_VERSION_TP_RELEASE ${SAMBA_VERSION_TP_RELEASE}" >> $OUTPUT_FILE
elif test -n "${SAMBA_VERSION_PRE_RELEASE}";then
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}pre${SAMBA_VERSION_PRE_RELEASE}"
echo "#define SAMBA_VERSION_PRE_RELEASE ${SAMBA_VERSION_PRE_RELEASE}" >> $OUTPUT_FILE
elif test -n "${SAMBA_VERSION_RC_RELEASE}";then
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}rc${SAMBA_VERSION_RC_RELEASE}"
echo "#define SAMBA_VERSION_RC_RELEASE ${SAMBA_VERSION_RC_RELEASE}" >> $OUTPUT_FILE
-elif test -n "${SAMBA_VERSION_TP_RELEASE}";then
- SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-tp${SAMBA_VERSION_TP_RELEASE}"
- echo "#define SAMBA_VERSION_TP_RELEASE ${SAMBA_VERSION_TP_RELEASE}" >> $OUTPUT_FILE
elif test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
_SAVE_LANG=${LANG}
LANG=""
@@ -79,6 +81,10 @@ elif test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
LANG=${_SAVE_LANG}
fi
+if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then
+ echo "#define SAMBA_VERSION_RELEASE_NICKNAME ${SAMBA_VERSION_RELEASE_NICKNAME}" >> $OUTPUT_FILE
+fi
+
if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
echo "#define SAMBA_VERSION_VENDOR_SUFFIX ${SAMBA_VERSION_VENDOR_SUFFIX}" >> $OUTPUT_FILE
fi
@@ -89,6 +95,10 @@ echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
echo "$0: 'include/version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
+if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then
+ echo "$0: with RELEASE_NICKNAME = ${SAMBA_VERSION_RELEASE_NICKNAME}"
+fi
+
if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
echo "$0: with VENDOR_SUFFIX = ${SAMBA_VERSION_VENDOR_SUFFIX}"
fi