diff options
author | Michael Adam <obnox@samba.org> | 2008-09-04 14:36:29 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-09-08 14:43:38 +0200 |
commit | ebef5a89475784bb4b766c68c1bec4142d8a105e (patch) | |
tree | 65d1431a929178d4da1f58b748e3488e5da99a23 /packaging | |
parent | d4f87ed3b7827b13276e834e7b966b54aadcd470 (diff) | |
download | samba-ebef5a89475784bb4b766c68c1bec4142d8a105e.tar.gz |
packaging(RHEL-CTDB): autodetect the samba version number from version.h
Generate version.h first.
Create samba.spec from (new) samba.spec.tmpl, replacing PVERSION
by the version string. (as is done with update-pkginfo called
from the create-tarball release script)
Michael
(This used to be commit f1f3d1bef0440f4294f7278c0c38e13a10b6fb48)
Diffstat (limited to 'packaging')
-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 |