summaryrefslogtreecommitdiff
path: root/packaging/RHEL-CTDB
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-09-12 15:50:33 +0200
committerMichael Adam <obnox@samba.org>2008-12-11 17:53:44 +0100
commit9ecb169debbdfea03036dc293366bf2063be1448 (patch)
treea1e93ff9690a9b1bec5c35a0fd98312d66a48c5e /packaging/RHEL-CTDB
parent1ad04b031902aa6d89365f839178b6fb23bfdb2a (diff)
downloadsamba-9ecb169debbdfea03036dc293366bf2063be1448.tar.gz
samba-9ecb169debbdfea03036dc293366bf2063be1448.tar.bz2
samba-9ecb169debbdfea03036dc293366bf2063be1448.zip
packaging(RHEL-CTDB): refactor creation of spec file from template out
into new script makespec.sh Michael (cherry picked from commit d49a9d1c67e4d98017ce5f7d1351bca1366e1a8d) (cherry picked from commit 086873f00de96ca48717b05dddb71e776c74ca7d)
Diffstat (limited to 'packaging/RHEL-CTDB')
-rwxr-xr-xpackaging/RHEL-CTDB/makerpms.sh25
-rwxr-xr-xpackaging/RHEL-CTDB/makespec.sh36
2 files changed, 42 insertions, 19 deletions
diff --git a/packaging/RHEL-CTDB/makerpms.sh b/packaging/RHEL-CTDB/makerpms.sh
index 219982fda9..c85b865f79 100755
--- a/packaging/RHEL-CTDB/makerpms.sh
+++ b/packaging/RHEL-CTDB/makerpms.sh
@@ -25,8 +25,6 @@ RPMSRCDIR=`rpm --eval %_sourcedir`
DIRNAME=$(dirname $0)
TOPDIR=${DIRNAME}/../..
-SRCDIR=${TOPDIR}/source
-VERSION_H=${SRCDIR}/include/version.h
SPECFILE="samba.spec"
DOCS="docs.tar.bz2"
@@ -49,25 +47,14 @@ esac
##
## 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
+${DIRNAME}/makespec.sh
+RC=$?
+if [ $RC -ne 0 ]; then
+ exit ${RC}
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 \
- < ${DIRNAME}/${SPECFILE}.tmpl \
- > ${DIRNAME}/${SPECFILE}
+RELEASE=$(grep ^Release ${DIRNAME}${SPECFILE} | sed -e 's/^Release:\ \+//')
+VERSION=$(grep ^Version ${DIRNAME}${SPECFILE} | sed -e 's/^Version:\ \+//')
##
## create the tarball
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}
+