diff options
-rwxr-xr-x | packaging/RHEL-CTDB/makerpms.sh | 28 | ||||
-rw-r--r-- | packaging/RHEL-CTDB/samba.spec.tmpl (renamed from packaging/RHEL-CTDB/samba.spec) | 2 |
2 files changed, 28 insertions, 2 deletions
diff --git a/packaging/RHEL-CTDB/makerpms.sh b/packaging/RHEL-CTDB/makerpms.sh index 978cca92da..0c8a2deea1 100755 --- a/packaging/RHEL-CTDB/makerpms.sh +++ b/packaging/RHEL-CTDB/makerpms.sh @@ -23,9 +23,10 @@ RPMSRCDIR=`rpm --eval %_sourcedir` DIRNAME=$(dirname $0) TOPDIR=${DIRNAME}/../.. +SRCDIR=${TOPDIR}/source +VERSION_H=${SRCDIR}/include/version.h SPECFILE="samba.spec" -VERSION=$(grep ^Version ${DIRNAME}/${SPECFILE} | sed -e 's/^Version:\ \+//') DOCS="docs.tar.bz2" RPMVER=`rpm --version | awk '{print $3}'` RPM="rpmbuild" @@ -43,6 +44,31 @@ case $RPMVER in ;; 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 +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'` +echo "VERSION: ${VERSION}" +sed -e s/PVERSION/${VERSION}/g \ + < ${DIRNAME}/${SPECFILE}.tmpl \ + > ${DIRNAME}/${SPECFILE} + +## +## create the tarball +## pushd ${TOPDIR} echo -n "Creating samba-${VERSION}.tar.bz2 ... " git archive --prefix=samba-${VERSION}/ HEAD | bzip2 > ${RPMSRCDIR}/samba-${VERSION}.tar.bz2 diff --git a/packaging/RHEL-CTDB/samba.spec b/packaging/RHEL-CTDB/samba.spec.tmpl index 5f5edad05e..b34f01f659 100644 --- a/packaging/RHEL-CTDB/samba.spec +++ b/packaging/RHEL-CTDB/samba.spec.tmpl @@ -5,7 +5,7 @@ Summary: Samba SMB client and server Vendor: Samba Team Packager: Samba Team <samba@samba.org> Name: samba -Version: 3.3.0 +Version: PVERSION Release: ctdb.1 Epoch: 0 License: GNU GPL version 3 |