summaryrefslogtreecommitdiff
path: root/packaging/RHEL-CTDB/makerpms.sh
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-05-16 00:52:46 +0200
committerMichael Adam <obnox@samba.org>2008-05-16 03:15:23 +0200
commite1458f49b62c772526cad879cab7754846abb9ae (patch)
treec112e8c7e7ca0e3eea9647df91cfd537f2800f0c /packaging/RHEL-CTDB/makerpms.sh
parent67a0bfa7647f954b27a864e0ff8e55db9aad5752 (diff)
downloadsamba-e1458f49b62c772526cad879cab7754846abb9ae.tar.gz
samba-e1458f49b62c772526cad879cab7754846abb9ae.tar.bz2
samba-e1458f49b62c772526cad879cab7754846abb9ae.zip
packaging: use git-archive in RHEL-CTDB/makerpms.sh
(instead of using tar and make distclean and ...) Michael (cherry picked from commit 3ad0f2212720eb5fb33794c033a60f5ea4428c2c) (This used to be commit 161e7c32caf5d4fee23e1f9c5e8ea871ad2aa57e)
Diffstat (limited to 'packaging/RHEL-CTDB/makerpms.sh')
-rwxr-xr-xpackaging/RHEL-CTDB/makerpms.sh43
1 files changed, 12 insertions, 31 deletions
diff --git a/packaging/RHEL-CTDB/makerpms.sh b/packaging/RHEL-CTDB/makerpms.sh
index 94714e4ddd..0ee00b7688 100755
--- a/packaging/RHEL-CTDB/makerpms.sh
+++ b/packaging/RHEL-CTDB/makerpms.sh
@@ -21,8 +21,6 @@ SRCDIR=`rpm --eval %_sourcedir`
# At this point the SPECDIR and SRCDIR variables must have a value!
-USERID=`id -u`
-GRPID=`id -g`
VERSION='3.2.0'
REVISION='ctdb'
SPECFILE="samba.spec"
@@ -43,49 +41,35 @@ case $RPMVER in
;;
esac
-pushd .
-cd ../../source
-if [ -f Makefile ]; then
- make distclean
-fi
-popd
-
-pushd .
-cd ../../
-SRCTREE=`basename $PWD`
-if [ "x${DOCS_TARBALL}" != "x" ] && [ -f ${DOCS_TARBALL} ]; then
- cp ${DOCS_TARBALL} ${SRCDIR}/${DOCS}
-fi
-cd ../
-chown -R ${USERID}.${GRPID} $SRCTREE
-if [ ! -d samba-${VERSION} ]; then
- ln -s $SRCTREE samba-${VERSION} || exit 1
-fi
+pushd ../..
echo -n "Creating samba-${VERSION}.tar.bz2 ... "
-tar --exclude=.svn --exclude=.bzr --exclude=.bzrignore --exclude=docs-orig -chf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2
+git archive --prefix=samba-${VERSION}/ HEAD | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2
+RC=$?
+popd
echo "Done."
-if [ $? -ne 0 ]; then
- popd
- cd ../../
+if [ $RC -ne 0 ]; then
echo "Build failed!"
exit 1
fi
-popd
-
##
## copy additional source files
##
+if [ "x${DOCS_TARBALL}" != "x" ] && [ -f ${DOCS_TARBALL} ]; then
+ cp ${DOCS_TARBALL} ${SRCDIR}/${DOCS}
+fi
+
chmod 755 setup/filter-requires-samba.sh
tar --exclude=.svn -jcvf - setup > ${SRCDIR}/setup.tar.bz2
+
cp -p ${SPECFILE} ${SPECDIR}
##
## Build
##
echo "$(basename $0): Getting Ready to build release package"
-cd ${SPECDIR}
+pushd ${SPECDIR}
${RPM} -ba $EXTRA_OPTIONS $SPECFILE
[ `arch` = "x86_64" ] && {
echo "Building 32 bit winbind libs"
@@ -95,10 +79,7 @@ ${RPM} -ba $EXTRA_OPTIONS $SPECFILE
${RPM} -ba --rebuild --target=i386 $SPECFILE
}
-
-
-
-cd ../../
+popd
echo "$(basename $0): Done."