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

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