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

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