Blame SOURCES/autofs-5.1.4-add-conditional-inclusion-of-fedfs-binaries.patch

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