includedir = @includedir@
libdir = @libdir@
bindir = @bindir@
+sbindir = @sbindir@
localstatedir = @localstatedir@
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
srcdir = @srcdir@
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:'
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
# 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`
REVISION=''
SPECFILE="ctdb.spec"
RPMVER=`rpm --version | awk '{print $3}'`
-RPM="rpmbuild"
+RPMBUILD="rpmbuild"
##
## Check the RPM version (paranoid)
;;
esac
-pushd .
-cd ../..
if [ -f Makefile ]; then
make distclean
fi
-popd
pushd .
-cd ../../
BASEDIR=`basename $PWD`
cd ..
chown -R ${USERID}.${GRPID} $BASEDIR
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!"
##
## 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
-