Rebase with Felix Kaechele patches applied (#1699408)

This commit is contained in:
Pavel Zhukov 2019-05-23 11:48:59 +02:00
parent 9863a6b4c3
commit 318cad443b
11 changed files with 307 additions and 295 deletions

View File

@ -0,0 +1,60 @@
From a82663945fe1220a151f11283b34c4cb42cee778 Mon Sep 17 00:00:00 2001
From: Felix Kaechele <felix@kaechele.ca>
Date: Sun, 17 Jun 2018 20:30:36 +0200
Subject: [PATCH 1/3] Fix hooks directory
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
---
src/hooks/dhcp/high_availability/Makefile.am | 4 ++--
src/hooks/dhcp/lease_cmds/Makefile.am | 4 ++--
src/hooks/dhcp/stat_cmds/Makefile.am | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/hooks/dhcp/high_availability/Makefile.am b/src/hooks/dhcp/high_availability/Makefile.am
index 8550cca..ffba51c 100644
--- a/src/hooks/dhcp/high_availability/Makefile.am
+++ b/src/hooks/dhcp/high_availability/Makefile.am
@@ -43,8 +43,8 @@ nodist_libha_la_SOURCES = ha_messages.cc ha_messages.h
libha_la_CXXFLAGS = $(AM_CXXFLAGS)
libha_la_CPPFLAGS = $(AM_CPPFLAGS)
-# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_ha.la
libdhcp_ha_la_SOURCES =
diff --git a/src/hooks/dhcp/lease_cmds/Makefile.am b/src/hooks/dhcp/lease_cmds/Makefile.am
index 841298f..d328255 100644
--- a/src/hooks/dhcp/lease_cmds/Makefile.am
+++ b/src/hooks/dhcp/lease_cmds/Makefile.am
@@ -36,8 +36,8 @@ nodist_liblease_cmds_la_SOURCES = lease_cmds_messages.cc lease_cmds_messages.h
liblease_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
liblease_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
-# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_lease_cmds.la
libdhcp_lease_cmds_la_SOURCES =
diff --git a/src/hooks/dhcp/stat_cmds/Makefile.am b/src/hooks/dhcp/stat_cmds/Makefile.am
index e6ff587..ccfc3ad 100644
--- a/src/hooks/dhcp/stat_cmds/Makefile.am
+++ b/src/hooks/dhcp/stat_cmds/Makefile.am
@@ -35,8 +35,8 @@ nodist_libstat_cmds_la_SOURCES = stat_cmds_messages.cc stat_cmds_messages.h
libstat_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
libstat_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
-# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_stat_cmds.la
libdhcp_stat_cmds_la_SOURCES =
--
2.19.2

View File

@ -0,0 +1,23 @@
From 76eb124d88c378e3259c437d55b328ed55befc60 Mon Sep 17 00:00:00 2001
From: Felix Kaechele <felix@kaechele.ca>
Date: Sun, 17 Jun 2018 20:32:52 +0200
Subject: [PATCH 2/3] Fix dns++ pc file
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
---
dns++.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dns++.pc.in b/dns++.pc.in
index ef65c7e..399a0eb 100644
--- a/dns++.pc.in
+++ b/dns++.pc.in
@@ -8,4 +8,4 @@ Description: BIND 10 DNS library
Version: @PACKAGE_VERSION@
Requires: @CRYPTO_PACKAGE@
Cflags: -I${includedir}/@PACKAGE_NAME@
-Libs: -L${libdir} -lb10-dns++ -lb10-cryptolink -lb10-util -lb10-exceptions -lm
+Libs: -L${libdir} -lkea-dns++ -lkea-cryptolink -lkea-util -lkea-exceptions -lm
--
2.19.2

View File

@ -0,0 +1,22 @@
From ac5987d32c555a7515334abf7cab5dc40c4056f2 Mon Sep 17 00:00:00 2001
From: Felix Kaechele <felix@kaechele.ca>
Date: Sun, 17 Jun 2018 20:33:48 +0200
Subject: [PATCH 3/3] Remove spurious fi
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
---
src/bin/keactrl/keactrl.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in
index 9869bc3..a229c68 100644
--- a/src/bin/keactrl/keactrl.in
+++ b/src/bin/keactrl/keactrl.in
@@ -549,4 +549,3 @@ ${args}" 1
log_error "Invalid command: ${command}."
exit 1 ;;
esac
-fi
--
2.19.2

View File

@ -1,39 +0,0 @@
diff --git a/src/hooks/dhcp/lease_cmds/Makefile.am b/src/hooks/dhcp/lease_cmds/Makefile.am
index 2c36689..fb6365e 100644
--- a/src/hooks/dhcp/lease_cmds/Makefile.am
+++ b/src/hooks/dhcp/lease_cmds/Makefile.am
@@ -36,7 +36,7 @@ liblease_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
liblease_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_lease_cmds.la
libdhcp_lease_cmds_la_SOURCES =
diff --git a/src/hooks/dhcp/high_availability/Makefile.am b/src/hooks/dhcp/high_availability/Makefile.am
index 8550cca..a4f1124 100644
--- a/src/hooks/dhcp/high_availability/Makefile.am
+++ b/src/hooks/dhcp/high_availability/Makefile.am
@@ -44,7 +44,7 @@ libha_la_CXXFLAGS = $(AM_CXXFLAGS)
libha_la_CPPFLAGS = $(AM_CPPFLAGS)
# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_ha.la
libdhcp_ha_la_SOURCES =
diff --git a/src/hooks/dhcp/stat_cmds/Makefile.am b/src/hooks/dhcp/stat_cmds/Makefile.am
index e6ff587..0fcc578 100644
--- a/src/hooks/dhcp/stat_cmds/Makefile.am
+++ b/src/hooks/dhcp/stat_cmds/Makefile.am
@@ -36,7 +36,7 @@ libstat_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
libstat_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_stat_cmds.la
libdhcp_stat_cmds_la_SOURCES =

13
kea-ctrl-agent.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Kea Control Agent
Documentation=man:kea-ctrl-agent(8)
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStart=/usr/sbin/kea-ctrl-agent -c /etc/kea/kea-ctrl-agent.conf
Environment=KEA_PIDFILE_DIR=/var/run/kea
[Install]
WantedBy=multi-user.target

13
kea-dhcp-ddns.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Kea DHCP-DDNS Server
Documentation=man:kea-dhcp-ddns(8)
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStart=/usr/sbin/kea-dhcp-ddns -c /etc/kea/kea-dhcp-ddns.conf
Environment=KEA_PIDFILE_DIR=/var/run/kea
[Install]
WantedBy=multi-user.target

13
kea-dhcp4.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Kea DHCPv4 Server
Documentation=man:kea-dhcp4(8)
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStart=/usr/sbin/kea-dhcp4 -c /etc/kea/kea-dhcp4.conf
Environment=KEA_PIDFILE_DIR=/var/run/kea
[Install]
WantedBy=multi-user.target

13
kea-dhcp6.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Kea DHCPv6 Server
Documentation=man:kea-dhcp6(8)
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
ExecStart=/usr/sbin/kea-dhcp6 -c /etc/kea/kea-dhcp6.conf
Environment=KEA_PIDFILE_DIR=/var/run/kea
[Install]
WantedBy=multi-user.target

View File

@ -1,13 +0,0 @@
diff --git a/m4macros/ax_crypto.m4 b/m4macros/ax_crypto.m4
index dd4a81f..04dd2c8 100644
--- a/m4macros/ax_crypto.m4
+++ b/m4macros/ax_crypto.m4
@@ -284,7 +284,7 @@ then
else
CRYPTO_NAME="OpenSSL"
DISABLED_CRYPTO="Botan"
- CRYPTO_PACKAGE="openssl-1.1.0"
+ CRYPTO_PACKAGE="openssl"
AC_DEFINE_UNQUOTED([WITH_OPENSSL], [], [Compile with OpenSSL crypto])
AC_MSG_CHECKING(for OpenSSL library)
# from bind9

View File

@ -1,160 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 46780d5..43c57b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1152,6 +1152,18 @@ if test "x$VALGRIND" != "xno"; then
found_valgrind="found"
fi
+AC_ARG_ENABLE([systemd],
+ AS_HELP_STRING([--enable-systemd], [enable systemd support]),
+ [use_systemd=$enableval], [use_systemd=no])
+AM_CONDITIONAL(USE_SYSTEMD, test "x$use_systemd" != "xno")
+AC_SUBST(USE_SYSTEMD)
+
+AC_ARG_WITH([systemd-unitdir],
+ AS_HELP_STRING([--with-systemd-unitdir=PATH],
+ [specify exact directory for systemd service files, defaults to PREFIX/lib/systemd/system/]),
+ [SYSTEMD_UNITDIR=$withval], [SYSTEMD_UNITDIR="${prefix}/lib/systemd/system"])
+AC_SUBST(SYSTEMD_UNITDIR)
+
# Check for optreset in unistd.h. On BSD systems the optreset is
# used to reset the state of getopt() function. Resetting its state
# is required if command line arguments are parsed multiple times
diff --git a/tools/path_replacer.sh.in b/tools/path_replacer.sh.in
index f444afc..2ce8b3b 100644
--- a/tools/path_replacer.sh.in
+++ b/tools/path_replacer.sh.in
@@ -19,12 +19,14 @@
prefix=@prefix@
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
+sbindir=@sbindir@
echo "Replacing \@prefix\@ with ${prefix}"
echo "Replacing \@sysconfdir\@ with ${sysconfdir}"
echo "Replacing \@localstatedir\@ with ${localstatedir}"
+echo "Replacing \@sbindir\@ with ${sbindir}"
echo "Input file: $1"
echo "Output file: $2"
-sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g" $1 > $2
+sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g; s@SEP@\@sbindir\@@SEP@${sbindir}@SEP@g" $1 > $2
diff --git a/src/bin/keactrl/kea-dhcp-ddns.service.in b/src/bin/keactrl/kea-dhcp-ddns.service.in
new file mode 100644
index 0000000..d1e0526
--- /dev/null
+++ b/src/bin/keactrl/kea-dhcp-ddns.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Kea DHCP-DDNS Server
+Documentation=man:kea-dhcp-ddns(8)
+Wants=network-online.target
+After=network-online.target
+After=time-sync.target
+
+[Service]
+ExecStart=@sbindir@/kea-dhcp-ddns -c @sysconfdir@/kea/kea-dhcp-ddns.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/src/bin/keactrl/kea-dhcp4.service.in b/src/bin/keactrl/kea-dhcp4.service.in
new file mode 100644
index 0000000..80977d6
--- /dev/null
+++ b/src/bin/keactrl/kea-dhcp4.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Kea DHCPv4 Server
+Documentation=man:kea-dhcp4(8)
+Wants=network-online.target
+After=network-online.target
+After=time-sync.target
+
+[Service]
+ExecStart=@sbindir@/kea-dhcp4 -c @sysconfdir@/kea/kea-dhcp4.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/src/bin/keactrl/kea-dhcp6.service.in b/src/bin/keactrl/kea-dhcp6.service.in
new file mode 100644
index 0000000..c24f584
--- /dev/null
+++ b/src/bin/keactrl/kea-dhcp6.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Kea DHCPv6 Server
+Documentation=man:kea-dhcp6(8)
+Wants=network-online.target
+After=network-online.target
+After=time-sync.target
+
+[Service]
+ExecStart=@sbindir@/kea-dhcp6 -c @sysconfdir@/kea/kea-dhcp6.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am
index 9eb3da9..b556fcc 100644
--- a/src/bin/keactrl/Makefile.am
+++ b/src/bin/keactrl/Makefile.am
@@ -60,6 +62,31 @@ if INSTALL_CONFIGURATIONS
# To preserve any user modifications to the old version of the file,
# this old file is backed up as keactrl.conf.bak.
install-data-local:
+INSTALL_TARGETS += install-config-files
+
+endif
+
+if USE_SYSTEMD
+
+EXTRA_DIST += kea-dhcp4.service.in kea-dhcp6.service.in kea-dhcp-ddns.service.in
+DISTCLEANFILES += kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service
+BUILT_SOURCES += kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service
+INSTALL_TARGETS += install-systemd-files
+
+endif
+
+kea-dhcp4.service: kea-dhcp4.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+kea-dhcp6.service: kea-dhcp6.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+kea-dhcp-ddns.service: kea-dhcp-ddns.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+install-empty:
+
+install-config-files:
$(mkinstalldirs) $(DESTDIR)/@sysconfdir@/@PACKAGE@
for f in $(CONFIGFILES) ; do \
if test -f $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f && \
@@ -72,4 +99,12 @@ install-data-local:
fi; \
done
-endif
+install-systemd-files:
+ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNITDIR)
+ $(INSTALL_DATA) kea-dhcp4.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp4.service
+ $(INSTALL_DATA) kea-dhcp6.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp6.service
+ $(INSTALL_DATA) kea-dhcp-ddns.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp-ddns.service
+
+install-data-local: $(INSTALL_TARGETS)
+
+uninstall-local: $(UNINSTALL_TARGETS)
diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am
index 4d29c4d..7da0912 100644
--- a/src/bin/keactrl/Makefile.am
+++ b/src/bin/keactrl/Makefile.am
@@ -55,6 +55,8 @@ kea-netconf.conf: kea-netconf.conf.pre
$(top_builddir)/tools/path_replacer.sh \
$(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@
+INSTALL_TARGETS = install-empty
+
if INSTALL_CONFIGURATIONS
# Since Kea 1.3.0 release we have 4 different Kea configuration files

233
kea.spec
View File

@ -1,19 +1,24 @@
#http://lists.fedoraproject.org/pipermail/devel/2011-August/155358.html #http://lists.fedoraproject.org/pipermail/devel/2011-August/155358.html
%global _hardened_build 1 %global _hardened_build 1
### %define BETAVER beta2
Summary: DHCPv4, DHCPv6 and DDNS server from ISC #%%global prever beta
Name: kea
Version: 1.5.0
Release: 5%{?dist}
License: MPLv2.0 and Boost
URL: http://kea.isc.org
Source0: http://ftp.isc.org/isc/kea/%{version}/kea-%{version}.tar.gz
# http://kea.isc.org/ticket/3529 Name: kea
Patch0: kea-systemd.patch Version: 1.5.0
Patch1: kea-1.3.0-hooksdir.patch Release: 6%{?dist}
Patch2: kea-openssl.patch Summary: DHCPv4, DHCPv6 and DDNS server from ISC
License: MPLv2.0 and Boost
URL: http://kea.isc.org
Source0: https://ftp.isc.org/isc/kea/%{version}%{?prever:-%{prever}}/kea-%{version}%{?prever:-%{prever}}.tar.gz
Source1: kea-dhcp4.service
Source2: kea-dhcp6.service
Source3: kea-dhcp-ddns.service
Source4: kea-ctrl-agent.service
Patch0: 0001-Fix-hooks-directory.patch
Patch1: 0002-Fix-dns-pc-file.patch
Patch2: 0003-Remove-spurious-fi.patch
# autoreconf # autoreconf
BuildRequires: autoconf automake libtool BuildRequires: autoconf automake libtool
@ -27,6 +32,7 @@ BuildRequires: mariadb-connector-c-devel
# TODO: propose upstream fix so this is not needed (no server-side related # TODO: propose upstream fix so this is not needed (no server-side related
# headers nor configuration should be needed) # headers nor configuration should be needed)
BuildRequires: postgresql-server-devel BuildRequires: postgresql-server-devel
BuildRequires: libpq-devel
%else %else
# %%configure --with-dhcp-mysql # %%configure --with-dhcp-mysql
BuildRequires: mariadb-devel BuildRequires: mariadb-devel
@ -37,18 +43,16 @@ BuildRequires: log4cplus-devel
%ifnarch s390 %{mips} %ifnarch s390 %{mips}
BuildRequires: valgrind-devel BuildRequires: valgrind-devel
%endif %endif
BuildRequires: systemd
# src/lib/testutils/dhcp_test_lib.sh # src/lib/testutils/dhcp_test_lib.sh
BuildRequires: procps-ng BuildRequires: procps-ng
# %%configure --enable-generate-parser
# %%configure --with-gtest BuildRequires: bison
BuildRequires: gtest-devel BuildRequires: flex
# %%configure --enable-shell
# in case you ever wanted to use %%configure --enable-generate-parser BuildRequires: python3-devel
#BuildRequires: flex bison
# in case you ever wanted to use %%configure --enable-generate-docs # in case you ever wanted to use %%configure --enable-generate-docs
#BuildRequires: elinks asciidoc plantuml #BuildRequires: elinks asciidoc plantuml
BuildRequires: systemd
Requires: kea-libs%{?_isa} = %{version}-%{release} Requires: kea-libs%{?_isa} = %{version}-%{release}
Requires(post): systemd Requires(post): systemd
@ -57,29 +61,12 @@ Requires(postun): systemd
%description %description
DHCP implementation from Internet Systems Consortium, Inc. DHCP implementation from Internet Systems Consortium, Inc. that features fully
that features fully functional DHCPv4, DHCPv6 and Dynamic DNS servers. functional DHCPv4, DHCPv6 and Dynamic DNS servers.
Both DHCP servers fully support server discovery, Both DHCP servers fully support server discovery, address assignment, renewal,
address assignment, renewal, rebinding and release. The DHCPv6 rebinding and release. The DHCPv6 server supports prefix delegation. Both
server supports prefix delegation. Both servers support DNS Update servers support DNS Update mechanism, using stand-alone DDNS daemon.
mechanism, using stand-alone DDNS daemon.
%package libs
Summary: Shared libraries used by Kea DHCP server
%description libs
This package contains shared libraries used by Kea DHCP server.
%package hooks
Summary: Hooks libraries for kea
Requires: kea-libs%{?_isa} = %{version}-%{release}
%description hooks
Hooking mechanism allow Kea to load one
or more dynamically-linked libraries (known as "hooks libraries")
and, at various points in its processing ("hook points"), call
functions in them. Those functions perform whatever custom
processing is required.
%package devel %package devel
Summary: Development headers and libraries for Kea DHCP server Summary: Development headers and libraries for Kea DHCP server
@ -92,48 +79,71 @@ Requires: pkgconfig
%description devel %description devel
Header files and API documentation. Header files and API documentation.
%package hooks
Summary: Hooks libraries for kea
Requires: kea-libs%{?_isa} = %{version}-%{release}
%description hooks
Hooking mechanism allow Kea to load one or more dynamically-linked libraries
(known as "hooks libraries") and, at various points in its processing
("hook points"), call functions in them. Those functions perform whatever
custom processing is required.
%package libs
Summary: Shared libraries used by Kea DHCP server
%description libs
This package contains shared libraries used by Kea DHCP server.
%prep %prep
%setup -q -n kea-%{version} %autosetup -p1 -n kea-%{version}%{?prever:-%{prever}}
%patch0 -p1 -b .systemd
%patch1 -p1 -b .hooksdir # install leases db in /var/lib/kea/ not /var/kea/
%patch2 -p1 -b .openssl # http://kea.isc.org/ticket/3523
sed -i -e 's|@localstatedir@|@sharedstatedir@|g' src/lib/dhcpsrv/Makefile.am
# to be able to build on ppc64(le) # to be able to build on ppc64(le)
# https://sourceforge.net/p/flex/bugs/197 # https://sourceforge.net/p/flex/bugs/197
# https://lists.isc.org/pipermail/kea-dev/2016-January/000599.html # https://lists.isc.org/pipermail/kea-dev/2016-January/000599.html
sed -i -e 's|ECHO|YYECHO|g' src/lib/eval/lexer.cc sed -i -e 's|ECHO|YYECHO|g' src/lib/eval/lexer.cc
%build %build
autoreconf --verbose --force --install autoreconf --verbose --force --install
export CXXFLAGS="%{optflags} -std=gnu++11 -Wno-deprecated-declarations" export CXXFLAGS="%{optflags} -std=gnu++11 -Wno-deprecated-declarations"
%configure \ %configure \
--disable-dependency-tracking \ --disable-dependency-tracking \
--localstatedir=%{_sharedstatedir} \
--disable-rpath \ --disable-rpath \
--disable-silent-rules \ --disable-silent-rules \
--disable-static \ --disable-static \
--enable-debug \ --enable-debug \
--enable-systemd \ --enable-generate-parser \
--with-dhcp-mysql \ --enable-shell \
--with-dhcp-pgsql \ --with-mysql \
--with-pgsql \
--with-gnu-ld \ --with-gnu-ld \
--with-log4cplus \ --with-log4cplus \
--with-openssl \ --with-openssl
# --with-gtest
make %{?_smp_mflags} %make_build
%check
#make check
%install %install
make DESTDIR=%{buildroot} install %{?_smp_mflags} docdir=%{_pkgdocdir} %make_install docdir=%{_pkgdocdir}
# Get rid of .la files # Get rid of .la files
find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot} -type f -name "*.la" -delete -print
# Install systemd units
install -Dpm 0644 %{S:1} %{buildroot}%{_unitdir}/kea-dhcp4.service
install -Dpm 0644 %{S:2} %{buildroot}%{_unitdir}/kea-dhcp6.service
install -Dpm 0644 %{S:3} %{buildroot}%{_unitdir}/kea-dhcp-ddns.service
install -Dpm 0644 %{S:4} %{buildroot}%{_unitdir}/kea-ctrl-agent.service
# Start empty lease databases # Start empty lease databases
mkdir -p %{buildroot}%{_sharedstatedir}/kea/ mkdir -p %{buildroot}%{_sharedstatedir}/kea/
touch %{buildroot}%{_sharedstatedir}/kea/kea-leases4.csv touch %{buildroot}%{_sharedstatedir}/kea/kea-leases4.csv
@ -155,41 +165,44 @@ EOF
%post %post
%systemd_post kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service %systemd_post kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service kea-ctrl-agent.service
%preun %preun
%systemd_preun kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service %systemd_preun kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service kea-ctrl-agent.service
%postun %postun
%systemd_postun_with_restart kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service %systemd_postun_with_restart kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service kea-ctrl-agent.service
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%files %files
%license COPYING
%{_bindir}/kea-msg-compiler
%{_sbindir}/kea-admin %{_sbindir}/kea-admin
%{_sbindir}/kea-dhcp-ddns %{_sbindir}/keactrl
%{_sbindir}/kea-ctrl-agent
%{_sbindir}/kea-dhcp4 %{_sbindir}/kea-dhcp4
%{_sbindir}/kea-dhcp6 %{_sbindir}/kea-dhcp6
%{_sbindir}/kea-dhcp-ddns
%{_sbindir}/kea-lfc %{_sbindir}/kea-lfc
%{_sbindir}/keactrl %{_sbindir}/kea-shell
%{_sbindir}/perfdhcp %{_sbindir}/perfdhcp
%{_bindir}/kea-msg-compiler %{_unitdir}/kea-ctrl-agent.service
%{_sbindir}/kea-ctrl-agent
%{_unitdir}/kea-dhcp4.service %{_unitdir}/kea-dhcp4.service
%{_unitdir}/kea-dhcp6.service %{_unitdir}/kea-dhcp6.service
%{_unitdir}/kea-dhcp-ddns.service %{_unitdir}/kea-dhcp-ddns.service
%dir %{_sysconfdir}/kea/ %dir %{_sysconfdir}/kea/
%config(noreplace) %{_sysconfdir}/kea/keactrl.conf
%config(noreplace) %{_sysconfdir}/kea/kea-ctrl-agent.conf %config(noreplace) %{_sysconfdir}/kea/kea-ctrl-agent.conf
%config(noreplace) %{_sysconfdir}/kea/kea*.conf %config(noreplace) %{_sysconfdir}/kea/kea-dhcp6.conf
%config(noreplace) %{_sysconfdir}/kea/kea-dhcp4.conf
%config(noreplace) %{_sysconfdir}/kea/kea-dhcp-ddns.conf
%config(noreplace) %{_sysconfdir}/kea/kea-netconf.conf
%dir %{_datarootdir}/kea/ %dir %{_datarootdir}/kea/
%{_datarootdir}/kea/scripts %{_datarootdir}/kea/scripts
%{_datarootdir}/kea/yang %{_datarootdir}/kea/yang
%dir /run/kea/
%{_tmpfilesdir}/kea.conf
%dir %{_sharedstatedir}/kea %dir %{_sharedstatedir}/kea
%config(noreplace) %{_sharedstatedir}/kea/kea-leases4.csv %config(noreplace) %{_sharedstatedir}/kea/kea-leases4.csv
%config(noreplace) %{_sharedstatedir}/kea/kea-leases6.csv %config(noreplace) %{_sharedstatedir}/kea/kea-leases6.csv
@ -200,36 +213,89 @@ EOF
%{_pkgdocdir}/kea-guide.* %{_pkgdocdir}/kea-guide.*
%{_pkgdocdir}/kea-logo-100x70.png %{_pkgdocdir}/kea-logo-100x70.png
%{_pkgdocdir}/kea-messages.html %{_pkgdocdir}/kea-messages.html
%{python3_sitelib}/%{name}
%{_mandir}/man8/kea-admin.8.gz %{_mandir}/man8/kea-admin.8.gz
%{_mandir}/man8/kea-dhcp-ddns.8.gz %{_mandir}/man8/keactrl.8.gz
%{_mandir}/man8/kea-ctrl-agent.8.gz
%{_mandir}/man8/kea-dhcp4.8.gz %{_mandir}/man8/kea-dhcp4.8.gz
%{_mandir}/man8/kea-dhcp6.8.gz %{_mandir}/man8/kea-dhcp6.8.gz
%{_mandir}/man8/kea-dhcp-ddns.8.gz
%{_mandir}/man8/kea-lfc.8.gz %{_mandir}/man8/kea-lfc.8.gz
%{_mandir}/man8/keactrl.8.gz %{_mandir}/man8/kea-shell.8.gz
%{_mandir}/man8/perfdhcp.8.gz %{_mandir}/man8/perfdhcp.8.gz
%{_mandir}/man8/kea-ctrl-agent.8.gz %dir /run/kea/
%{_tmpfilesdir}/kea.conf
%files devel
%license COPYING
%{_includedir}/kea
%{_libdir}/libkea-asiodns.so
%{_libdir}/libkea-asiolink.so
%{_libdir}/libkea-cc.so
%{_libdir}/libkea-cfgclient.so
%{_libdir}/libkea-cryptolink.so
%{_libdir}/libkea-database.so
%{_libdir}/libkea-dhcp_ddns.so
%{_libdir}/libkea-dhcp++.so
%{_libdir}/libkea-dhcpsrv.so
%{_libdir}/libkea-dns++.so
%{_libdir}/libkea-eval.so
%{_libdir}/libkea-exceptions.so
%{_libdir}/libkea-hooks.so
%{_libdir}/libkea-http.so
%{_libdir}/libkea-log.so
%{_libdir}/libkea-mysql.so
%{_libdir}/libkea-pgsql.so
%{_libdir}/libkea-process.so
%{_libdir}/libkea-stats.so
%{_libdir}/libkea-threads.so
%{_libdir}/libkea-util-io.so
%{_libdir}/libkea-util.so
%{_libdir}/pkgconfig/dns++.pc
%files hooks %files hooks
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%{_libdir}/%{name}/hooks %{_libdir}/%{name}/hooks
%files libs %files libs
#%%dir %%{_pkgdocdir}/
#%%{_pkgdocdir}/COPYING
%license COPYING %license COPYING
%{_libdir}/libkea-*.so.* %{_libdir}/libkea-asiodns.so.*
%{_libdir}/libkea-asiolink.so.*
%{_libdir}/libkea-cc.so.*
%{_libdir}/libkea-cfgclient.so.*
%{_libdir}/libkea-cryptolink.so.*
%{_libdir}/libkea-database.so.*
%{_libdir}/libkea-dhcp_ddns.so.*
%{_libdir}/libkea-dhcp++.so.*
%{_libdir}/libkea-dhcpsrv.so.*
%{_libdir}/libkea-dns++.so.*
%{_libdir}/libkea-eval.so.*
%{_libdir}/libkea-exceptions.so.*
%{_libdir}/libkea-hooks.so.*
%{_libdir}/libkea-http.so.*
%{_libdir}/libkea-log.so.*
%{_libdir}/libkea-mysql.so.*
%{_libdir}/libkea-pgsql.so.*
%{_libdir}/libkea-process.so.*
%{_libdir}/libkea-stats.so.*
%{_libdir}/libkea-threads.so.*
%{_libdir}/libkea-util-io.so.*
%{_libdir}/libkea-util.so.*
%files devel
%{_includedir}/kea
%{_libdir}/libkea-*.so
%{_libdir}/pkgconfig/dns++.pc
%changelog %changelog
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jan 29 2019 Jonathan Wakely <jwakely@redhat.com> - 1.5.0-4 * Wed May 22 2019 Felix Kaechele <heffer@fedoraproject.org> - 1.5.0-4
- Rebuilt for Boost 1.69 - Update to 1.3.0 release version
- fix PID file path in service files
- clean up spec file
- switched to openssl-devel, now builds with openssl 1.1
- install systemd units manually instead of patching the souce to do it
- enable kea-shell
- add boost patch
- add kea-ctrl-agent unit
- change postgresql-devel to postgresql-server-devel
- update to 1.4.0
* Sun Dec 16 2018 Pavel Zhukov <pzhukov@redhat.com> - 1.5.0-3 * Sun Dec 16 2018 Pavel Zhukov <pzhukov@redhat.com> - 1.5.0-3
- Update to released version - Update to released version
@ -408,3 +474,4 @@ EOF
* Thu Aug 14 2014 Jiri Popelka <jpopelka@redhat.com> - 0.9-0.1.beta1 * Thu Aug 14 2014 Jiri Popelka <jpopelka@redhat.com> - 0.9-0.1.beta1
- initial spec - initial spec