summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-12-17 12:13:42 +0100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-01-16 20:49:52 +1100
commit5c99c26dae7dc5203c1617e3d8671391daf51648 (patch)
treeb4a00d10ec2dcc5ccee116d32c874ff29f57e74f /ctdb
parentb1bca68f83f56d754261d1998859cf2a78d014df (diff)
downloadsamba-5c99c26dae7dc5203c1617e3d8671391daf51648.tar.gz
samba-5c99c26dae7dc5203c1617e3d8671391daf51648.tar.xz
samba-5c99c26dae7dc5203c1617e3d8671391daf51648.zip
makerpms: remove the need of calling makerpms.sh from the top level directory
Instead, extract needed information from the dirname of the invoked name. Michael (This used to be ctdb commit cf1e46d734ed51b4ac2eb8a09f2f787ae5c51092)
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/packaging/RPM/makerpms.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/ctdb/packaging/RPM/makerpms.sh b/ctdb/packaging/RPM/makerpms.sh
index b92a183475..411bfb7bf9 100755
--- a/ctdb/packaging/RPM/makerpms.sh
+++ b/ctdb/packaging/RPM/makerpms.sh
@@ -15,10 +15,8 @@
EXTRA_OPTIONS="$1"
-[ -d packaging ] || {
- echo "Must run this from the ctdb directory"
- exit 1
-}
+DIRNAME=$(dirname $0)
+TOPDIR=${DIRNAME}/../..
SPECDIR=`rpm --eval %_specdir`
SRCDIR=`rpm --eval %_sourcedir`
@@ -28,9 +26,11 @@ REVISION=''
SPECFILE="ctdb.spec"
RPMBUILD="rpmbuild"
+pushd ${TOPDIR}
echo -n "Creating ctdb-${VERSION}.tar.gz ... "
git archive --prefix=ctdb-${VERSION}/ HEAD | gzip -9 --rsyncable > ${SRCDIR}/ctdb-${VERSION}.tar.gz
RC=$?
+popd
echo "Done."
if [ $RC -ne 0 ]; then
echo "Build failed!"
@@ -42,7 +42,7 @@ fi
##
## copy additional source files
##
-cp -p packaging/RPM/${SPECFILE} ${SPECDIR}
+cp -p ${DIRNAME}/${SPECFILE} ${SPECDIR}
##
## Build