diff --git a/0001-Fix-hooks-directory.patch b/0001-Fix-hooks-directory.patch new file mode 100644 index 0000000..638aa91 --- /dev/null +++ b/0001-Fix-hooks-directory.patch @@ -0,0 +1,60 @@ +From a82663945fe1220a151f11283b34c4cb42cee778 Mon Sep 17 00:00:00 2001 +From: Felix Kaechele +Date: Sun, 17 Jun 2018 20:30:36 +0200 +Subject: [PATCH 1/3] Fix hooks directory + +Signed-off-by: Felix Kaechele +--- + 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 + diff --git a/0002-Fix-dns-pc-file.patch b/0002-Fix-dns-pc-file.patch new file mode 100644 index 0000000..0e442da --- /dev/null +++ b/0002-Fix-dns-pc-file.patch @@ -0,0 +1,23 @@ +From 76eb124d88c378e3259c437d55b328ed55befc60 Mon Sep 17 00:00:00 2001 +From: Felix Kaechele +Date: Sun, 17 Jun 2018 20:32:52 +0200 +Subject: [PATCH 2/3] Fix dns++ pc file + +Signed-off-by: Felix Kaechele +--- + 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 + diff --git a/0003-Remove-spurious-fi.patch b/0003-Remove-spurious-fi.patch new file mode 100644 index 0000000..8ea6130 --- /dev/null +++ b/0003-Remove-spurious-fi.patch @@ -0,0 +1,22 @@ +From ac5987d32c555a7515334abf7cab5dc40c4056f2 Mon Sep 17 00:00:00 2001 +From: Felix Kaechele +Date: Sun, 17 Jun 2018 20:33:48 +0200 +Subject: [PATCH 3/3] Remove spurious fi + +Signed-off-by: Felix Kaechele +--- + 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 + diff --git a/kea-1.3.0-hooksdir.patch b/kea-1.3.0-hooksdir.patch deleted file mode 100644 index 5d7dbd8..0000000 --- a/kea-1.3.0-hooksdir.patch +++ /dev/null @@ -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 = diff --git a/kea-ctrl-agent.service b/kea-ctrl-agent.service new file mode 100644 index 0000000..b5c860c --- /dev/null +++ b/kea-ctrl-agent.service @@ -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 diff --git a/kea-dhcp-ddns.service b/kea-dhcp-ddns.service new file mode 100644 index 0000000..5fdbe0b --- /dev/null +++ b/kea-dhcp-ddns.service @@ -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 diff --git a/kea-dhcp4.service b/kea-dhcp4.service new file mode 100644 index 0000000..0a72768 --- /dev/null +++ b/kea-dhcp4.service @@ -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 diff --git a/kea-dhcp6.service b/kea-dhcp6.service new file mode 100644 index 0000000..e1fc05a --- /dev/null +++ b/kea-dhcp6.service @@ -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 diff --git a/kea-openssl.patch b/kea-openssl.patch deleted file mode 100644 index 6dd4580..0000000 --- a/kea-openssl.patch +++ /dev/null @@ -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 diff --git a/kea-systemd.patch b/kea-systemd.patch deleted file mode 100644 index 1a188e1..0000000 --- a/kea-systemd.patch +++ /dev/null @@ -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 diff --git a/kea.spec b/kea.spec index 8209691..e3e19d3 100644 --- a/kea.spec +++ b/kea.spec @@ -1,19 +1,24 @@ #http://lists.fedoraproject.org/pipermail/devel/2011-August/155358.html %global _hardened_build 1 -### %define BETAVER beta2 -Summary: DHCPv4, DHCPv6 and DDNS server from ISC -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 +#%%global prever beta -# http://kea.isc.org/ticket/3529 -Patch0: kea-systemd.patch -Patch1: kea-1.3.0-hooksdir.patch -Patch2: kea-openssl.patch +Name: kea +Version: 1.5.0 +Release: 6%{?dist} +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 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 # headers nor configuration should be needed) BuildRequires: postgresql-server-devel +BuildRequires: libpq-devel %else # %%configure --with-dhcp-mysql BuildRequires: mariadb-devel @@ -37,18 +43,16 @@ BuildRequires: log4cplus-devel %ifnarch s390 %{mips} BuildRequires: valgrind-devel %endif -BuildRequires: systemd # src/lib/testutils/dhcp_test_lib.sh BuildRequires: procps-ng - -# %%configure --with-gtest -BuildRequires: gtest-devel - -# in case you ever wanted to use %%configure --enable-generate-parser -#BuildRequires: flex bison - +# %%configure --enable-generate-parser +BuildRequires: bison +BuildRequires: flex +# %%configure --enable-shell +BuildRequires: python3-devel # in case you ever wanted to use %%configure --enable-generate-docs #BuildRequires: elinks asciidoc plantuml +BuildRequires: systemd Requires: kea-libs%{?_isa} = %{version}-%{release} Requires(post): systemd @@ -57,29 +61,12 @@ Requires(postun): systemd %description -DHCP implementation from Internet Systems Consortium, Inc. -that features fully functional DHCPv4, DHCPv6 and Dynamic DNS servers. -Both DHCP servers fully support server discovery, -address assignment, renewal, rebinding and release. The DHCPv6 -server supports prefix delegation. Both servers support DNS Update -mechanism, using stand-alone DDNS daemon. +DHCP implementation from Internet Systems Consortium, Inc. that features fully +functional DHCPv4, DHCPv6 and Dynamic DNS servers. +Both DHCP servers fully support server discovery, address assignment, renewal, +rebinding and release. The DHCPv6 server supports prefix delegation. Both +servers support DNS Update 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 Summary: Development headers and libraries for Kea DHCP server @@ -92,48 +79,71 @@ Requires: pkgconfig %description devel 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 -%setup -q -n kea-%{version} -%patch0 -p1 -b .systemd -%patch1 -p1 -b .hooksdir -%patch2 -p1 -b .openssl +%autosetup -p1 -n kea-%{version}%{?prever:-%{prever}} + +# install leases db in /var/lib/kea/ not /var/kea/ +# 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) # https://sourceforge.net/p/flex/bugs/197 # https://lists.isc.org/pipermail/kea-dev/2016-January/000599.html sed -i -e 's|ECHO|YYECHO|g' src/lib/eval/lexer.cc + %build autoreconf --verbose --force --install export CXXFLAGS="%{optflags} -std=gnu++11 -Wno-deprecated-declarations" %configure \ --disable-dependency-tracking \ - --localstatedir=%{_sharedstatedir} \ --disable-rpath \ --disable-silent-rules \ --disable-static \ --enable-debug \ - --enable-systemd \ - --with-dhcp-mysql \ - --with-dhcp-pgsql \ + --enable-generate-parser \ + --enable-shell \ + --with-mysql \ + --with-pgsql \ --with-gnu-ld \ --with-log4cplus \ - --with-openssl \ -# --with-gtest + --with-openssl -make %{?_smp_mflags} +%make_build -%check -#make check - %install -make DESTDIR=%{buildroot} install %{?_smp_mflags} docdir=%{_pkgdocdir} +%make_install docdir=%{_pkgdocdir} # Get rid of .la files 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 mkdir -p %{buildroot}%{_sharedstatedir}/kea/ touch %{buildroot}%{_sharedstatedir}/kea/kea-leases4.csv @@ -155,41 +165,44 @@ EOF %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 -%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 -%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 %files +%license COPYING +%{_bindir}/kea-msg-compiler %{_sbindir}/kea-admin -%{_sbindir}/kea-dhcp-ddns +%{_sbindir}/keactrl +%{_sbindir}/kea-ctrl-agent %{_sbindir}/kea-dhcp4 %{_sbindir}/kea-dhcp6 +%{_sbindir}/kea-dhcp-ddns %{_sbindir}/kea-lfc -%{_sbindir}/keactrl +%{_sbindir}/kea-shell %{_sbindir}/perfdhcp -%{_bindir}/kea-msg-compiler -%{_sbindir}/kea-ctrl-agent +%{_unitdir}/kea-ctrl-agent.service %{_unitdir}/kea-dhcp4.service %{_unitdir}/kea-dhcp6.service %{_unitdir}/kea-dhcp-ddns.service %dir %{_sysconfdir}/kea/ +%config(noreplace) %{_sysconfdir}/kea/keactrl.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/ %{_datarootdir}/kea/scripts %{_datarootdir}/kea/yang -%dir /run/kea/ -%{_tmpfilesdir}/kea.conf %dir %{_sharedstatedir}/kea %config(noreplace) %{_sharedstatedir}/kea/kea-leases4.csv %config(noreplace) %{_sharedstatedir}/kea/kea-leases6.csv @@ -200,36 +213,89 @@ EOF %{_pkgdocdir}/kea-guide.* %{_pkgdocdir}/kea-logo-100x70.png %{_pkgdocdir}/kea-messages.html +%{python3_sitelib}/%{name} %{_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-dhcp6.8.gz +%{_mandir}/man8/kea-dhcp-ddns.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/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 %dir %{_libdir}/%{name} %{_libdir}/%{name}/hooks %files libs -#%%dir %%{_pkgdocdir}/ -#%%{_pkgdocdir}/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 -* Fri Feb 01 2019 Fedora Release Engineering - 1.5.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild -* Tue Jan 29 2019 Jonathan Wakely - 1.5.0-4 -- Rebuilt for Boost 1.69 +* Wed May 22 2019 Felix Kaechele - 1.5.0-4 +- 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 - 1.5.0-3 - Update to released version @@ -408,3 +474,4 @@ EOF * Thu Aug 14 2014 Jiri Popelka - 0.9-0.1.beta1 - initial spec +