remove buildrequires bind-export-devel and buildin bind
This commit is contained in:
parent
4192461fc8
commit
92a0cd5eca
197
0025-bind-Detect-system-time-changes.patch
Normal file
197
0025-bind-Detect-system-time-changes.patch
Normal file
@ -0,0 +1,197 @@
|
||||
From ef4f5e80d8a1ea1507829ea6f5214f276478f475 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Tue, 22 Oct 2019 16:23:24 +0200
|
||||
Subject: [PATCH 25/27] bind: Detect system time changes
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
---
|
||||
bind/bind/lib/isc/include/isc/result.h | 4 ++-
|
||||
bind/bind/lib/isc/include/isc/util.h | 4 +++
|
||||
bind/bind/lib/isc/result.c | 2 ++
|
||||
bind/bind/lib/isc/unix/app.c | 41 ++++++++++++++++++++++++++++---
|
||||
bind/bind/lib/isc/unix/include/isc/time.h | 20 +++++++++++++++
|
||||
bind/bind/lib/isc/unix/time.c | 22 +++++++++++++++++
|
||||
6 files changed, 89 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bind/bind/lib/isc/include/isc/result.h b/bind/bind/lib/isc/include/isc/result.h
|
||||
index 0389efa..0e35f98 100644
|
||||
--- a/bind/bind/lib/isc/include/isc/result.h
|
||||
+++ b/bind/bind/lib/isc/include/isc/result.h
|
||||
@@ -89,7 +89,9 @@
|
||||
#define ISC_R_DISCFULL 67 /*%< disc full */
|
||||
#define ISC_R_DEFAULT 68 /*%< default */
|
||||
#define ISC_R_IPV4PREFIX 69 /*%< IPv4 prefix */
|
||||
-#define ISC_R_NRESULTS 70
|
||||
+#define ISC_R_TIMESHIFTED 70 /*%< system time changed */
|
||||
+/*% Not a result code: the number of results. */
|
||||
+#define ISC_R_NRESULTS 71
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
diff --git a/bind/bind/lib/isc/include/isc/util.h b/bind/bind/lib/isc/include/isc/util.h
|
||||
index 973c348..cceeb5e 100644
|
||||
--- a/bind/bind/lib/isc/include/isc/util.h
|
||||
+++ b/bind/bind/lib/isc/include/isc/util.h
|
||||
@@ -289,6 +289,10 @@ extern void mock_assert(const int result, const char* const expression,
|
||||
* Time
|
||||
*/
|
||||
#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+#define TIME_MONOTONIC(tp) RUNTIME_CHECK(isc_time_boottime((tp)) == ISC_R_SUCCESS)
|
||||
+#endif
|
||||
+
|
||||
|
||||
/*%
|
||||
* Alignment
|
||||
diff --git a/bind/bind/lib/isc/result.c b/bind/bind/lib/isc/result.c
|
||||
index a9db132..7c04831 100644
|
||||
--- a/bind/bind/lib/isc/result.c
|
||||
+++ b/bind/bind/lib/isc/result.c
|
||||
@@ -105,6 +105,7 @@ static const char *description[ISC_R_NRESULTS] = {
|
||||
"disc full", /*%< 67 */
|
||||
"default", /*%< 68 */
|
||||
"IPv4 prefix", /*%< 69 */
|
||||
+ "time changed", /*%< 70 */
|
||||
};
|
||||
|
||||
static const char *identifier[ISC_R_NRESULTS] = {
|
||||
@@ -178,6 +179,7 @@ static const char *identifier[ISC_R_NRESULTS] = {
|
||||
"ISC_R_DISCFULL",
|
||||
"ISC_R_DEFAULT",
|
||||
"ISC_R_IPV4PREFIX",
|
||||
+ "ISC_R_TIMESHIFTED",
|
||||
};
|
||||
|
||||
#define ISC_RESULT_RESULTSET 2
|
||||
diff --git a/bind/bind/lib/isc/unix/app.c b/bind/bind/lib/isc/unix/app.c
|
||||
index a6e9882..dbd23f7 100644
|
||||
--- a/bind/bind/lib/isc/unix/app.c
|
||||
+++ b/bind/bind/lib/isc/unix/app.c
|
||||
@@ -442,15 +442,51 @@ isc__app_ctxonrun(isc_appctx_t *ctx0, isc_mem_t *mctx, isc_task_t *task,
|
||||
static isc_result_t
|
||||
evloop(isc__appctx_t *ctx) {
|
||||
isc_result_t result;
|
||||
+ isc_time_t now;
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+ isc_time_t monotonic;
|
||||
+ uint64_t diff = 0;
|
||||
+#else
|
||||
+ isc_time_t prev;
|
||||
+ TIME_NOW(&prev);
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+
|
||||
|
||||
while (!ctx->want_shutdown) {
|
||||
int n;
|
||||
- isc_time_t when, now;
|
||||
+ isc_time_t when;
|
||||
+
|
||||
struct timeval tv, *tvp;
|
||||
isc_socketwait_t *swait;
|
||||
bool readytasks;
|
||||
bool call_timer_dispatch = false;
|
||||
|
||||
+ uint64_t us;
|
||||
+
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+ // TBD macros for following three lines
|
||||
+ TIME_NOW(&now);
|
||||
+ TIME_MONOTONIC(&monotonic);
|
||||
+ INSIST(now.seconds > monotonic.seconds)
|
||||
+ us = isc_time_microdiff (&now, &monotonic);
|
||||
+ if (us < diff){
|
||||
+ us = diff - us;
|
||||
+ if (us > 1000000){ // ignoring shifts less than one second
|
||||
+ return ISC_R_TIMESHIFTED;
|
||||
+ };
|
||||
+ diff = isc_time_microdiff (&now, &monotonic);
|
||||
+ } else {
|
||||
+ diff = isc_time_microdiff (&now, &monotonic);
|
||||
+ // not implemented
|
||||
+ }
|
||||
+#else
|
||||
+ TIME_NOW(&now);
|
||||
+ if (isc_time_compare (&now, &prev) < 0)
|
||||
+ return ISC_R_TIMESHIFTED;
|
||||
+ TIME_NOW(&prev);
|
||||
+#endif
|
||||
/*
|
||||
* Check the reload (or suspend) case first for exiting the
|
||||
* loop as fast as possible in case:
|
||||
@@ -475,9 +511,8 @@ evloop(isc__appctx_t *ctx) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
tvp = NULL;
|
||||
else {
|
||||
- uint64_t us;
|
||||
-
|
||||
TIME_NOW(&now);
|
||||
+
|
||||
us = isc_time_microdiff(&when, &now);
|
||||
if (us == 0)
|
||||
call_timer_dispatch = true;
|
||||
diff --git a/bind/bind/lib/isc/unix/include/isc/time.h b/bind/bind/lib/isc/unix/include/isc/time.h
|
||||
index b864c29..5dd43c9 100644
|
||||
--- a/bind/bind/lib/isc/unix/include/isc/time.h
|
||||
+++ b/bind/bind/lib/isc/unix/include/isc/time.h
|
||||
@@ -132,6 +132,26 @@ isc_time_isepoch(const isc_time_t *t);
|
||||
*\li 't' is a valid pointer.
|
||||
*/
|
||||
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+isc_result_t
|
||||
+isc_time_boottime(isc_time_t *t);
|
||||
+/*%<
|
||||
+ * Set 't' to monotonic time from previous boot
|
||||
+ * it's not affected by system time change. It also
|
||||
+ * includes the time system was suspended
|
||||
+ *
|
||||
+ * Requires:
|
||||
+ *\li 't' is a valid pointer.
|
||||
+ *
|
||||
+ * Returns:
|
||||
+ *
|
||||
+ *\li Success
|
||||
+ *\li Unexpected error
|
||||
+ * Getting the time from the system failed.
|
||||
+ */
|
||||
+#endif /* CLOCK_BOOTTIME */
|
||||
+
|
||||
+
|
||||
isc_result_t
|
||||
isc_time_now(isc_time_t *t);
|
||||
/*%<
|
||||
diff --git a/bind/bind/lib/isc/unix/time.c b/bind/bind/lib/isc/unix/time.c
|
||||
index 8edc9df..fe0bb91 100644
|
||||
--- a/bind/bind/lib/isc/unix/time.c
|
||||
+++ b/bind/bind/lib/isc/unix/time.c
|
||||
@@ -498,3 +498,25 @@ isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len) {
|
||||
t->nanoseconds / NS_PER_MS);
|
||||
}
|
||||
}
|
||||
+
|
||||
+
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+isc_result_t
|
||||
+isc_time_boottime(isc_time_t *t) {
|
||||
+ struct timespec ts;
|
||||
+
|
||||
+ char strbuf[ISC_STRERRORSIZE];
|
||||
+
|
||||
+ if (clock_gettime (CLOCK_BOOTTIME, &ts) != 0){
|
||||
+ isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf);
|
||||
+ return (ISC_R_UNEXPECTED);
|
||||
+ }
|
||||
+
|
||||
+ t->seconds = ts.tv_sec;
|
||||
+ t->nanoseconds = ts.tv_nsec;
|
||||
+
|
||||
+ return (ISC_R_SUCCESS);
|
||||
+
|
||||
+};
|
||||
+#endif
|
||||
--
|
||||
2.14.5
|
||||
|
||||
@ -1,479 +0,0 @@
|
||||
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 | 7 +-
|
||||
client/tests/Makefile.am | 8 +--
|
||||
common/tests/Makefile.am | 31 ++-------
|
||||
configure.ac | 143 ++++++++++++++++++++++++++-------------
|
||||
dhcpctl/Makefile.am | 15 +---
|
||||
omapip/Makefile.am | 12 +---
|
||||
relay/Makefile.am | 7 +-
|
||||
relay/tests/Makefile.am | 6 +-
|
||||
server/Makefile.am | 6 +-
|
||||
server/tests/Makefile.am | 8 +--
|
||||
10 files changed, 124 insertions(+), 119 deletions(-)
|
||||
|
||||
diff --git a/client/Makefile.am b/client/Makefile.am
|
||||
index 0689185..348d2ab 100644
|
||||
--- a/client/Makefile.am
|
||||
+++ b/client/Makefile.am
|
||||
@@ -4,6 +4,8 @@
|
||||
# production code. Sadly, we are not there yet.
|
||||
SUBDIRS = . tests
|
||||
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
+
|
||||
AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"'
|
||||
AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"'
|
||||
|
||||
@@ -14,10 +16,7 @@ dhclient_SOURCES = client_tables.c clparse.c dhclient.c dhc6.c \
|
||||
scripts/netbsd scripts/nextstep scripts/openbsd \
|
||||
scripts/solaris scripts/openwrt
|
||||
dhclient_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@ \
|
||||
+ $(BIND_LIBS) \
|
||||
$(CAPNG_LDADD)
|
||||
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/client/tests/Makefile.am b/client/tests/Makefile.am
|
||||
index 8f1f058..13ff931 100644
|
||||
--- a/client/tests/Makefile.am
|
||||
+++ b/client/tests/Makefile.am
|
||||
@@ -1,7 +1,8 @@
|
||||
SUBDIRS = .
|
||||
+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='"."'
|
||||
|
||||
@@ -19,10 +20,7 @@ DHCPSRC = ../clparse.c ../dhc6.c ../dhclient.c
|
||||
DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
|
||||
$(top_builddir)/omapip/libomapi.@A@ \
|
||||
$(top_builddir)/dhcpctl/libdhcpctl.@A@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
ATF_TESTS =
|
||||
if HAVE_ATF
|
||||
diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
|
||||
index a515265..35fb93f 100644
|
||||
--- a/common/tests/Makefile.am
|
||||
+++ b/common/tests/Makefile.am
|
||||
@@ -1,4 +1,5 @@
|
||||
SUBDIRS = .
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = $(ATF_CFLAGS) -I$(top_srcdir)/includes
|
||||
|
||||
@@ -14,51 +15,33 @@ 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@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@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@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@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@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@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@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
option_unittest_SOURCES = option_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
option_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
option_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
domain_name_unittest_SOURCES = domain_name_test.c \
|
||||
$(top_srcdir)/tests/t_api_dhcp.c
|
||||
domain_name_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
domain_name_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
check: $(ATF_TESTS)
|
||||
@if test $(top_srcdir) != ${top_builddir}; then \
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e1ab5ea..52bab2a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -786,11 +786,11 @@ AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
|
||||
BINDSUBDIR=
|
||||
BINDDIR=
|
||||
BINDSRCDIR=
|
||||
-BINDLIBIRSDIR=
|
||||
-BINDLIBDNSDIR=
|
||||
-BINDLIBISCCFGDIR=
|
||||
-BINDLIBISCDIR=
|
||||
DISTCHECK_LIBBIND_CONFIGURE_FLAG=
|
||||
+
|
||||
+BIND_CONFIG=
|
||||
+BIND_CPPFLAGS=
|
||||
+BIND_LIBS=
|
||||
AC_ARG_WITH(libbind,
|
||||
AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH]),
|
||||
use_libbind="$withval", use_libbind="no")
|
||||
@@ -817,42 +817,107 @@ no)
|
||||
fi
|
||||
AC_CONFIG_FILES([$srcdir/bind/Makefile])
|
||||
|
||||
- BINDLIBIRSDIR="$BINDSRCDIR/lib/irs"
|
||||
- BINDLIBDNSDIR="$BINDSRCDIR/lib/dns"
|
||||
- BINDLIBISCCFGDIR="$BINDSRCDIR/lib/isccfg"
|
||||
- BINDLIBISCDIR="$BINDSRCDIR/lib/isc"
|
||||
;;
|
||||
+config)
|
||||
+ AC_PATH_PROG(BIND_CONFIG, [isc-config.sh bind9-config])
|
||||
+ ;;
|
||||
*)
|
||||
- if test ! -d "$use_libbind"; then
|
||||
- AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
|
||||
- fi
|
||||
- if test ! -d "$use_libbind/include" -o \
|
||||
- ! -f "$use_libbind/include/isc/buffer.h"
|
||||
- then
|
||||
- AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
|
||||
- fi
|
||||
- if test ! -d "$use_libbind/lib" -o \
|
||||
- \( ! -f "$use_libbind/lib/libisc.a" -a \
|
||||
- ! -f "$use_libbind/lib/libisc.la" \)
|
||||
- then
|
||||
- AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
|
||||
+ if test -f "$use_libbind" -a -x "$use_libbind"; then
|
||||
+ # passed full path of isc-config.sh
|
||||
+ BIND_CONFIG="$use_libbind"
|
||||
+ else
|
||||
+ if test ! -d "$use_libbind"; then
|
||||
+ AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
|
||||
+ fi
|
||||
+ if test ! -d "$use_libbind/include" -o \
|
||||
+ ! -f "$use_libbind/include/isc/buffer.h"
|
||||
+ then
|
||||
+ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
|
||||
+ fi
|
||||
+ if test ! -d "$use_libbind/lib" -o \
|
||||
+ \( ! -f "$use_libbind/lib/libisc.a" -a \
|
||||
+ ! -f "$use_libbind/lib/libisc.la" \)
|
||||
+ then
|
||||
+ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
|
||||
+ fi
|
||||
+ BINDDIR="$use_libbind"
|
||||
+ DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
|
||||
fi
|
||||
- BINDDIR="$use_libbind"
|
||||
- BINDLIBIRSDIR="$BINDDIR/lib"
|
||||
- BINDLIBDNSDIR="$BINDDIR/lib"
|
||||
- BINDLIBISCCFGDIR="$BINDDIR/lib"
|
||||
- BINDLIBISCDIR="$BINDDIR/lib"
|
||||
- DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
|
||||
;;
|
||||
esac
|
||||
+
|
||||
+if test -z "$BIND_CONFIG"; then
|
||||
+ BIND_CPPFLAGS="-I${BINDDIR}/include"
|
||||
+ BIND_LIBDIR="${BINDDIR}/lib"
|
||||
+ BIND_LIBS="${BINDDIR}/lib/libirs.a ${BINDDIR}/lib/libdns.a ${BINDDIR}/lib//libisccfg.a ${BINDDIR}/lib/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();
|
||||
+], [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(BINDSUBDIR)
|
||||
AC_SUBST(BINDDIR)
|
||||
AC_SUBST(BINDSRCDIR)
|
||||
-AC_SUBST(BINDLIBIRSDIR)
|
||||
-AC_SUBST(BINDLIBDNSDIR)
|
||||
-AC_SUBST(BINDLIBISCCFGDIR)
|
||||
-AC_SUBST(BINDLIBISCDIR)
|
||||
AC_SUBST(DISTCHECK_LIBBIND_CONFIGURE_FLAG)
|
||||
+AC_SUBST(BIND_CPPFLAGS)
|
||||
+AC_SUBST(BIND_LIBS)
|
||||
AM_CONDITIONAL(HAVE_BINDDIR, test "$use_libbind" = "no")
|
||||
|
||||
#
|
||||
@@ -877,20 +942,6 @@ AC_ARG_ENABLE(libtool,
|
||||
[use GNU libtool for dynamic shared libraries (default is no).]),
|
||||
want_libtool="$enableval")
|
||||
|
||||
-if test "$use_libbind" != "no"; then
|
||||
- if test "$want_libtool" = "yes" -a \
|
||||
- ! -f "$use_libbind/lib/libisc.la"
|
||||
- then
|
||||
- AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
|
||||
- fi
|
||||
- if test "$want_libtool" = "no" -a \
|
||||
- ! -f "$use_libbind/lib/libisc.a"
|
||||
- then
|
||||
- AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
-
|
||||
if test "$want_libtool" = "yes"; then
|
||||
AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
|
||||
# expand $ac_configure_args
|
||||
@@ -1021,7 +1072,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\$(top_srcdir)/includes $BIND_CPPFLAGS"
|
||||
|
||||
case "$host" in
|
||||
*-darwin*)
|
||||
diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
|
||||
index 0d66971..0e91295 100644
|
||||
--- a/dhcpctl/Makefile.am
|
||||
+++ b/dhcpctl/Makefile.am
|
||||
@@ -1,7 +1,4 @@
|
||||
-BINDLIBIRSDIR=@BINDLIBIRSDIR@
|
||||
-BINDLIBDNSDIR=@BINDLIBDNSDIR@
|
||||
-BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
|
||||
-BINDLIBISCDIR=@BINDLIBISCDIR@
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
bin_PROGRAMS = omshell
|
||||
lib_LIBRARIES = libdhcpctl.a
|
||||
@@ -11,16 +8,10 @@ EXTRA_DIST = $(man_MANS)
|
||||
|
||||
omshell_SOURCES = omshell.c
|
||||
omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- $(BINDLIBIRSDIR)/libirs.a \
|
||||
- $(BINDLIBDNSDIR)/libdns.a \
|
||||
- $(BINDLIBISCCFGDIR)/libisccfg.a \
|
||||
- $(BINDLIBISCDIR)/libisc.a
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
|
||||
|
||||
cltest_SOURCES = cltest.c
|
||||
cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- $(BINDLIBIRSDIR)/libirs.a \
|
||||
- $(BINDLIBDNSDIR)/libdns.a \
|
||||
- $(BINDLIBISCCFGDIR)/libisccfg.a \
|
||||
- $(BINDLIBISCDIR)/libisc.a
|
||||
+ $(BIND_LIBS)
|
||||
diff --git a/omapip/Makefile.am b/omapip/Makefile.am
|
||||
index 5b61581..69be093 100644
|
||||
--- a/omapip/Makefile.am
|
||||
+++ b/omapip/Makefile.am
|
||||
@@ -1,8 +1,4 @@
|
||||
-BINDLIBIRSDIR=@BINDLIBIRSDIR@
|
||||
-BINDLIBDNSDIR=@BINDLIBDNSDIR@
|
||||
-BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
|
||||
-BINDLIBISCDIR=@BINDLIBISCDIR@
|
||||
-
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
lib_LIBRARIES = libomapi.a
|
||||
noinst_PROGRAMS = svtest
|
||||
|
||||
@@ -15,8 +11,4 @@ man_MANS = omapi.3
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
svtest_SOURCES = test.c
|
||||
-svtest_LDADD = libomapi.a \
|
||||
- $(BINDLIBIRSDIR)/libirs.a \
|
||||
- $(BINDLIBDNSDIR)/libdns.a \
|
||||
- $(BINDLIBISCCFGDIR)/libisccfg.a \
|
||||
- $(BINDLIBISCDIR)/libisc.a
|
||||
+svtest_LDADD = libomapi.a $(BIND_LIBS)
|
||||
diff --git a/relay/Makefile.am b/relay/Makefile.am
|
||||
index 4c5cfa6..eb27ba5 100644
|
||||
--- a/relay/Makefile.am
|
||||
+++ b/relay/Makefile.am
|
||||
@@ -1,14 +1,11 @@
|
||||
SUBDIRS = . tests
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
|
||||
|
||||
sbin_PROGRAMS = dhcrelay
|
||||
dhcrelay_SOURCES = dhcrelay.c
|
||||
dhcrelay_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@ \
|
||||
- $(CAPNG_LDADD)
|
||||
+ $(BIND_LIBS) $(CAPNG_LDADD)
|
||||
man_MANS = dhcrelay.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/relay/tests/Makefile.am b/relay/tests/Makefile.am
|
||||
index fce3115..0266cbe 100644
|
||||
--- a/relay/tests/Makefile.am
|
||||
+++ b/relay/tests/Makefile.am
|
||||
@@ -1,4 +1,5 @@
|
||||
SUBDIRS = .
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
|
||||
AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)
|
||||
@@ -16,10 +17,7 @@ DHCPSRC = ../dhcrelay.c
|
||||
|
||||
DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
|
||||
$(top_builddir)/omapip/libomapi.@A@ \
|
||||
- @BINDLIBIRSDIR@/libirs.@A@ \
|
||||
- @BINDLIBDNSDIR@/libdns.@A@ \
|
||||
- @BINDLIBISCCFGDIR@/libisccfg.@A@ \
|
||||
- @BINDLIBISCDIR@/libisc.@A@
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
ATF_TESTS =
|
||||
if HAVE_ATF
|
||||
diff --git a/server/Makefile.am b/server/Makefile.am
|
||||
index 787efca..163f712 100644
|
||||
--- a/server/Makefile.am
|
||||
+++ b/server/Makefile.am
|
||||
@@ -3,6 +3,7 @@
|
||||
# directory. That eliminates any discrepancies between tested code and
|
||||
# production code. Sadly, we are not there yet.
|
||||
SUBDIRS = . tests
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
|
||||
|
||||
@@ -15,10 +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@ \
|
||||
../dhcpctl/libdhcpctl.@A@ \
|
||||
- $(BINDLIBIRSDIR)/libirs.@A@ \
|
||||
- $(BINDLIBDNSDIR)/libdns.@A@ \
|
||||
- $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
|
||||
- $(BINDLIBISCDIR)/libisc.@A@ $(LDAP_LIBS)
|
||||
+ $(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 699a0b6..1e06d69 100644
|
||||
--- a/server/tests/Makefile.am
|
||||
+++ b/server/tests/Makefile.am
|
||||
@@ -1,7 +1,8 @@
|
||||
SUBDIRS = .
|
||||
+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='"."'
|
||||
|
||||
EXTRA_DIST = Atffile Kyuafile
|
||||
@@ -20,10 +21,7 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \
|
||||
DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
|
||||
$(top_builddir)/omapip/libomapi.@A@ \
|
||||
$(top_builddir)/dhcpctl/libdhcpctl.@A@ \
|
||||
- $(BINDLIBIRSDIR)/libirs.@A@ \
|
||||
- $(BINDLIBDNSDIR)/libdns.@A@ \
|
||||
- $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
|
||||
- $(BINDLIBISCDIR)/libisc.@A@
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
ATF_TESTS =
|
||||
if HAVE_ATF
|
||||
--
|
||||
2.23.0
|
||||
|
||||
32
dhcp.spec
32
dhcp.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Name: dhcp
|
||||
Version: 4.4.2
|
||||
Release: 9
|
||||
Release: 10
|
||||
Summary: Dynamic host configuration protocol software
|
||||
#Please don't change the epoch on this package
|
||||
Epoch: 12
|
||||
@ -42,6 +42,7 @@ Patch21: 0021-Load-leases-DB-in-non-replay-mode-only.patch
|
||||
Patch22: 0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch
|
||||
Patch23: 0023-option-97-pxe-client-id.patch
|
||||
Patch24: 0024-Detect-system-time-changes.patch
|
||||
Patch25: 0025-bind-Detect-system-time-changes.patch
|
||||
Patch26: 0026-Add-dhclient-5-B-option-description.patch
|
||||
Patch27: 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch
|
||||
|
||||
@ -52,16 +53,15 @@ Patch30: bugfix-dhcpd-2038-problem.patch
|
||||
Patch31: dhcpd-coredump-infiniband.patch
|
||||
Patch32: bugfix-dhclient-check-if-pid-was-held.patch
|
||||
Patch33: bugfix-dhcp-64-bit-lease-parse.patch
|
||||
Patch34: dhcp-remove-bind.patch
|
||||
Patch35: CVE-2021-25217.patch
|
||||
Patch36: 0001-fix-multiple-definition-with-gcc-10.patch
|
||||
Patch37: 0002-fix-multiple-definition-with-gcc-10.patch
|
||||
Patch34: CVE-2021-25217.patch
|
||||
Patch35: 0001-fix-multiple-definition-with-gcc-10.patch
|
||||
Patch36: 0002-fix-multiple-definition-with-gcc-10.patch
|
||||
|
||||
Patch38: fix-coredump-when-client-active-is-NULL.patch
|
||||
Patch39: feature-lease-time-config-ipv6.patch
|
||||
Patch40: add-a-test-case-to-parse-code93-in-option_unittest.patch
|
||||
Patch37: fix-coredump-when-client-active-is-NULL.patch
|
||||
Patch38: feature-lease-time-config-ipv6.patch
|
||||
Patch39: add-a-test-case-to-parse-code93-in-option_unittest.patch
|
||||
|
||||
BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel bind-export-devel
|
||||
BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel
|
||||
BuildRequires: systemd systemd-devel
|
||||
|
||||
Requires: shadow-utils coreutils grep sed systemd gawk ipcalc iproute iputils
|
||||
@ -93,8 +93,12 @@ libdhcpctl and libomapi static libraries are also included in this package.
|
||||
|
||||
%prep
|
||||
%setup -n %{name}-%{version}
|
||||
pushd bind
|
||||
tar -xvf bind.tar.gz
|
||||
ln -s bind-9* bind
|
||||
popd
|
||||
%autopatch -p1
|
||||
rm bind/bind.tar.gz
|
||||
#rm bind/bind.tar.gz
|
||||
|
||||
sed -i -e 's|/var/db/|%{_localstatedir}/lib/dhcpd/|g' contrib/dhcp-lease-list.pl
|
||||
|
||||
@ -112,7 +116,7 @@ CFLAGS="%{optflags} -fno-strict-aliasing" \
|
||||
--with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \
|
||||
--with-relay-pid-file=%{_localstatedir}/run/dhcrelay.pid \
|
||||
--with-ldap --with-ldapcrypto --with-ldap-gssapi --disable-static --enable-log-pid --enable-paranoia --enable-early-chroot \
|
||||
--enable-binary-leases --with-systemd --with-libbind=/usr/bin/isc-export-config.sh
|
||||
--enable-binary-leases --with-systemd
|
||||
|
||||
make
|
||||
|
||||
@ -296,6 +300,12 @@ exit 0
|
||||
%{_mandir}/man3/omapi.3.gz
|
||||
|
||||
%changelog
|
||||
* Fri Jan 07 2022 renmingshuai <renmingshuai@huawei.com> - 4.4.2-10
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:restart
|
||||
- DESC:remove buildrequires bind-export-devel and buildin bind
|
||||
|
||||
* Fri Nov 26 2021 renmingshuai <renmingshuai@huawei.com> - 4.4.2-9
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user