From e1458f49b62c772526cad879cab7754846abb9ae Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 16 May 2008 00:52:46 +0200 Subject: 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) --- packaging/RHEL-CTDB/makerpms.sh | 43 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) (limited to 'packaging') 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." -- cgit