#1 Build dhcp from bind-export-devel
Merged 6 years ago by landgraf. Opened 6 years ago by pemensik.
rpms/ pemensik/dhcp export-libs  into  master

@@ -0,0 +1,77 @@ 

+ From c37721f799e6b32da156759a830011949311205a Mon Sep 17 00:00:00 2001

+ From: Petr Mensik <pemensik@redhat.com>

+ Date: Fri, 16 Feb 2018 17:50:40 +0100

+ Subject: [PATCH] New bind includes never includes isc/util.h from any public

+  headers. Include them to all compiled files that require it.

+ 

+ ---

+  client/dhclient.c   | 1 +

+  common/execute.c    | 1 +

+  common/parse.c      | 1 +

+  common/socket.c     | 1 +

+  omapip/connection.c | 1 +

+  5 files changed, 5 insertions(+)

+ 

+ diff --git a/client/dhclient.c b/client/dhclient.c

+ index 228b4fe..014365d 100644

+ --- a/client/dhclient.c

+ +++ b/client/dhclient.c

+ @@ -38,6 +38,7 @@

+  #include <sys/wait.h>

+  #include <limits.h>

+  #include <isc/file.h>

+ +#include <isc/util.h>

+  #include <dns/result.h>

+  

+  #ifdef HAVE_LIBCAP_NG

+ diff --git a/common/execute.c b/common/execute.c

+ index fa4e0f8..1ee1e7d 100644

+ --- a/common/execute.c

+ +++ b/common/execute.c

+ @@ -28,6 +28,7 @@

+  

+  #include "dhcpd.h"

+  #include <omapip/omapip_p.h>

+ +#include <isc/util.h>

+  #include <sys/types.h>

+  #include <sys/wait.h>

+  

+ diff --git a/common/parse.c b/common/parse.c

+ index d08cd2c..729d442 100644

+ --- a/common/parse.c

+ +++ b/common/parse.c

+ @@ -27,6 +27,7 @@

+   */

+  

+  #include "dhcpd.h"

+ +#include <isc/util.h>

+  #include <syslog.h>

+  

+  /* Enumerations can be specified in option formats, and are used for

+ diff --git a/common/socket.c b/common/socket.c

+ index 2b352a1..94ce334 100644

+ --- a/common/socket.c

+ +++ b/common/socket.c

+ @@ -35,6 +35,7 @@

+   */

+  

+  #include "dhcpd.h"

+ +#include <isc/util.h>

+  #include <errno.h>

+  #include <sys/ioctl.h>

+  #include <sys/uio.h>

+ diff --git a/omapip/connection.c b/omapip/connection.c

+ index 9aac0c8..a74becc 100644

+ --- a/omapip/connection.c

+ +++ b/omapip/connection.c

+ @@ -30,6 +30,7 @@

+  #include "dhcpd.h"

+  

+  #include <omapip/omapip_p.h>

+ +#include <isc/util.h>

+  #include <arpa/inet.h>

+  #include <arpa/nameser.h>

+  #include <errno.h>

+ -- 

+ 2.14.3

+ 

file modified
+78 -71
@@ -1,7 +1,42 @@ 

- diff -up dhcp-4.3.4/client/dhclient.8.capability dhcp-4.3.4/client/dhclient.8

- --- dhcp-4.3.4/client/dhclient.8.capability	2016-04-29 12:19:40.657129322 +0200

- +++ dhcp-4.3.4/client/dhclient.8	2016-04-29 12:19:40.715129297 +0200

- @@ -134,6 +134,9 @@ dhclient - Dynamic Host Configuration Pr

+ diff --git a/client/Makefile.am b/client/Makefile.am

+ index b1ecf82..387c097 100644

+ --- a/client/Makefile.am

+ +++ b/client/Makefile.am

+ @@ -15,6 +15,7 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \

+  		   scripts/bsdos scripts/freebsd scripts/linux scripts/macos \

+  		   scripts/netbsd scripts/nextstep scripts/openbsd \

+  		   scripts/solaris scripts/openwrt

+ -dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la $(BIND_LIBS)

+ +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

+ +		 $(CAPNG_LDADD) $(BIND_LIBS)

+  man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5

+  EXTRA_DIST = $(man_MANS)

+ diff --git a/client/dhclient-script.8 b/client/dhclient-script.8

+ index 3a3aaf7..fec726c 100644

+ --- a/client/dhclient-script.8

+ +++ b/client/dhclient-script.8

+ @@ -245,6 +245,16 @@ repeatedly initialized to the values provided by one server, and then

+  the other.   Assuming the information provided by both servers is

+  valid, this shouldn't cause any real problems, but it could be

+  confusing.

+ +.PP

+ +Normally, if dhclient was compiled with libcap-ng support,

+ +dhclient drops most capabilities immediately upon startup.

+ +While more secure, this greatly restricts the additional actions that

+ +hooks in dhclient-script can take. For example, any daemons that

+ +dhclient-script starts or restarts will inherit the restricted

+ +capabilities as well, which may interfere with their correct operation.

+ +Thus, the

+ +.BI \-nc

+ +option can be used to prevent dhclient from dropping capabilities.

+  .SH SEE ALSO

+  dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and

+  dhclient.leases(5).

+ diff --git a/client/dhclient.8 b/client/dhclient.8

+ index aa2238d..005cda5 100644

+ --- a/client/dhclient.8

+ +++ b/client/dhclient.8

+ @@ -134,6 +134,9 @@ dhclient - Dynamic Host Configuration Protocol Client

   .B -w

   ]

   [
@@ -11,10 +46,11 @@ 

   .B -B

   ]

   [

- @@ -318,6 +321,32 @@ program can then be used to notify the c

+ @@ -320,6 +323,32 @@ not to exit when it doesn't find any such interfaces.  The

+  program can then be used to notify the client when a network interface

   has been added or removed, so that the client can attempt to configure an IP

   address on that interface.

-  .TP

+ +.TP

  +.BI \-nc

  +Do not drop capabilities.

  +
@@ -40,13 +76,13 @@ 

  +.B dhclient

  +was not compiled with libcap-ng support.

  +

- +.TP

+  .TP

   .BI \-n

   Do not configure any interfaces.  This is most likely to be useful in

-  combination with the

- diff -up dhcp-4.3.4/client/dhclient.c.capability dhcp-4.3.4/client/dhclient.c

- --- dhcp-4.3.4/client/dhclient.c.capability	2016-04-29 12:19:40.691129307 +0200

- +++ dhcp-4.3.4/client/dhclient.c	2016-04-29 12:21:07.620091930 +0200

+ diff --git a/client/dhclient.c b/client/dhclient.c

+ index 09ae09b..2d564ff 100644

+ --- a/client/dhclient.c

+ +++ b/client/dhclient.c

  @@ -40,6 +40,10 @@

   #include <isc/file.h>

   #include <dns/result.h>
@@ -58,7 +94,7 @@ 

   /*

    * Defined in stdio.h when _GNU_SOURCE is set, but we don't want to define

    * that when building ISC code.

- @@ -237,6 +241,9 @@ main(int argc, char **argv) {

+ @@ -239,6 +243,9 @@ main(int argc, char **argv) {

   	int timeout_arg = 0;

   	char *arg_conf = NULL;

   	int arg_conf_len = 0;
@@ -68,7 +104,7 @@ 

   

   	/* Initialize client globals. */

   	memset(&default_duid, 0, sizeof(default_duid));

- @@ -537,6 +544,10 @@ main(int argc, char **argv) {

+ @@ -548,6 +555,10 @@ main(int argc, char **argv) {

   			}

   

   			dhclient_request_options = argv[i];
@@ -79,7 +115,7 @@ 

   		} else if (argv[i][0] == '-') {

   			usage("Unknown command: %s", argv[i]);

   		} else if (interfaces_requested < 0) {

- @@ -597,6 +608,19 @@ main(int argc, char **argv) {

+ @@ -608,6 +619,19 @@ main(int argc, char **argv) {

   		path_dhclient_script = s;

   	}

   
@@ -99,42 +135,11 @@ 

   	/* Set up the initial dhcp option universe. */

   	initialize_common_option_spaces();

   

- diff -up dhcp-4.3.4/client/dhclient-script.8.capability dhcp-4.3.4/client/dhclient-script.8

- --- dhcp-4.3.4/client/dhclient-script.8.capability	2016-04-29 12:19:40.668129317 +0200

- +++ dhcp-4.3.4/client/dhclient-script.8	2016-04-29 12:19:40.717129296 +0200

- @@ -243,6 +243,16 @@ repeatedly initialized to the values pro

-  the other.   Assuming the information provided by both servers is

-  valid, this shouldn't cause any real problems, but it could be

-  confusing.

- +.PP

- +Normally, if dhclient was compiled with libcap-ng support,

- +dhclient drops most capabilities immediately upon startup.

- +While more secure, this greatly restricts the additional actions that

- +hooks in dhclient-script can take. For example, any daemons that

- +dhclient-script starts or restarts will inherit the restricted

- +capabilities as well, which may interfere with their correct operation.

- +Thus, the

- +.BI \-nc

- +option can be used to prevent dhclient from dropping capabilities.

-  .SH SEE ALSO

-  dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and

-  dhclient.leases(5).

- diff -up dhcp-4.3.4/client/Makefile.am.capability dhcp-4.3.4/client/Makefile.am

- --- dhcp-4.3.4/client/Makefile.am.capability	2016-04-29 12:19:40.652129324 +0200

- +++ dhcp-4.3.4/client/Makefile.am	2016-04-29 12:19:40.717129296 +0200

- @@ -13,7 +13,7 @@ dhclient_SOURCES = clparse.c dhclient.c

-  		   scripts/bsdos scripts/freebsd scripts/linux scripts/macos \

-  		   scripts/netbsd scripts/nextstep scripts/openbsd \

-  		   scripts/solaris scripts/openwrt

- -dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

- +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la $(CAPNG_LDADD) \

-  		 $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

-  man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5

-  EXTRA_DIST = $(man_MANS)

- diff -up dhcp-4.3.4/configure.ac.capability dhcp-4.3.4/configure.ac

- --- dhcp-4.3.4/configure.ac.capability	2016-04-29 12:19:40.652129324 +0200

- +++ dhcp-4.3.4/configure.ac	2016-04-29 12:19:40.717129296 +0200

- @@ -585,6 +585,41 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],

+ diff --git a/configure.ac b/configure.ac

+ index adc98a8..8bbe5ca 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -592,6 +592,41 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void foo() __attribute__((noreturn));

   # Look for optional headers.

   AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)

   
@@ -176,9 +181,23 @@ 

   # Solaris needs some libraries for functions

   AC_SEARCH_LIBS(socket, [socket])

   AC_SEARCH_LIBS(inet_ntoa, [nsl])

- diff -up dhcp-4.3.4/relay/dhcrelay.c.capability dhcp-4.3.4/relay/dhcrelay.c

- --- dhcp-4.3.4/relay/dhcrelay.c.capability	2016-04-29 12:19:40.694129306 +0200

- +++ dhcp-4.3.4/relay/dhcrelay.c	2016-04-29 12:22:30.278056386 +0200

+ diff --git a/relay/Makefile.am b/relay/Makefile.am

+ index 316a524..999e543 100644

+ --- a/relay/Makefile.am

+ +++ b/relay/Makefile.am

+ @@ -5,7 +5,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'

+  sbin_PROGRAMS = dhcrelay

+  dhcrelay_SOURCES = dhcrelay.c

+  dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

+ -		 $(BIND_LIBS)

+ +		 $(CAPNG_LDADD) $(BIND_LIBS)

+  man_MANS = dhcrelay.8

+  EXTRA_DIST = $(man_MANS)

+  

+ diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c

+ index eac119c..d2ab448 100644

+ --- a/relay/dhcrelay.c

+ +++ b/relay/dhcrelay.c

  @@ -32,6 +32,11 @@

   #include <sys/time.h>

   #include <isc/file.h>
@@ -191,18 +210,18 @@ 

   TIME default_lease_time = 43200; /* 12 hours... */

   TIME max_lease_time = 86400; /* 24 hours... */

   struct tree_cache *global_options[256];

- @@ -454,6 +459,10 @@ main(int argc, char **argv) {

+ @@ -472,6 +477,10 @@ main(int argc, char **argv) {

+  			if (++i == argc)

   				usage(use_noarg, argv[i-1]);

   			dhcrelay_sub_id = argv[i];

-  #endif

+ +#endif

  +		} else if (!strcmp(argv[i], "-nc")) {

  +#ifdef HAVE_LIBCAP_NG

  +			keep_capabilities = 1;

- +#endif

+  #endif

   		} else if (!strcmp(argv[i], "-pf")) {

   			if (++i == argc)

-  				usage(use_noarg, argv[i-1]);

- @@ -528,6 +537,17 @@ main(int argc, char **argv) {

+ @@ -547,6 +556,17 @@ main(int argc, char **argv) {

   #endif

   	}

   
@@ -220,7 +239,7 @@ 

   	if (!quiet) {

   		log_info("%s %s", message, PACKAGE_VERSION);

   		log_info(copyright);

- @@ -680,6 +700,15 @@ main(int argc, char **argv) {

+ @@ -699,6 +719,15 @@ main(int argc, char **argv) {

   	signal(SIGTERM, dhcp_signal_handler);  /* kill */

   #endif

   
@@ -236,15 +255,3 @@ 

   	/* Start dispatching packets and timeouts... */

   	dispatch();

   

- diff -up dhcp-4.3.4/relay/Makefile.am.capability dhcp-4.3.4/relay/Makefile.am

- --- dhcp-4.3.4/relay/Makefile.am.capability	2016-04-29 12:19:40.653129323 +0200

- +++ dhcp-4.3.4/relay/Makefile.am	2016-04-29 12:19:40.718129295 +0200

- @@ -2,7 +2,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst

-  

-  sbin_PROGRAMS = dhcrelay

-  dhcrelay_SOURCES = dhcrelay.c

- -dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

- +dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la $(CAPNG_LDADD) \

-  		 $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

-  man_MANS = dhcrelay.8

-  EXTRA_DIST = $(man_MANS)

file modified
+219 -129
@@ -1,151 +1,254 @@ 

- diff -up dhcp-4.3.5b1/client/Makefile.am.remove-bind dhcp-4.3.5b1/client/Makefile.am

- --- dhcp-4.3.5b1/client/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/client/Makefile.am	2016-09-12 17:00:22.797902248 +0200

- @@ -4,8 +4,6 @@

+ From 2698385647a6ebd58b5d25147333e494c3da2409 Mon Sep 17 00:00:00 2001

+ From: Petr Mensik <pemensik@redhat.com>

+ Date: Fri, 9 Feb 2018 15:24:53 +0100

+ Subject: [PATCH] Support for isc-config.sh script on --with-libbind parameter

+ 

+ Move checks only to isc-config section

+ 

+ Fix detection of bind flags from config

+ 

+ Add support for with-libbind=config, Improve help message

+ ---

+  client/Makefile.am       |  5 ++-

+  client/tests/Makefile.am |  8 ++---

+  common/tests/Makefile.am | 14 +++-----

+  configure.ac             | 84 ++++++++++++++++++++++++++++++++++++++++++------

+  dhcpctl/Makefile.am      |  8 ++---

+  omapip/Makefile.am       |  5 ++-

+  relay/Makefile.am        |  5 ++-

+  server/Makefile.am       |  6 ++--

+  server/tests/Makefile.am |  9 +++---

+  9 files changed, 98 insertions(+), 46 deletions(-)

+ 

+ diff --git a/client/Makefile.am b/client/Makefile.am

+ index 2cb83d8..b85f5d2 100644

+ --- a/client/Makefile.am

+ +++ b/client/Makefile.am

+ @@ -4,7 +4,7 @@

   # production code. Sadly, we are not there yet.

   SUBDIRS = . tests

   

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+  

   AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \

   	      -DLOCALSTATEDIR='"$(localstatedir)"'

-  

- @@ -15,7 +13,7 @@ dhclient_SOURCES = clparse.c dhclient.c

+ @@ -15,7 +15,6 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \

   		   scripts/bsdos scripts/freebsd scripts/linux scripts/macos \

   		   scripts/netbsd scripts/nextstep scripts/openbsd \

   		   scripts/solaris scripts/openwrt

  -dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \

  -		 $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a

- +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

- +		 $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BIND_LIBS)

   man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5

   EXTRA_DIST = $(man_MANS)

- diff -up dhcp-4.3.5b1/common/tests/Makefile.am.remove-bind dhcp-4.3.5b1/common/tests/Makefile.am

- --- dhcp-4.3.5b1/common/tests/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/common/tests/Makefile.am	2016-09-12 17:07:42.168232452 +0200

- @@ -1,7 +1,5 @@

+ diff --git a/client/tests/Makefile.am b/client/tests/Makefile.am

+ index 5031d0c..bb1fda4 100644

+ --- a/client/tests/Makefile.am

+ +++ b/client/tests/Makefile.am

+ @@ -1,9 +1,9 @@

   SUBDIRS = .

   

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+  

+  AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes

+ -AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)

+ +AM_CPPFLAGS += @BIND_CPPFLAGS@ -I$(top_srcdir)

+  AM_CPPFLAGS += -DLOCALSTATEDIR='"."'

+  AM_CPPFLAGS += -DCLIENT_PATH='"."'

+  

+ @@ -18,9 +18,7 @@ info:

+  DHCPSRC = ../clparse.c ../dhc6.c ../dhclient.c

+  

+  DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a    \

+ -          $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \

+ -	  $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \

+ -	  $(BINDLIBDIR)/libisc.a

+ +          $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND_LIBS)

+  

+  ATF_TESTS =

+  if HAVE_ATF

+ diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am

+ index f6a43e4..196aa44 100644

+ --- a/common/tests/Makefile.am

+ +++ b/common/tests/Makefile.am

+ @@ -1,6 +1,6 @@

+  SUBDIRS = .

+  

+ -BINDLIBDIR = @BINDDIR@/lib

+ +BIND_LIBS = @BIND_LIBS@

+  

   AM_CPPFLAGS = $(ATF_CFLAGS) -I$(top_srcdir)/includes

   

-  EXTRA_DIST = Atffile

- @@ -15,26 +13,26 @@ ATF_TESTS += alloc_unittest dns_unittest

+ @@ -15,26 +15,22 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest

   alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c

   alloc_unittest_LDADD = $(ATF_LDFLAGS)

   alloc_unittest_LDADD += ../libdhcp.a  \

  -	../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \

  -	$(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a  $(BINDLIBDIR)/libisc.a

- +	../../omapip/libomapi.a \

- +	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +	../../omapip/libomapi.a $(BIND_LIBS)

   

   dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c

   dns_unittest_LDADD = $(ATF_LDFLAGS)

   dns_unittest_LDADD += ../libdhcp.a  \

  -	../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \

  -	$(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a  $(BINDLIBDIR)/libisc.a

- +	../../omapip/libomapi.a \

- +	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +	../../omapip/libomapi.a $(BIND_LIBS)

   

   misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c

   misc_unittest_LDADD = $(ATF_LDFLAGS)

   misc_unittest_LDADD += ../libdhcp.a  \

  -	../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \

  -	$(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a  $(BINDLIBDIR)/libisc.a

- +	../../omapip/libomapi.a \

- +	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +	../../omapip/libomapi.a $(BIND_LIBS)

   

   ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c

   ns_name_unittest_LDADD = $(ATF_LDFLAGS)

   ns_name_unittest_LDADD += ../libdhcp.a  \

  -	../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \

  -	$(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a  $(BINDLIBDIR)/libisc.a

- +	../../omapip/libomapi.a \

- +	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +	../../omapip/libomapi.a $(BIND_LIBS)

   

   check: $(ATF_TESTS)

   	@if test $(top_srcdir) != ${top_builddir}; then \

- diff -up dhcp-4.3.5b1/configure.ac.remove-bind dhcp-4.3.5b1/configure.ac

- --- dhcp-4.3.5b1/configure.ac.remove-bind	2016-08-26 20:24:41.000000000 +0200

- +++ dhcp-4.3.5b1/configure.ac	2016-09-12 17:00:22.798902249 +0200

- @@ -682,20 +682,33 @@ AC_CHECK_MEMBER(struct tpacket_auxdata.t

+ diff --git a/configure.ac b/configure.ac

+ index cdfa352..ef55f8d 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -688,8 +688,12 @@ AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,

+  

   BINDDIR=

   BINDSRCDIR=

+ +BIND_CONFIG=

+ +BIND_CPPFLAGS=

+ +BIND_LIBS=

   AC_ARG_WITH(libbind,

  -	AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH

- -		        (default is ./bind)]),

- +	AS_HELP_STRING([--with-libbind=PATH],[bind includes are in PATH

- +		        (default is ./bind/includes)]),

+ +	AS_HELP_STRING([--with-libbind=PATH|config],[bind includes and libraries are in PATH.

+ +		        Use config to obtain libraries from isc-config.sh.

+  		        (default is ./bind)]),

   	use_libbind="$withval", use_libbind="no")

   case "$use_libbind" in

- +yes|no)

- +	libbind="\${top_srcdir}/bind/include"

- +	;;

- +*)

- +	libbind="$use_libbind"

- +	;;

- +esac

- +

- +BIND9_LIBDIR='-L$(top_builddir)/bind/lib'

- +AC_ARG_WITH(libbind-libs,

- +	AC_HELP_STRING([--with-libbind-libs=PATH],

- +		       [bind9 export libraries are in PATH]),

- +		       [libbind_libs="$withval"], [libbind_libs='no'])

- +case "$libbind_libs" in

-  yes)

- -	BINDDIR="\${top_srcdir}/bind"

- -	BINDSRCDIR="\${top_srcdir}/bind"

- +	AC_MSG_ERROR([Specify path to bind9 libraries])

-  	;;

-  no)

- -	BINDDIR="\${top_srcdir}/bind"

- -	BINDSRCDIR="\${top_srcdir}/bind"

- +	BUNDLED_BIND=yes

+ @@ -701,23 +705,85 @@ no)

+  	BINDDIR="\${top_srcdir}/bind"

+  	BINDSRCDIR="\${top_srcdir}/bind"

   	;;

+ +config)

+ +	AC_PATH_PROG(BIND_CONFIG, [isc-config.sh bind9-config])

+ +	;;

   *)

  -	BINDDIR="$use_libbind"

- +	BIND9_LIBDIR="-L$libbind_libs"

- +	BUNDLED_BIND=no

-  	if test ! -d "$srcdir/bind"; then

-  		# no bind directory, create it with a fake Makefile.in

-  		# (AC_CONFIG_FILES and top Makefile refer to it so

- @@ -709,8 +722,8 @@ EOF

+ -	if test ! -d "$srcdir/bind"; then

+ -		# no bind directory, create it with a fake Makefile.in

+ -		# (AC_CONFIG_FILES and top Makefile refer to it so

+ -		# it must exits)

+ -		mkdir $srcdir/bind

+ -		cat > $srcdir/bind/Makefile.in << EOF

+ +	if test -f "$use_libbind" -a -x "$use_libbind"; then

+ +		# passed full path of isc-config.sh

+ +		BIND_CONFIG="$use_libbind"

+ +	else

+ +		BINDDIR="$use_libbind"

+ +		if test ! -d "$srcdir/bind"; then

+ +			# no bind directory, create it with a fake Makefile.in

+ +			# (AC_CONFIG_FILES and top Makefile refer to it so

+ +			# it must exits)

+ +			mkdir $srcdir/bind

+ +			cat > $srcdir/bind/Makefile.in << EOF

+  # placeholder

+  all check clean distclean distdir install uninstall:

+  

+  EOF

+ +		fi

   	fi

   	;;

   esac

- -AC_SUBST(BINDDIR)

- -AC_SUBST(BINDSRCDIR)

- +AM_CONDITIONAL([BUNDLED_BIND], [test "$BUNDLED_BIND" = yes])

- +AC_SUBST([BIND9_LIBDIR])

+ +if test -z "$BIND_CONFIG"; then

+ +	BIND_CPPFLAGS="-I${BINDDIR}/include"

+ +	BIND_LIBDIR="${BINDDIR}/lib"

+ +	BIND_LIBS="$(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a  $(BINDLIBDIR)/libisc.a"

+ +else

+ +	BIND_CPPFLAGS=`$BIND_CONFIG --cflags`

+ +	BIND_LIBS=`$BIND_CONFIG --libs irs dns isccfg isc`

+ +

+ +	# bind is already built

+ +	AC_CHECKING([Checking bind libraries have no thread support])

+ +	saved_libs="$LIBS"

+ +	saved_CPPFLAGS="$CPPFLAGS"

+ +	CPPFLAGS="${CPPFLAGS} ${BIND_CPPFLAGS}"

+ +	LIBS="${LIBS} ${BIND_LIBS}"

+ +AC_TRY_LINK([

+ +#include <isc/bind9.h>

+ +#include <isc/lib.h>

+ +],[

+ +#ifdef BIND9

+ +#error Export BIND library has to be used with BIND version up to 9.9

+ +#endif

+ +isc_lib_register();

+ +], [AC_MSG_RESULT(Bind export library found)

+ +    BIND_EXPORT=yes], [BIND_EXPORT=no]

+ +)

+ +

+ +# Allow build with disabled threads for dhcp

+ +AC_TRY_LINK([

+ +#include <isc/platform.h>

+ +#include <isc/bind9.h>

+ +#include <isc/lib.h>

+ +],[

+ +#ifdef ISC_PLATFORM_USETHREADS

+ +#error Bind library must not be compiled with threads

+ +#endif

+ +isc_lib_register();

+ +if (isc_bind9 != 0) {}

+ +], [AC_MSG_RESULT(Bind single thread library found)

+ +    BIND_SINGLETHREAD=yes], [BIND_SINGLETHREAD=no]

+ +)

+ +

+ +	if test "x$BIND_EXPORT" != xyes -a "x$BIND_SINGLETHREADED" != xyes

+ +	then

+ +		AC_MSG_RESULT([BIND_CONFIG=${BIND_CONFIG}])

+ +		AC_MSG_RESULT([BIND_CPPFLAGS=${BIND_CPPFLAGS}])

+ +		AC_MSG_RESULT([BIND_LIBS=${BIND_LIBS}])

+ +		AC_MSG_ERROR([Bind libraries are not useable for dhcp])

+ +	fi

+ +	CPPFLAGS="$saved_CPPFLAGS"

+ +	LIBS="$saved_LIBS"

+ +fi

+ +

+  AC_SUBST(BINDDIR)

+  AC_SUBST(BINDSRCDIR)

+ +AC_SUBST(BIND_CPPFLAGS)

+ +AC_SUBST(BIND_LIBS)

   

   # OpenLDAP support.

   AC_ARG_WITH(ldap,

- @@ -788,7 +801,7 @@ fi

+ @@ -795,7 +861,7 @@ fi

   CFLAGS="$CFLAGS $STD_CWARNINGS"

   

   # Try to add the bind and dhcp include directories

  -CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"

- +CFLAGS="$CFLAGS -I$libbind"

+ +CFLAGS="$CFLAGS -I\$(top_srcdir)/includes $BIND_CPPFLAGS"

   

   case "$host" in

   *-darwin*)

- diff -up dhcp-4.3.5b1/dhcpctl/Makefile.am.remove-bind dhcp-4.3.5b1/dhcpctl/Makefile.am

- --- dhcp-4.3.5b1/dhcpctl/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/dhcpctl/Makefile.am	2016-09-12 17:00:22.798902249 +0200

- @@ -1,5 +1,3 @@

+ diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am

+ index ceb0de1..fa20a78 100644

+ --- a/dhcpctl/Makefile.am

+ +++ b/dhcpctl/Makefile.am

+ @@ -1,4 +1,4 @@

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+  

   bin_PROGRAMS = omshell

   lib_LIBRARIES = libdhcpctl.a

-  noinst_PROGRAMS = cltest

- @@ -8,12 +6,10 @@ EXTRA_DIST = $(man_MANS)

+ @@ -8,12 +8,10 @@ EXTRA_DIST = $(man_MANS)

   

   omshell_SOURCES = omshell.c

   omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \

  -	        $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \

  -	        $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a

- +	        $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +	        $(BIND_LIBS)

   

   libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c

   
@@ -153,49 +256,33 @@ 

   cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \

  -	       $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \

  -               $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a

- +	       $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

- diff -up dhcp-4.3.5b1/Makefile.am.remove-bind dhcp-4.3.5b1/Makefile.am

- --- dhcp-4.3.5b1/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/Makefile.am	2016-09-12 17:00:22.798902249 +0200

- @@ -26,7 +26,13 @@ EXTRA_DIST = RELNOTES LICENSE \

-  	     bind/Makefile.in bind/bind.tar.gz bind/version.tmp \

-  	     common/tests/Atffile server/tests/Atffile

-  

- -SUBDIRS = @BINDSRCDIR@ includes tests common omapip client dhcpctl relay server

- +if BUNDLED_BIND

- +SUBDIRS = bind

- +else

- +SUBDIRS = 

- +endif

- +

- +SUBDIRS += includes tests common omapip client dhcpctl relay server

-  

-  nobase_include_HEADERS = dhcpctl/dhcpctl.h

-  

- diff -up dhcp-4.3.5b1/omapip/Makefile.am.remove-bind dhcp-4.3.5b1/omapip/Makefile.am

- --- dhcp-4.3.5b1/omapip/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/omapip/Makefile.am	2016-09-12 17:00:22.798902249 +0200

- @@ -1,5 +1,3 @@

+ +	       $(BIND_LIBS)

+ diff --git a/omapip/Makefile.am b/omapip/Makefile.am

+ index 446a594..b0d2680 100644

+ --- a/omapip/Makefile.am

+ +++ b/omapip/Makefile.am

+ @@ -1,4 +1,4 @@

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+  

   lib_LIBRARIES = libomapi.a

   noinst_PROGRAMS = svtest

-  

- @@ -12,6 +10,6 @@ man_MANS = omapi.3

+ @@ -12,6 +12,5 @@ man_MANS = omapi.3

   EXTRA_DIST = $(man_MANS)

   

   svtest_SOURCES = test.c

  -svtest_LDADD = libomapi.a $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \

  -		$(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a

- +svtest_LDADD = libomapi.a \

- +	       $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +svtest_LDADD = libomapi.a $(BIND_LIBS)

   

- diff -up dhcp-4.3.5b1/relay/Makefile.am.remove-bind dhcp-4.3.5b1/relay/Makefile.am

- --- dhcp-4.3.5b1/relay/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/relay/Makefile.am	2016-09-12 17:00:22.798902249 +0200

- @@ -1,12 +1,9 @@

+ diff --git a/relay/Makefile.am b/relay/Makefile.am

+ index 3060eca..c9a1cba 100644

+ --- a/relay/Makefile.am

+ +++ b/relay/Makefile.am

+ @@ -1,12 +1,11 @@

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+  

   AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'

   

   sbin_PROGRAMS = dhcrelay
@@ -203,59 +290,62 @@ 

   dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

  -		 $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \

  -		 $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a

- +		 $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +		 $(BIND_LIBS)

   man_MANS = dhcrelay.8

   EXTRA_DIST = $(man_MANS)

   

- diff -up dhcp-4.3.5b1/server/Makefile.am.remove-bind dhcp-4.3.5b1/server/Makefile.am

- --- dhcp-4.3.5b1/server/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/server/Makefile.am	2016-09-12 17:00:22.798902249 +0200

- @@ -4,8 +4,6 @@

+ diff --git a/server/Makefile.am b/server/Makefile.am

+ index 54feedf..30cf2b1 100644

+ --- a/server/Makefile.am

+ +++ b/server/Makefile.am

+ @@ -4,7 +4,7 @@

   # production code. Sadly, we are not there yet.

   SUBDIRS = . tests

   

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+  

   AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'

   

-  dist_sysconf_DATA = dhcpd.conf.example

- @@ -15,10 +13,9 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c

-  		dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c

+ @@ -16,9 +16,7 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \

   

   dhcpd_CFLAGS = $(LDAP_CFLAGS)

- -dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

+  dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

  -	      ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \

  -	      $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \

  -	      $(BINDLIBDIR)/libisc.a $(LDAP_LIBS)

- +dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dhcpctl/libdhcpctl.a \

- +	      $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export \

- +	      $(LDAP_LIBS)

+ +	      ../dhcpctl/libdhcpctl.a $(BIND_LIBS) $(LDAP_LIBS)

   

   man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5

   EXTRA_DIST = $(man_MANS)

- diff -up dhcp-4.3.5b1/server/tests/Makefile.am.remove-bind dhcp-4.3.5b1/server/tests/Makefile.am

- --- dhcp-4.3.5b1/server/tests/Makefile.am.remove-bind	2016-08-26 20:19:53.000000000 +0200

- +++ dhcp-4.3.5b1/server/tests/Makefile.am	2016-09-12 17:00:22.799902249 +0200

- @@ -1,9 +1,7 @@

+ diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am

+ index a87c5e7..771de06 100644

+ --- a/server/tests/Makefile.am

+ +++ b/server/tests/Makefile.am

+ @@ -1,9 +1,10 @@

   SUBDIRS = .

   

  -BINDLIBDIR = @BINDDIR@/lib

- -

+ +BIND_LIBS = @BIND_LIBS@

+ +

+  

   AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes

  -AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)

- +AM_CPPFLAGS += -I$(top_srcdir)

+ +AM_CPPFLAGS += $(BIND_CPPFLAGS) -I$(top_srcdir)

   AM_CPPFLAGS += -DLOCALSTATEDIR='"."'

   

   EXTRA_DIST = Atffile

- @@ -20,9 +18,8 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpa

+ @@ -20,9 +21,7 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c      \

             ../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c

   

   DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \

  -          $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \

  -	  $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \

  -	  $(BINDLIBDIR)/libisc.a

- +	   $(top_builddir)/dhcpctl/libdhcpctl.a \

- +	   $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +          $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND_LIBS)

   

   ATF_TESTS =

   if HAVE_ATF

+ -- 

+ 2.14.3

+ 

file modified
+71 -62
@@ -1,52 +1,51 @@ 

- diff -up dhcp-4.3.4/client/Makefile.am.sharedlib dhcp-4.3.4/client/Makefile.am

- --- dhcp-4.3.4/client/Makefile.am.sharedlib	2016-04-29 11:48:30.389923087 +0200

- +++ dhcp-4.3.4/client/Makefile.am	2016-04-29 11:48:30.393923084 +0200

- @@ -13,7 +13,7 @@ dhclient_SOURCES = clparse.c dhclient.c

+ diff --git a/client/Makefile.am b/client/Makefile.am

+ index b85f5d2..b1ecf82 100644

+ --- a/client/Makefile.am

+ +++ b/client/Makefile.am

+ @@ -15,6 +15,6 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \

   		   scripts/bsdos scripts/freebsd scripts/linux scripts/macos \

   		   scripts/netbsd scripts/nextstep scripts/openbsd \

   		   scripts/solaris scripts/openwrt

- -dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

- +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

-  		 $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ -dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BIND_LIBS)

+ +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la $(BIND_LIBS)

   man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5

   EXTRA_DIST = $(man_MANS)

- diff -up dhcp-4.3.4/common/tests/Makefile.am.sharedlib dhcp-4.3.4/common/tests/Makefile.am

- --- dhcp-4.3.4/common/tests/Makefile.am.sharedlib	2016-04-29 11:48:30.394923084 +0200

- +++ dhcp-4.3.4/common/tests/Makefile.am	2016-04-29 11:54:16.890716651 +0200

- @@ -13,25 +13,25 @@ ATF_TESTS += alloc_unittest dns_unittest

+ diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am

+ index 196aa44..1ccaa05 100644

+ --- a/common/tests/Makefile.am

+ +++ b/common/tests/Makefile.am

+ @@ -15,22 +15,22 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest

   alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c

   alloc_unittest_LDADD = $(ATF_LDFLAGS)

   alloc_unittest_LDADD += ../libdhcp.a  \

- -	../../omapip/libomapi.a \

- +	../../omapip/libomapi.la \

-  	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ -	../../omapip/libomapi.a $(BIND_LIBS)

+ +	../../omapip/libomapi.la $(BIND_LIBS)

   

   dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c

   dns_unittest_LDADD = $(ATF_LDFLAGS)

   dns_unittest_LDADD += ../libdhcp.a  \

- -	../../omapip/libomapi.a \

- +	../../omapip/libomapi.la \

-  	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ -	../../omapip/libomapi.a $(BIND_LIBS)

+ +	../../omapip/libomapi.la $(BIND_LIBS)

   

   misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c

   misc_unittest_LDADD = $(ATF_LDFLAGS)

   misc_unittest_LDADD += ../libdhcp.a  \

- -	../../omapip/libomapi.a \

- +	../../omapip/libomapi.la \

-  	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ -	../../omapip/libomapi.a $(BIND_LIBS)

+ +	../../omapip/libomapi.la $(BIND_LIBS)

   

   ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c

   ns_name_unittest_LDADD = $(ATF_LDFLAGS)

   ns_name_unittest_LDADD += ../libdhcp.a  \

- -	../../omapip/libomapi.a \

- +	../../omapip/libomapi.la \

-  	$(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ -	../../omapip/libomapi.a $(BIND_LIBS)

+ +	../../omapip/libomapi.la $(BIND_LIBS)

   

   check: $(ATF_TESTS)

- diff -up dhcp-4.3.4/configure.ac.sharedlib dhcp-4.3.4/configure.ac

- --- dhcp-4.3.4/configure.ac.sharedlib	2016-04-29 11:48:30.394923084 +0200

- +++ dhcp-4.3.4/configure.ac	2016-04-29 11:55:22.729691668 +0200

- @@ -47,7 +47,8 @@ AM_CONDITIONAL(CROSS_COMPILING, test "$c

+  	@if test $(top_srcdir) != ${top_builddir}; then \

+ diff --git a/configure.ac b/configure.ac

+ index f594cfa..adc98a8 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -47,7 +47,8 @@ AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")

   # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.

   AC_USE_SYSTEM_EXTENSIONS

   
@@ -56,10 +55,13 @@ 

   

   AC_PATH_PROG(AR, ar)

   AC_SUBST(AR)

- diff -up dhcp-4.3.4/dhcpctl/Makefile.am.sharedlib dhcp-4.3.4/dhcpctl/Makefile.am

- --- dhcp-4.3.4/dhcpctl/Makefile.am.sharedlib	2016-04-29 11:48:30.394923084 +0200

- +++ dhcp-4.3.4/dhcpctl/Makefile.am	2016-04-29 11:56:18.390670546 +0200

- @@ -1,15 +1,15 @@

+ diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am

+ index fa20a78..dd016e4 100644

+ --- a/dhcpctl/Makefile.am

+ +++ b/dhcpctl/Makefile.am

+ @@ -1,17 +1,17 @@

+  BIND_LIBS = @BIND_LIBS@

+  

   bin_PROGRAMS = omshell

  -lib_LIBRARIES = libdhcpctl.a

  +lib_LTLIBRARIES = libdhcpctl.la
@@ -70,7 +72,7 @@ 

   omshell_SOURCES = omshell.c

  -omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \

  +omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \

-  	        $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+  	        $(BIND_LIBS)

   

  -libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c

  +libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c
@@ -78,11 +80,14 @@ 

   cltest_SOURCES = cltest.c

  -cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \

  +cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \

-  	       $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

- diff -up dhcp-4.3.4/omapip/Makefile.am.sharedlib dhcp-4.3.4/omapip/Makefile.am

- --- dhcp-4.3.4/omapip/Makefile.am.sharedlib	2016-04-29 11:48:30.392923085 +0200

- +++ dhcp-4.3.4/omapip/Makefile.am	2016-04-29 11:57:33.709641969 +0200

- @@ -1,7 +1,7 @@

+  	       $(BIND_LIBS)

+ diff --git a/omapip/Makefile.am b/omapip/Makefile.am

+ index b0d2680..265bcef 100644

+ --- a/omapip/Makefile.am

+ +++ b/omapip/Makefile.am

+ @@ -1,9 +1,9 @@

+  BIND_LIBS = @BIND_LIBS@

+  

  -lib_LIBRARIES = libomapi.a

  +lib_LTLIBRARIES = libomapi.la

   noinst_PROGRAMS = svtest
@@ -92,49 +97,53 @@ 

   		     errwarn.c listener.c dispatch.c generic.c support.c \

   		     handle.c message.c convert.c hash.c auth.c inet_addr.c \

   		     array.c trace.c toisc.c iscprint.c isclib.c

- @@ -10,6 +10,6 @@ man_MANS = omapi.3

+ @@ -12,5 +12,5 @@ man_MANS = omapi.3

   EXTRA_DIST = $(man_MANS)

   

   svtest_SOURCES = test.c

- -svtest_LDADD = libomapi.a \

- +svtest_LDADD = libomapi.la \

-  	       $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ -svtest_LDADD = libomapi.a $(BIND_LIBS)

+ +svtest_LDADD = libomapi.la $(BIND_LIBS)

   

- diff -up dhcp-4.3.4/relay/Makefile.am.sharedlib dhcp-4.3.4/relay/Makefile.am

- --- dhcp-4.3.4/relay/Makefile.am.sharedlib	2016-04-29 11:48:30.392923085 +0200

- +++ dhcp-4.3.4/relay/Makefile.am	2016-04-29 11:48:30.395923083 +0200

- @@ -2,7 +2,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst

+ diff --git a/relay/Makefile.am b/relay/Makefile.am

+ index c9a1cba..316a524 100644

+ --- a/relay/Makefile.am

+ +++ b/relay/Makefile.am

+ @@ -4,7 +4,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'

   

   sbin_PROGRAMS = dhcrelay

   dhcrelay_SOURCES = dhcrelay.c

  -dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

  +dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

-  		 $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+  		 $(BIND_LIBS)

   man_MANS = dhcrelay.8

   EXTRA_DIST = $(man_MANS)

- diff -up dhcp-4.3.4/server/Makefile.am.sharedlib dhcp-4.3.4/server/Makefile.am

- --- dhcp-4.3.4/server/Makefile.am.sharedlib	2016-04-29 11:48:30.392923085 +0200

- +++ dhcp-4.3.4/server/Makefile.am	2016-04-29 11:48:30.395923083 +0200

- @@ -13,7 +13,7 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c

+ diff --git a/server/Makefile.am b/server/Makefile.am

+ index 30cf2b1..f56f310 100644

+ --- a/server/Makefile.am

+ +++ b/server/Makefile.am

+ @@ -15,8 +15,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \

   		dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c

   

   dhcpd_CFLAGS = $(LDAP_CFLAGS)

- -dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dhcpctl/libdhcpctl.a \

- +dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la ../dhcpctl/libdhcpctl.la \

-  	      $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export \

-  	      $(LDAP_LIBS)

-  

- diff -up dhcp-4.3.4/server/tests/Makefile.am.sharedlib dhcp-4.3.4/server/tests/Makefile.am

- --- dhcp-4.3.4/server/tests/Makefile.am.sharedlib	2016-04-29 11:48:30.395923083 +0200

- +++ dhcp-4.3.4/server/tests/Makefile.am	2016-04-29 11:59:13.414604130 +0200

- @@ -17,8 +17,8 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpa

+ -dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \

+ -	      ../dhcpctl/libdhcpctl.a $(BIND_LIBS) $(LDAP_LIBS)

+ +dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \

+ +	      ../dhcpctl/libdhcpctl.la $(BIND_LIBS) $(LDAP_LIBS)

+  

+  man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5

+  EXTRA_DIST = $(man_MANS)

+ diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am

+ index 771de06..8d8a2c1 100644

+ --- a/server/tests/Makefile.am

+ +++ b/server/tests/Makefile.am

+ @@ -20,8 +20,8 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c      \

             ../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c        \

             ../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c

   

  -DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \

- -	   $(top_builddir)/dhcpctl/libdhcpctl.a \

+ -          $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND_LIBS)

  +DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \

- +	   $(top_builddir)/dhcpctl/libdhcpctl.la \

-  	   $(BIND9_LIBDIR) -lirs-export -ldns-export -lisccfg-export -lisc-export

+ +          $(top_builddir)/dhcpctl/libdhcpctl.la $(BIND_LIBS)

   

   ATF_TESTS =

+  if HAVE_ATF

file modified
+22 -10
@@ -8,17 +8,15 @@ 

  %global dhcpconfdir %{_sysconfdir}/dhcp

  

  

- %global prever b1

+ #global prever b1

  #global patchver P1

- #global VERSION %%{version}-%%{patchver}

- #global VERSION %%{version}%%{prever}

- #global VERSION %{version}

+ %global DHCPVERSION %{version}%{?prever}%{?patchver:-%{patchver}}

  

  

  Summary:  Dynamic host configuration protocol software

  Name:     dhcp

  Version:  4.3.6

- Release:  13%{?dist}

+ Release:  16%{?dist}

  # NEVER CHANGE THE EPOCH on this package.  The previous maintainer (prior to

  # dcantrell maintaining the package) made incorrect use of the epoch and

  # that's why it is at 12 now.  It should have never been used, but it was.
@@ -26,7 +24,7 @@ 

  Epoch:    12

  License:  ISC

  Url:      http://isc.org/products/DHCP/

- Source0:  ftp://ftp.isc.org/isc/dhcp/%{VERSION}/dhcp-%{VERSION}.tar.gz

+ Source0:  ftp://ftp.isc.org/isc/dhcp/%{DHCPVERSION}/dhcp-%{DHCPVERSION}.tar.gz

  Source1:  dhclient-script

  Source2:  README.dhclient.d

  Source3:  11-dhclient
@@ -76,6 +74,7 @@ 

  Patch38:  dhcp-dhclient-preinit6s.patch

  Patch39:  dhcp-handle_ctx_signals.patch

  Patch40:  dhcp-4.3.6-omapi-leak.patch

+ Patch41:  dhcp-4.3.6-isc-util.patch

  

  

  BuildRequires: autoconf
@@ -86,7 +85,7 @@ 

  BuildRequires: krb5-devel

  BuildRequires: libcap-ng-devel

  # https://fedorahosted.org/fpc/ticket/502#comment:3

- BuildRequires: bind99-devel

+ BuildRequires: bind-export-devel

  BuildRequires: systemd systemd-devel

  # dhcp-sd_notify.patch

  BuildRequires: pkgconfig(libsystemd)
@@ -216,7 +215,7 @@ 

  %endif

  

  %prep

- %setup -q -n dhcp-%{VERSION}

+ %setup -q -n dhcp-%{DHCPVERSION}

  

  # Remove bundled BIND source

  rm bind/bind.tar.gz
@@ -342,6 +341,9 @@ 

  # https://bugzilla.redhat.com/1523547 

  %patch40 -p1 -b .omapi-leak

  

+ # include isc/util.h explicitly, is it no longer contained in used headers

+ %patch41 -p1 -b .isc-util

+ 

  # DHCLIENT_DEFAULT_PREFIX_LEN  64 -> 128

  # https://bugzilla.gnome.org/show_bug.cgi?id=656610

  sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' includes/site.h
@@ -379,8 +381,7 @@ 

      --with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \

      --with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \

      --with-relay-pid-file=%{_localstatedir}/run/dhcrelay.pid \

-     --with-libbind=%{_includedir}/bind99 \

-     --with-libbind-libs=%{_libdir}/bind99 \

+     --with-libbind=/usr/bin/isc-export-config.sh \

      --with-ldap \

      --with-ldapcrypto \

      --with-ldap-gssapi \
@@ -665,6 +666,17 @@ 

  %endif

  

  %changelog

+ * Thu Feb 22 2018 Petr Menšík <pemensik@redhat.com> - 12:4.3.6-16

+ - Compile with recent bind includes, that does not include isc/util.h

+ 

+ * Thu Feb 22 2018 Petr Menšík <pemensik@redhat.com> - 12:4.3.6-15

+ - Do not rely on ignoring case sensitivity of VERSION variable

+ 

+ * Thu Feb 22 2018 Petr Menšík <pemensik@redhat.com> - 12:4.3.6-14

+ - Use bind-export-libs package instead of bind99

+ - Use isc-config.sh to configure bind libs

+ - Change requirement to bind-export-devel

+ 

  * Thu Feb 22 2018 Pavel Zhukov <pzhukov@redhat.com> - 12:4.3.6-13

  - Do not parse sysconfig/network-scripts if initscripts not installed (#1098172)

  

Use explicit BuildRequire to choose bind-export-devel. Change dhcp to build from custom separate libdir and includes to using special isc-export-config.sh. It provides accurate flags and all libraries needed to link with bind. Use single variable to pass all bind libraries, because all of them are used for each binary. Add support for BIND 9.11.3b1.

rebased onto 410937e

6 years ago

Pull-Request has been merged by landgraf

6 years ago