Ian Kent 8c1733
autofs-5.1.4 - add conditional inclusion of fedfs binaries
Ian Kent 8c1733
Ian Kent 8c1733
From: Ian Kent <raven@themaw.net>
Ian Kent 8c1733
Ian Kent 8c1733
Add conditional inclusion of the fedfs binaries.
Ian Kent 8c1733
Ian Kent 8c1733
Using configure a --with-fedfs is needed to build and install
Ian Kent 8c1733
the fedfs binaries.
Ian Kent 8c1733
Ian Kent 8c1733
Using rpmbuild -tb <autofs tar> it's necessary to add the option
Ian Kent 8c1733
--without fedfs to exclude the fedfs binaries from the resulting
Ian Kent 8c1733
rpm package.
Ian Kent 8c1733
Ian Kent 8c1733
Signed-off-by: Ian Kent <raven@themaw.net>
Ian Kent 8c1733
---
Ian Kent 8c1733
 CHANGELOG        |    1 +
Ian Kent 8c1733
 Makefile.conf.in |    2 ++
Ian Kent 8c1733
 Makefile.rules   |    6 +++++-
Ian Kent 8c1733
 autofs.spec      |   12 +++++++++++-
Ian Kent 8c1733
 configure        |   16 ++++++++++++++++
Ian Kent 8c1733
 configure.in     |    9 +++++++++
Ian Kent 8c1733
 6 files changed, 44 insertions(+), 2 deletions(-)
Ian Kent 8c1733
Ian Kent 8c1733
diff --git a/CHANGELOG b/CHANGELOG
Ian Kent 8c1733
index 412e3382..bbe8019e 100644
Ian Kent 8c1733
--- a/CHANGELOG
Ian Kent 8c1733
+++ b/CHANGELOG
Ian Kent 8c1733
@@ -17,6 +17,7 @@ xx/xx/2018 autofs-5.1.5
Ian Kent 8c1733
 - add fedfs-getsrvinfo.c.
Ian Kent 8c1733
 - add mount.fedfs.c.
Ian Kent 8c1733
 - add fedfs-map-nfs4.c.
Ian Kent 8c1733
+- add conditional inclusion of fedfs binaries.
Ian Kent 8c1733
 
Ian Kent 8c1733
 19/12/2017 autofs-5.1.4
Ian Kent 8c1733
 - fix spec file url.
Ian Kent 8c1733
diff --git a/Makefile.conf.in b/Makefile.conf.in
Ian Kent 8c1733
index 85662654..3fe1a0a0 100644
Ian Kent 8c1733
--- a/Makefile.conf.in
Ian Kent 8c1733
+++ b/Makefile.conf.in
Ian Kent 8c1733
@@ -58,6 +58,8 @@ EXT3FS = @HAVE_E3FSCK@
Ian Kent 8c1733
 # Support for calling e4fsck when mounting ext4 filesystems
Ian Kent 8c1733
 EXT4FS = @HAVE_E4FSCK@
Ian Kent 8c1733
 
Ian Kent 8c1733
+FEDFS = @ENABLE_FEDFS@
Ian Kent 8c1733
+
Ian Kent 8c1733
 LEX = @PATH_LEX@
Ian Kent 8c1733
 YACC = @PATH_YACC@
Ian Kent 8c1733
 RPCGEN = @PATH_RPCGEN@
Ian Kent 8c1733
diff --git a/Makefile.rules b/Makefile.rules
Ian Kent 8c1733
index fc9f6019..2ccb1f6e 100644
Ian Kent 8c1733
--- a/Makefile.rules
Ian Kent 8c1733
+++ b/Makefile.rules
Ian Kent 8c1733
@@ -3,12 +3,16 @@
Ian Kent 8c1733
 #
Ian Kent 8c1733
 
Ian Kent 8c1733
 # Root directory contents
Ian Kent 8c1733
-SUBDIRS = lib daemon fedfs modules man
Ian Kent 8c1733
+SUBDIRS = lib daemon modules man
Ian Kent 8c1733
 INCDIRS = include
Ian Kent 8c1733
 INCFILES = COPYING COPYRIGHT NEWS README* TODO Makefile Makefile.rules \
Ian Kent 8c1733
 	   Makefile.conf.in .version .autofs-* configure.in aclocal.m4 \
Ian Kent 8c1733
 	   configure *.patch autofs.spec
Ian Kent 8c1733
 
Ian Kent 8c1733
+ifeq ($(FEDFS), 1)
Ian Kent 8c1733
+	SUBDIRS += fedfs
Ian Kent 8c1733
+endif
Ian Kent 8c1733
+
Ian Kent 8c1733
 # Attempt to be friends with autotools
Ian Kent 8c1733
 INSTALLROOT = $(DESTDIR)
Ian Kent 8c1733
 
Ian Kent 8c1733
diff --git a/autofs.spec b/autofs.spec
Ian Kent 8c1733
index 157c09b4..2cb09ef0 100644
Ian Kent 8c1733
--- a/autofs.spec
Ian Kent 8c1733
+++ b/autofs.spec
Ian Kent 8c1733
@@ -16,6 +16,10 @@
Ian Kent 8c1733
 # disable them.
Ian Kent 8c1733
 %define with_libtirpc        %{?_without_libtirpc:        0} %{?!_without_libtirpc:        1}
Ian Kent 8c1733
 
Ian Kent 8c1733
+# Use --without fedfs in your rpmbuild command or force values to 0 to
Ian Kent 8c1733
+# disable them.
Ian Kent 8c1733
+%define with_fedfs           %{?_without_fedfs:         0} %{?!_without_fedfs: 1}
Ian Kent 8c1733
+
Ian Kent 8c1733
 Summary: A tool from automatically mounting and umounting filesystems.
Ian Kent 8c1733
 Name: autofs
Ian Kent 8c1733
 %define version 5.1.4
Ian Kent 8c1733
@@ -82,6 +86,9 @@ echo %{version}-%{release} > .version
Ian Kent 8c1733
 %if %{with_libtirpc}
Ian Kent 8c1733
   %define libtirpc_configure_arg --with-libtirpc
Ian Kent 8c1733
 %endif
Ian Kent 8c1733
+%if %{with_fedfs}
Ian Kent 8c1733
+  %define fedfs_configure_arg --enable-fedfs
Ian Kent 8c1733
+%endif
Ian Kent 8c1733
 
Ian Kent 8c1733
 %build
Ian Kent 8c1733
 CFLAGS="$RPM_OPT_FLAGS -Wall" \
Ian Kent 8c1733
@@ -90,7 +97,8 @@ LDFLAGS="-Wl,-z,now" \
Ian Kent 8c1733
 	--disable-mount-locking \
Ian Kent 8c1733
 	--enable-ignore-busy \
Ian Kent 8c1733
 	%{?systemd_configure_arg:} \
Ian Kent 8c1733
-	%{?libtirpc_configure_arg:}
Ian Kent 8c1733
+	%{?libtirpc_configure_arg:} \
Ian Kent 8c1733
+	%{?fedfs_configure_arg:}
Ian Kent 8c1733
 CFLAGS="$RPM_OPT_FLAGS -Wall" LDFLAGS="-Wl,-z,now" make initdir=/etc/rc.d/init.d DONTSTRIP=1
Ian Kent 8c1733
 
Ian Kent 8c1733
 %install
Ian Kent 8c1733
@@ -191,8 +199,10 @@ fi
Ian Kent 8c1733
 %config(noreplace) /etc/sysconfig/autofs
Ian Kent 8c1733
 %config(noreplace) /etc/autofs_ldap_auth.conf
Ian Kent 8c1733
 %{_sbindir}/automount
Ian Kent 8c1733
+%if %{with_fedfs}
Ian Kent 8c1733
 %{_sbindir}/mount.fedfs
Ian Kent 8c1733
 %{_sbindir}/fedfs-map-nfs4
Ian Kent 8c1733
+%endif
Ian Kent 8c1733
 %dir %{_libdir}/autofs
Ian Kent 8c1733
 %{_libdir}/autofs/*
Ian Kent 8c1733
 %{_mandir}/*/*
Ian Kent 8c1733
diff --git a/configure b/configure
Ian Kent 8c1733
index 5c8aae30..9682b36f 100755
Ian Kent 8c1733
--- a/configure
Ian Kent 8c1733
+++ b/configure
Ian Kent 8c1733
@@ -648,6 +648,7 @@ NSL_CFLAGS
Ian Kent 8c1733
 LIBCLOCK_GETTIME
Ian Kent 8c1733
 KRB5_CONFIG
Ian Kent 8c1733
 XML_CONFIG
Ian Kent 8c1733
+ENABLE_FEDFS
Ian Kent 8c1733
 sssldir
Ian Kent 8c1733
 HAVE_SSS_AUTOFS
Ian Kent 8c1733
 PATH_RPCGEN
Ian Kent 8c1733
@@ -743,6 +744,7 @@ with_libtirpc
Ian Kent 8c1733
 with_dmalloc
Ian Kent 8c1733
 enable_sloppy_mount
Ian Kent 8c1733
 enable_no_canon_umount
Ian Kent 8c1733
+enable_fedfs
Ian Kent 8c1733
 with_hesiod
Ian Kent 8c1733
 with_openldap
Ian Kent 8c1733
 with_sasl
Ian Kent 8c1733
@@ -1377,6 +1379,7 @@ Optional Features:
Ian Kent 8c1733
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
Ian Kent 8c1733
   --enable-sloppy-mount         enable the use of the -s option to mount
Ian Kent 8c1733
   --enable-no-canon-umount         enable the use of the -c option to umount
Ian Kent 8c1733
+  --enable-fedfs                enable inclusion of fedfs binaries mount.fedfs and fedfs-map-nfs4
Ian Kent 8c1733
   --disable-ext-env	        disable search in environment for substitution variable
Ian Kent 8c1733
   --disable-mount-locking       disable use of locking when spawning mount command
Ian Kent 8c1733
   --enable-force-shutdown       enable USR1 signal to force unlink umount of any
Ian Kent 8c1733
@@ -4246,6 +4249,19 @@ $as_echo "#define HAVE_NO_CANON_UMOUNT 1" >>confdefs.h
Ian Kent 8c1733
 
Ian Kent 8c1733
 fi
Ian Kent 8c1733
 
Ian Kent 8c1733
+ENABLE_FEDFS=""
Ian Kent 8c1733
+# Check whether --enable-fedfs was given.
Ian Kent 8c1733
+if test "${enable_fedfs+set}" = set; then :
Ian Kent 8c1733
+  enableval=$enable_fedfs;
Ian Kent 8c1733
+else
Ian Kent 8c1733
+  enable_fedfs=no
Ian Kent 8c1733
+fi
Ian Kent 8c1733
+
Ian Kent 8c1733
+if test x$enable_fedfs = xyes; then
Ian Kent 8c1733
+	ENABLE_FEDFS="1"
Ian Kent 8c1733
+fi
Ian Kent 8c1733
+
Ian Kent 8c1733
+
Ian Kent 8c1733
 # LDAP SASL auth needs libxml and Kerberos
Ian Kent 8c1733
 for ac_prog in xml2-config
Ian Kent 8c1733
 do
Ian Kent 8c1733
diff --git a/configure.in b/configure.in
Ian Kent 8c1733
index 4d1208f5..de06a96d 100644
Ian Kent 8c1733
--- a/configure.in
Ian Kent 8c1733
+++ b/configure.in
Ian Kent 8c1733
@@ -195,6 +195,15 @@ if test x$enable_no_canon_umount = xyes; then
Ian Kent 8c1733
 	AC_DEFINE(HAVE_NO_CANON_UMOUNT, 1, [define if the umount command supports the -c option])
Ian Kent 8c1733
 fi
Ian Kent 8c1733
 
Ian Kent 8c1733
+ENABLE_FEDFS=""
Ian Kent 8c1733
+AC_ARG_ENABLE(fedfs,
Ian Kent 8c1733
+[  --enable-fedfs                enable inclusion of fedfs binaries mount.fedfs and fedfs-map-nfs4],,
Ian Kent 8c1733
+	enable_fedfs=no)
Ian Kent 8c1733
+if test x$enable_fedfs = xyes; then
Ian Kent 8c1733
+	ENABLE_FEDFS="1"
Ian Kent 8c1733
+fi
Ian Kent 8c1733
+AC_SUBST(ENABLE_FEDFS)
Ian Kent 8c1733
+
Ian Kent 8c1733
 # LDAP SASL auth needs libxml and Kerberos
Ian Kent 8c1733
 AF_CHECK_LIBXML()
Ian Kent 8c1733
 AF_CHECK_KRB5()