summaryrefslogtreecommitdiff
path: root/packaging/RHEL-CTDB/makespec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/RHEL-CTDB/makespec.sh')
-rwxr-xr-xpackaging/RHEL-CTDB/makespec.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/packaging/RHEL-CTDB/makespec.sh b/packaging/RHEL-CTDB/makespec.sh
new file mode 100755
index 0000000000..7d10d55ab4
--- /dev/null
+++ b/packaging/RHEL-CTDB/makespec.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Copyright (C) Michael Adam 2008
+#
+# Script to determine the samba version and create the SPEC file from template
+
+DIRNAME=$(dirname $0)
+TOPDIR=${DIRNAME}/../..
+SRCDIR=${TOPDIR}/source
+VERSION_H=${SRCDIR}/include/version.h
+SPECFILE=${DIRNAME}/samba.spec
+
+##
+## determine the samba version and create the SPEC file
+##
+pushd ${SRCDIR}
+./script/mkversion.sh
+popd
+if [ ! -f ${VERSION_H} ] ; then
+ echo "Error creating version.h"
+ exit 1
+fi
+
+VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING ${VERSION_H} | awk '{print $3}'`
+vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX ${VERSION_H} | awk '{print
+$3}'`
+if test "x${vendor_version}" != "x" ; then
+ VERSION="${VERSION}-${vendor_version}"
+fi
+VERSION=`echo ${VERSION} | sed 's/-/_/g'`
+VERSION=`echo ${VERSION} | sed 's/\"//g'`
+echo "VERSION: ${VERSION}"
+sed -e s/PVERSION/${VERSION}/g \
+ < ${SPECFILE}.tmpl \
+ > ${SPECFILE}
+