From: Andrew Tridgell Date: Tue, 29 May 2007 05:52:03 +0000 (+1000) Subject: more build tweaks X-Git-Tag: tevent-0.9.20~348^2~2647 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f605ccdb2988d4d5bc44084f65cedbdda57d1f2;p=thirdparty%2Fsamba.git more build tweaks (This used to be ctdb commit d4c3380c7a9d332311c5d03ba151e7f2f90796a3) --- diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in index da892542ee9..f07324920cf 100644 --- a/ctdb/Makefile.in +++ b/ctdb/Makefile.in @@ -7,6 +7,7 @@ datarootdir = @datarootdir@ includedir = @includedir@ libdir = @libdir@ bindir = @bindir@ +sbindir = @sbindir@ localstatedir = @localstatedir@ VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@ srcdir = @srcdir@ @@ -42,11 +43,13 @@ CTDB_OBJ = $(CTDB_COMMON_OBJ) $(CTDB_TAKEOVER_OBJ) $(CTDB_TCP_OBJ) $(POPT_OBJ) OBJS = @TDB_OBJ@ @TALLOC_OBJ@ @LIBREPLACEOBJ@ @INFINIBAND_WRAPPER_OBJ@ $(EXTRA_OBJ) @EVENTS_OBJ@ $(CTDB_OBJ) $(UTIL_OBJ) -BINS = bin/ctdbd bin/ctdbd_test bin/ctdb_test bin/ctdb_bench bin/ctdb_messaging bin/ctdb_fetch bin/ctdb_fetch1 bin/lockwait bin/ctdb @INFINIBAND_BINS@ +TEST_BINS=bin/ctdbd_test bin/ctdb_test bin/ctdb_bench bin/ctdb_messaging bin/ctdb_fetch bin/ctdb_fetch1 bin/lockwait @INFINIBAND_BINS@ +BINS = bin/ctdb +SBINS = bin/ctdbd DIRS = lib bin -all: showflags dirs $(OBJS) $(BINS) +all: showflags dirs $(OBJS) $(BINS) $(SBINS) $(TEST_BINS) showflags: @echo 'ctdb will be compiled with flags:' @@ -115,6 +118,7 @@ install: all mkdir -p $(DESTDIR)$(bindir) mkdir -p $(DESTDIR)$(includedir) rsync $(BINS) $(DESTDIR)$(bindir) + rsync $(SBINS) $(DESTDIR)$(sbindir) rsync $(srcdir)/include/ctdb.h $(DESTDIR)$(includedir) test: all diff --git a/ctdb/packaging/RHEL/ctdb.spec b/ctdb/packaging/RHEL/ctdb.spec index 59b1655565d..e12de6a3193 100644 --- a/ctdb/packaging/RHEL/ctdb.spec +++ b/ctdb/packaging/RHEL/ctdb.spec @@ -44,6 +44,7 @@ CC="gcc" CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \ --prefix=%{_prefix} \ +make showflags make %install diff --git a/ctdb/packaging/RHEL/makerpms.sh b/ctdb/packaging/RHEL/makerpms.sh index d638b4ab570..e43d53683c7 100755 --- a/ctdb/packaging/RHEL/makerpms.sh +++ b/ctdb/packaging/RHEL/makerpms.sh @@ -2,6 +2,7 @@ # Copyright (C) John H Terpstra 1998-2002 # Gerald (Jerry) Carter 2003 # Jim McDonough 2007 +# Andrew Tridgell 2007 # The following allows environment variables to override the target directories # the alternative is to have a file in your home directory calles .rpmmacros @@ -14,6 +15,14 @@ EXTRA_OPTIONS="$1" +RHEL="packaging/RHEL" + +[ -d ${RHEL} ] || { + echo "Must run this from the ctdb directory" + exit 1 +} + + SPECDIR=`rpm --eval %_specdir` SRCDIR=`rpm --eval %_sourcedir` @@ -25,7 +34,7 @@ VERSION='1.0' REVISION='' SPECFILE="ctdb.spec" RPMVER=`rpm --version | awk '{print $3}'` -RPM="rpmbuild" +RPMBUILD="rpmbuild" ## ## Check the RPM version (paranoid) @@ -40,15 +49,11 @@ case $RPMVER in ;; esac -pushd . -cd ../.. if [ -f Makefile ]; then make distclean fi -popd pushd . -cd ../../ BASEDIR=`basename $PWD` cd .. chown -R ${USERID}.${GRPID} $BASEDIR @@ -57,7 +62,7 @@ if [ ! -d ctdb-${VERSION} ]; then REMOVE_LN=$PWD/ctdb-$VERSION fi echo -n "Creating ctdb-${VERSION}.tar.bz2 ... " -tar --exclude=.bzr --exclude .bzrignore --exclude packaging -cf - ctdb-${VERSION}/. | bzip2 > ${SRCDIR}/ctdb-${VERSION}.tar.bz2 +tar --exclude=.bzr --exclude .bzrignore --exclude packaging --exclude="*~" -cf - ctdb-${VERSION}/. | bzip2 > ${SRCDIR}/ctdb-${VERSION}.tar.bz2 echo "Done." if [ $? -ne 0 ]; then echo "Build failed!" @@ -71,16 +76,15 @@ popd ## ## copy additional source files ## -tar --exclude=.svn -jcvf - setup > ${SRCDIR}/ctdb-setup.tar.bz2 -cp -p ${SPECFILE} ${SPECDIR} +(cd packaging/RHEL && tar --exclude=.bzr --exclude="*~" -jcvf - setup) > ${SRCDIR}/ctdb-setup.tar.bz2 +cp -p ${RHEL}/${SPECFILE} ${SPECDIR} ## ## Build ## echo "$(basename $0): Getting Ready to build release package" cd ${SPECDIR} -${RPM} -ba --clean --rmsource $EXTRA_OPTIONS $SPECFILE +${RPMBUILD} -ba --clean --rmsource $EXTRA_OPTIONS $SPECFILE echo "$(basename $0): Done." [ ${REMOVE_LN} ] && rm $REMOVE_LN -