mkdir -p `rpm --eval %_rpmdir`/i386
mkdir -p `rpm --eval %_rpmdir`/x86_64
-# We use tags and determine the version, as follows:
-# ctdb-0.9.1 (First release of 0.9).
-# ctdb-0.9.23 (23rd minor release of the 112 version)
-#
-# If we're not directly on a tag, this is a devel release; we append
-# .0.<patchnum>.<checksum>.devel to the release.
-TAG=`git describe`
-case "$TAG" in
- ctdb-*)
- TAG=${TAG##ctdb-}
- case "$TAG" in
- *-*-g*) # 0.9-168-ge6cf0e8
- # Not exactly on tag: devel version.
- VERSION=`echo "$TAG" | sed 's/\([^-]\+\)-\([0-9]\+\)-\(g[0-9a-f]\+\)/\1.0.\2.\3.devel/'`
- ;;
- *)
- # An actual release version
- VERSION=$TAG
- ;;
- esac
- ;;
- *)
- echo Invalid tag "$TAG" >&2
- exit 1
- ;;
-esac
+VERSION=$(${TOPDIR}/packaging/mkversion.sh)
+if [ -z "$VERSION" ]; then
+ exit 1
+fi
sed -e s/@VERSION@/$VERSION/g \
< ${DIRNAME}/${SPECFILE_IN} \
EXTRA_SUFFIX="$1"
-# if no githash was specified on the commandline,
-# then use the current head
-if test x"$GITHASH" = "x" ; then
- GITHASH="$(git log --pretty=format:%h -1)"
-fi
-
-GITHASH_SUFFIX=".${GITHASH}"
-if test "x$USE_GITHASH" = "xno" ; then
- GITHASH_SUFFIX=""
+VERSION=$(${TOPDIR}/packaging/mkversion.sh)
+if [ -z "$VERSION" ]; then
+ exit 1
fi
if echo | gzip -c --rsyncable - > /dev/null 2>&1 ; then
pushd ${TOPDIR}
echo "Creating tarball ... "
-git archive --prefix=${TAR_PREFIX_TMP}/ ${GITHASH} | ( cd /tmp ; tar xf - )
+git archive --prefix=${TAR_PREFIX_TMP}/ HEAD | ( cd /tmp ; tar xf - )
RC=$?
popd
if [ $RC -ne 0 ]; then
exit 1
fi
-sed -e s/GITHASH/${GITHASH_SUFFIX}/g \
+sed -e s/@VERSION@/${VERSION}/g \
< ${SPECFILE_IN} \
> ${SPECFILE}
-VERSION=$(grep ^Version ${SPECFILE} | sed -e 's/^Version:\ \+//')${GITHASH_SUFFIX}
-
if [ "x${EXTRA_SUFFIX}" != "x" ]; then
VERSION="${VERSION}-${EXTRA_SUFFIX}"
fi