summaryrefslogtreecommitdiffstats
path: root/ctdb/packaging
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-10-30 11:52:19 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-10-30 15:58:14 +1100
commit49bddd6f1eddb252227d2e09526961b56c7c30fd (patch)
tree05f50bb8ad3f8dbaa4d1d71389c12a993f42bb39 /ctdb/packaging
parentb0f90052cba094904a5fd24485c0091d45254937 (diff)
downloadsamba-49bddd6f1eddb252227d2e09526961b56c7c30fd.tar.gz
samba-49bddd6f1eddb252227d2e09526961b56c7c30fd.tar.xz
samba-49bddd6f1eddb252227d2e09526961b56c7c30fd.zip
packaging: Use optional argument as targetdir when creating tarball
In addition, do not modify CTDB version string with extra suffix. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 3d4838db51dd8199b9c29aebb6e7bfbd2a27b8bb)
Diffstat (limited to 'ctdb/packaging')
-rwxr-xr-xctdb/packaging/maketarball.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/ctdb/packaging/maketarball.sh b/ctdb/packaging/maketarball.sh
index 677e1e7148..221fede327 100755
--- a/ctdb/packaging/maketarball.sh
+++ b/ctdb/packaging/maketarball.sh
@@ -20,23 +20,22 @@
#
# Create CTDB source tarball of the current git branch HEAD.
-# The version is extracted from the spec file...
-# The first extra argument will be added as an additional version.
+# The version is calculated from git tag in mkversion.sh.
+# Optional argument is the directory to which tarball is copied.
#
DIRNAME=$(dirname $0)
TOPDIR=${DIRNAME}/..
+TARGETDIR="$1"
+if [ -z "${TARGETDIR}" ]; then
+ TARGETDIR="."
+fi
+
TAR_PREFIX_TMP="ctdb-tmp"
SPECFILE=/tmp/${TAR_PREFIX_TMP}/packaging/RPM/ctdb.spec
SPECFILE_IN=${SPECFILE}.in
-
-EXTRA_SUFFIX="$1"
-
-VERSION=$(${TOPDIR}/packaging/mkversion.sh)
-if [ -z "$VERSION" ]; then
- exit 1
-fi
+VERSION_H=/tmp/${TAR_PREFIX_TMP}/include/version.h
if echo | gzip -c --rsyncable - > /dev/null 2>&1 ; then
GZIP="gzip -9 --rsyncable"
@@ -54,14 +53,15 @@ if [ $RC -ne 0 ]; then
exit 1
fi
+VERSION=$(${TOPDIR}/packaging/mkversion.sh ${VERSION_H})
+if [ -z "$VERSION" ]; then
+ exit 1
+fi
+
sed -e s/@VERSION@/${VERSION}/g \
< ${SPECFILE_IN} \
> ${SPECFILE}
-if [ "x${EXTRA_SUFFIX}" != "x" ]; then
- VERSION="${VERSION}-${EXTRA_SUFFIX}"
-fi
-
TAR_PREFIX="ctdb-${VERSION}"
TAR_BASE="ctdb-${VERSION}"
@@ -113,7 +113,7 @@ rm -rf ${TAR_PREFIX}
popd
-mv /tmp/${TAR_GZ_BALL} .
+mv /tmp/${TAR_GZ_BALL} ${TARGETDIR}/
echo "Done."
exit 0