Blame SOURCES/autofs-5.0.7-make-yellow-pages-support-optional.patch

306fa1
autofs-5.0.7 - make yellow pages support optional
306fa1
306fa1
From: Chris Packham <chris.packham@alliedtelesis.co.nz>
306fa1
306fa1
If rpcsvc/ypclnt.h is not available don't compile in Yellow Pages
306fa1
support.
306fa1
---
306fa1
306fa1
 CHANGELOG           |    1 +
306fa1
 Makefile.conf.in    |    3 +++
306fa1
 configure           |   16 ++++++++++++++++
306fa1
 configure.in        |    9 +++++++++
306fa1
 include/config.h.in |    3 +++
306fa1
 lib/rpc_subs.c      |    1 -
306fa1
 modules/Makefile    |    9 +++++++--
306fa1
 7 files changed, 39 insertions(+), 3 deletions(-)
306fa1
306fa1
306fa1
diff --git a/CHANGELOG b/CHANGELOG
306fa1
index 1130db6..ed17163 100644
306fa1
--- a/CHANGELOG
306fa1
+++ b/CHANGELOG
306fa1
@@ -25,6 +25,7 @@
306fa1
 - don't schedule new alarms after readmap.
306fa1
 - use numeric protocol ids instead of protoent structs.
306fa1
 - lib/defaults.c: use WITH_LDAP conditional around LDAP types.
306fa1
+- make yellow pages support optional.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
diff --git a/Makefile.conf.in b/Makefile.conf.in
306fa1
index 802318b..3766d45 100644
306fa1
--- a/Makefile.conf.in
306fa1
+++ b/Makefile.conf.in
306fa1
@@ -43,6 +43,9 @@ NISPLUS = @HAVE_NISPLUS@
306fa1
 # SMBFS support: yes (1) no (0)
306fa1
 SMBFS = @HAVE_SMBMOUNT@
306fa1
 
306fa1
+# YellowPages support: yes (1) no (0)
306fa1
+YPCLNT = @HAVE_YPCLNT@
306fa1
+
306fa1
 # Support for calling e2fsck when mounting ext2 filesystems
306fa1
 EXT2FS = @HAVE_E2FSCK@
306fa1
 
306fa1
diff --git a/configure b/configure
306fa1
index 3722a46..cf6428c 100755
306fa1
--- a/configure
306fa1
+++ b/configure
306fa1
@@ -614,6 +614,7 @@ XML_FLAGS
306fa1
 LIBLDAP
306fa1
 HAVE_LDAP
306fa1
 LDAP_FLAGS
306fa1
+HAVE_YPCLNT
306fa1
 HAVE_NISPLUS
306fa1
 EGREP
306fa1
 GREP
306fa1
@@ -4575,6 +4576,21 @@ fi
306fa1
 
306fa1
 
306fa1
 
306fa1
+# YellowPages support?
306fa1
+HAVE_YPCLNT=0
306fa1
+ac_fn_c_check_header_mongrel "$LINENO" "rpcsvc/ypclnt.h" "ac_cv_header_rpcsvc_ypclnt_h" "$ac_includes_default"
306fa1
+if test "x$ac_cv_header_rpcsvc_ypclnt_h" = xyes; then :
306fa1
+  HAVE_YPCLNT=1
306fa1
+fi
306fa1
+
306fa1
+
306fa1
+
306fa1
+if test "$HAVE_YPCLNT" = "1"; then
306fa1
+
306fa1
+$as_echo "#define HAVE_YPCLNT 1" >>confdefs.h
306fa1
+
306fa1
+fi
306fa1
+
306fa1
 #
306fa1
 # OpenLDAP support?  Expect that this may have a special directory...
306fa1
 #
306fa1
diff --git a/configure.in b/configure.in
306fa1
index 90bda62..363c376 100644
306fa1
--- a/configure.in
306fa1
+++ b/configure.in
306fa1
@@ -213,6 +213,15 @@ HAVE_NISPLUS=0
306fa1
 AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1)
306fa1
 AC_SUBST(HAVE_NISPLUS)
306fa1
 
306fa1
+# YellowPages support?
306fa1
+HAVE_YPCLNT=0
306fa1
+AC_CHECK_HEADER([rpcsvc/ypclnt.h], HAVE_YPCLNT=1)
306fa1
+AC_SUBST(HAVE_YPCLNT)
306fa1
+if test "$HAVE_YPCLNT" = "1"; then
306fa1
+	AC_DEFINE(HAVE_YPCLNT, 1,
306fa1
+		[Define if using YellowPages])
306fa1
+fi
306fa1
+
306fa1
 #
306fa1
 # OpenLDAP support?  Expect that this may have a special directory...
306fa1
 #
306fa1
diff --git a/include/config.h.in b/include/config.h.in
306fa1
index 9bdf98a..7f1c5b5 100644
306fa1
--- a/include/config.h.in
306fa1
+++ b/include/config.h.in
306fa1
@@ -72,6 +72,9 @@
306fa1
 /* Define to 1 if you have the <unistd.h> header file. */
306fa1
 #undef HAVE_UNISTD_H
306fa1
 
306fa1
+/* Define if using YellowPages */
306fa1
+#undef HAVE_YPCLNT
306fa1
+
306fa1
 /* Use libxml2 tsd usage workaround */
306fa1
 #undef LIBXML2_WORKAROUND
306fa1
 
306fa1
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
306fa1
index ad1d557..718caf9 100644
306fa1
--- a/lib/rpc_subs.c
306fa1
+++ b/lib/rpc_subs.c
306fa1
@@ -27,7 +27,6 @@
306fa1
 #include <net/if.h>
306fa1
 #include <netinet/in.h>
306fa1
 #include <arpa/inet.h>
306fa1
-#include <rpcsvc/ypclnt.h>
306fa1
 #include <errno.h>
306fa1
 #include <sys/ioctl.h>
306fa1
 #include <ctype.h>
306fa1
diff --git a/modules/Makefile b/modules/Makefile
306fa1
index 939da7c..c5deb24 100644
306fa1
--- a/modules/Makefile
306fa1
+++ b/modules/Makefile
306fa1
@@ -5,13 +5,13 @@
306fa1
 -include ../Makefile.conf
306fa1
 include ../Makefile.rules
306fa1
 
306fa1
-SRCS :=	lookup_yp.c  lookup_file.c lookup_program.c  lookup_userhome.c \
306fa1
+SRCS :=	lookup_file.c lookup_program.c  lookup_userhome.c \
306fa1
 	lookup_multi.c lookup_hosts.c lookup_dir.c \
306fa1
 	parse_sun.c    \
306fa1
 	mount_generic.c  mount_nfs.c  mount_afs.c  mount_autofs.c \
306fa1
 	mount_changer.c  mount_bind.c
306fa1
 
306fa1
-MODS :=	lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \
306fa1
+MODS :=	lookup_file.so lookup_program.so lookup_userhome.so \
306fa1
 	lookup_multi.so lookup_hosts.so lookup_dir.so \
306fa1
 	parse_sun.so \
306fa1
 	mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \
306fa1
@@ -37,6 +37,11 @@ ifeq ($(NISPLUS), 1)
306fa1
   MODS += lookup_nisplus.so
306fa1
 endif
306fa1
 
306fa1
+ifeq ($(YPCLNT), 1)
306fa1
+  SRCS += lookup_yp.c
306fa1
+  MODS += lookup_yp.so
306fa1
+endif
306fa1
+
306fa1
 ifeq ($(LDAP), 1)
306fa1
   SRCS += lookup_ldap.c
306fa1
   MODS += lookup_ldap.so