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

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