]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
more build tweaks
authorAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 05:52:03 +0000 (15:52 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 05:52:03 +0000 (15:52 +1000)
(This used to be ctdb commit d4c3380c7a9d332311c5d03ba151e7f2f90796a3)

ctdb/Makefile.in
ctdb/packaging/RHEL/ctdb.spec
ctdb/packaging/RHEL/makerpms.sh

index da892542ee9cb75d65e8b6be91c49bed542a02c3..f07324920cf891499bf4fb33c38e3b3febab4958 100644 (file)
@@ -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
index 59b1655565d127153b54707c3014f3a11dd4ad97..e12de6a31938f481d5ec4e3f785d44eb406dce51 100644 (file)
@@ -44,6 +44,7 @@ CC="gcc"
 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
        --prefix=%{_prefix} \
 
+make showflags
 make   
 
 %install
index d638b4ab5709c1c3e00bb3346e1e5d9c57a03df3..e43d53683c763cd95676083ac467cd55d0bbaec7 100755 (executable)
@@ -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
 
 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
-