packaging/RHEL-CTDB: add "BUILD_GPFS=no configure.rpm" and "BUILD_GPFS=no makerpms.sh"
authorStefan Metzmacher <metze@samba.org>
Mon, 17 Sep 2012 16:15:03 +0000 (18:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 18 Sep 2012 02:17:23 +0000 (04:17 +0200)
metze

packaging/RHEL-CTDB/configure.rpm
packaging/RHEL-CTDB/makespec.sh
packaging/RHEL-CTDB/samba.spec.tmpl

index 222fec04dfee38ed777bd6d0b3406aa01585ed19..4387da10720b9bfeb868eab934ff51459a4bb631 100755 (executable)
@@ -24,6 +24,12 @@ else
        CC="gcc"
 fi
 
+shared_modules="idmap_rid,idmap_ad,idmap_tdb2"
+
+if test "x$BUILD_GPFS" != "xno"; then
+       shared_modules="${shared_modules},vfs_gpfs,vfs_tsmsm"
+fi
+
 ./autogen.sh
 
 CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE -O3" ./configure -C \
@@ -51,7 +57,7 @@ CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE -O3" ./configure -C \
        --without-smbwrapper \
        --with-pam \
        --with-quotas \
-       --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs,vfs_tsmsm \
+       --with-shared-modules=${shared_modules} \
        --with-syslog \
        --with-utmp \
        --with-cluster-support \
index a8c582b6af9a695acd1c1594015be729f3d88010..7c8a8ee4f0a5bed5c29b3f368989b44cde5c4448 100755 (executable)
@@ -45,12 +45,19 @@ else
        echo "GITHASH: ${GITHASH}"
 fi
 
+if test "x$BUILD_GPFS" = "xno"; then
+       echo "GPFS: not build by default"
+       PGPFS_DEFAULT="%{?_with_gpfs: 1} %{?!_with_gpfs: 0}"
+else
+       echo "GPFS: build by default"
+       PGPFS_DEFAULT="%{?_with_no_gpfs: 0} %{?!_with_no_gpfs: 1}"
+fi
 
 sed \
-       -e s/PVERSION/${VERSION}/g \
-       -e s/GITHASH/${GITHASH}/g \
-       -e s/LIBTDBVERSION/${LIBTDBVERSION}/g \
-       -e s/LIBTALLOCVERSION/${LIBTALLOCVERSION}/g \
+       -e "s/PVERSION/${VERSION}/g" \
+       -e "s/GITHASH/${GITHASH}/g" \
+       -e "s/PGPFS_NO_DEFAULT/${PGPFS_NO_DEFAULT}/g" \
+       -e "s/PGPFS_DEFAULT/${PGPFS_DEFAULT}/g" \
        < ${SPECFILE}.tmpl \
        > ${SPECFILE}
 
index 2e42afb3fe8a6486ccba7a4f2310d495c498fde9..61a5bdd06ff521aa9615333fbc101393b335525d 100644 (file)
@@ -46,6 +46,21 @@ BuildRequires: ctdb-devel >= 1.2.25
 
 %define numcpu  %(grep "^processor" /proc/cpuinfo |wc -l | sed -e 's/^0$/1/')
 
+%define with_vfs_gpfs PGPFS_DEFAULT
+%define with_vfs_tsmsm PGPFS_DEFAULT
+
+%if %{with_vfs_tsmsm}
+%define                vfs_tsmsm       ,vfs_tsmsm
+%endif
+
+%if %{with_vfs_gpfs}
+%define                vfs_gpfs        ,vfs_gpfs
+%endif
+
+%define                vfs_modules %{?vfs_gpfs}%{?vfs_tsmsm}
+
+%define                shared_modules idmap_rid,idmap_ad,idmap_tdb2%{vfs_modules}
+
 %description
 Samba is the protocol by which a lot of PC-related machines share
 files, printers, and other information (such as lists of available
@@ -137,7 +152,6 @@ export CC
 ## always run autogen.sh
 ./autogen.sh
 
-
 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
        --prefix=%{_prefix} \
        --localstatedir=/var \
@@ -161,7 +175,7 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
        --without-smbwrapper \
        --with-pam \
        --with-quotas \
-       --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs,vfs_tsmsm \
+       --with-shared-modules=%{shared_modules} \
        --with-syslog \
        --with-utmp \
        --with-cluster-support \
@@ -192,7 +206,12 @@ make -j %{numcpu} %{?_smp_mflags} \
 
 # check that desired suppor has been compiled into smbd:
 export LD_LIBRARY_PATH=./bin
-for test in HAVE_POSIX_ACLS HAVE_LDAP HAVE_KRB5 HAVE_GPFS CLUSTER_SUPPORT
+
+HAVE_VARS="HAVE_POSIX_ACLS HAVE_LDAP HAVE_KRB5 CLUSTER_SUPPORT"
+%if %{with_vfs_gpfs}
+       HAVE_VARS="${HAVE_VARS} HAVE_GPFS"
+%endif
+for test in ${HAVE_VARS}
 do
        if ! $(./bin/smbd -b | grep -q $test ) ; then
                echo "ERROR: '$test' is not in smbd. Build stopped."
@@ -391,7 +410,9 @@ exit 0
 %{_libarchdir}/samba/vfs/fake_perms.so
 %{_libarchdir}/samba/vfs/fileid.so
 %{_libarchdir}/samba/vfs/full_audit.so
+%if %{with_vfs_gpfs}
 %{_libarchdir}/samba/vfs/gpfs.so
+%endif
 %{_libarchdir}/samba/vfs/linux_xfs_sgid.so
 %{_libarchdir}/samba/vfs/netatalk.so
 %{_libarchdir}/samba/vfs/preopen.so
@@ -406,7 +427,9 @@ exit 0
 %{_libarchdir}/samba/vfs/streams_xattr.so
 %{_libarchdir}/samba/vfs/syncops.so
 %{_libarchdir}/samba/vfs/time_audit.so
+%if %{with_vfs_tsmsm}
 %{_libarchdir}/samba/vfs/tsmsm.so
+%endif
 %{_libarchdir}/samba/vfs/xattr_tdb.so
 %{_libarchdir}/samba/vfs/aio_posix.so
 %{_libarchdir}/samba/vfs/aio_pthread.so