autofs/SOURCES/autofs-5.1.4-add-conditional-inclusion-of-fedfs-binaries.patch
2021-10-08 09:50:49 +00:00

185 lines
5.1 KiB
Diff

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