From cce4c5db0b17915c45ee1d7cd592c7eaea36d0b7 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Aug 20 2014 10:05:46 +0000 Subject: initial import --- diff --git a/.gitignore b/.gitignore index e69de29..3ae6c2f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/kea-0.9-beta1.tar.gz diff --git a/kea-LT_INIT.patch b/kea-LT_INIT.patch new file mode 100644 index 0000000..ef80d21 --- /dev/null +++ b/kea-LT_INIT.patch @@ -0,0 +1,27 @@ +From 6074b8696f4196fc0a88994ff9f210f54ae4cebf Mon Sep 17 00:00:00 2001 +From: Jiri Popelka +Date: Mon, 18 Aug 2014 12:30:24 +0200 +Subject: [PATCH] configure.ac: AC_PROG_LIBTOOL is deprecated in favor of + LT_INIT + +http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index f0dbc4f..43d7b29 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -79,7 +79,7 @@ CFLAGS_SAVED=$CFLAGS + CXXFLAGS_SAVED=$CXXFLAGS + CFLAGS="$CFLAGS $CXX_LIBTOOL_LDFLAGS" + CXXFLAGS="$CXXFLAGS $CXX_LIBTOOL_LDFLAGS" +-AC_PROG_LIBTOOL ++LT_INIT + CFLAGS=$CFLAGS_SAVED + CXXFLAGS=$CXXFLAGS_SAVED + +-- +1.9.3 + diff --git a/kea-data-dir.patch b/kea-data-dir.patch new file mode 100644 index 0000000..a0b41ce --- /dev/null +++ b/kea-data-dir.patch @@ -0,0 +1,53 @@ +From 6ea5ca336d9ea548c0a0fdb78d7db4f8f91b1670 Mon Sep 17 00:00:00 2001 +From: Jiri Popelka +Date: Fri, 15 Aug 2014 15:15:32 +0200 +Subject: [PATCH] lib/dhcpsrv Makefile.am: move dhcp_data_dir @localstatedir@ + -> @sharedstatedir@ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On Fedora @localstatedir@ resolves to /var/ and @sharedstatedir@ to /var/lib/. + +FHS says [1] that: +"Applications must generally not add directories to the top level of /var. +Such directories should only be added if they have some system-wide implication, +and in consultation with the FHS mailing list." + +From GNU Coding Standards [2]: +‘sharedstatedir’ + The directory for installing architecture-independent data files +which the programs modify while they run. This should normally be +/usr/local/com, but write it as $(prefix)/com. (If you are using +Autoconf, write it as ‘@sharedstatedir@’.) + +‘localstatedir’ + The directory for installing data files which the programs modify +while they run, and that pertain to one specific machine. Users should +never need to modify files in this directory to configure the package’s +operation; put such configuration information in separate files that go +in $(datadir) or $(sysconfdir). $(localstatedir) should normally be +/usr/local/var, but write it as $(prefix)/var. (If you are using +Autoconf, write it as ‘@localstatedir@’.) + +[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#THEVARHIERARCHY +[2] https://www.gnu.org/prep/standards/html_node/Directory-Variables.html +--- + src/lib/dhcpsrv/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am +index b10d269..0adc408 100644 +--- a/src/lib/dhcpsrv/Makefile.am ++++ b/src/lib/dhcpsrv/Makefile.am +@@ -1,6 +1,6 @@ + SUBDIRS = . testutils tests + +-dhcp_data_dir = @localstatedir@/@PACKAGE@ ++dhcp_data_dir = @sharedstatedir@/@PACKAGE@ + + AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib -DDHCP_DATA_DIR="\"$(dhcp_data_dir)\"" + AM_CPPFLAGS += -DTOP_BUILDDIR="\"$(top_builddir)\"" +-- +1.9.3 + diff --git a/kea-dhcp-ddns.service b/kea-dhcp-ddns.service new file mode 100644 index 0000000..1eb8d64 --- /dev/null +++ b/kea-dhcp-ddns.service @@ -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=/usr/sbin/kea-dhcp-ddns -c /etc/kea/dhcp-ddns.json + +[Install] +WantedBy=multi-user.target diff --git a/kea-dhcp4.service b/kea-dhcp4.service new file mode 100644 index 0000000..07c3e16 --- /dev/null +++ b/kea-dhcp4.service @@ -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=/usr/sbin/kea-dhcp4 -c /etc/kea/dhcp4.json + +[Install] +WantedBy=multi-user.target diff --git a/kea-dhcp6.service b/kea-dhcp6.service new file mode 100644 index 0000000..509b633 --- /dev/null +++ b/kea-dhcp6.service @@ -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=/usr/sbin/kea-dhcp6 -c /etc/kea/dhcp6.json + +[Install] +WantedBy=multi-user.target diff --git a/kea-narrowing.patch b/kea-narrowing.patch new file mode 100644 index 0000000..a9b7aef --- /dev/null +++ b/kea-narrowing.patch @@ -0,0 +1,65 @@ +From df9dd617ad22c15bf80f6e651a977388b86674a6 Mon Sep 17 00:00:00 2001 +From: Jiri Popelka +Date: Mon, 18 Aug 2014 14:05:02 +0200 +Subject: [PATCH] lib/util/encode/binary_from_base*.h: fix narrowing conversion + +build log (arch=armv7): +/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib -I../../../src/lib/util -I../../../src/lib/util -I../../../src/lib/exceptions -I../../../src/lib/exceptions -DOS_LINUX -I../../../ext/asio -I../../../ext/coroutine -DASIO_DISABLE_THREADS=1 -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Werror -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -c -o base_n.lo ./encode/base_n.cc +In file included from encode/base_n.cc:16:0: +../../../src/lib/util/encode/binary_from_base32hex.h: In instantiation of 'CharType boost::archive::iterators::detail::to_5_bit::operator()(CharType) const [with CharType = char]': +/usr/include/boost/iterator/transform_iterator.hpp:121:31: required from 'typename boost::detail::transform_iterator_base::type::reference boost::transform_iterator::dereference() const [with UnaryFunc = boost::archive::iterators::detail::to_5_bit; Iterator = isc::util::encode::{anonymous}::DecodeNormalizer; Reference = boost::use_default; Value = boost::use_default; typename boost::detail::transform_iterator_base::type::reference = char]' +encode/base_n.cc:376:9: required from 'static void isc::util::encode::{anonymous}::BaseNTransformer::decode(const char*, const string&, std::vector&) [with int BitsPerChunk = 5; char BaseZeroCode = '0'; Encoder = boost::archive::iterators::base32hex_from_binary >; Decoder = boost::archive::iterators::transform_width, 8, 5>; std::string = std::basic_string]' +encode/base_n.cc:463:27: required from here +../../../src/lib/util/encode/binary_from_base32hex.h:50:9: error: narrowing conversion of '-1' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Werror=narrowing] +encode/base_n.cc:473:24: required from here +../../../src/lib/util/encode/binary_from_base16.h:47:9: error: narrowing conversion of '-1' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Werror=narrowing] + +name.cc:74:1: error: narrowing conversion of '-1' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Werror=narrowing] +--- + src/lib/dns/name.cc | 2 +- + src/lib/util/encode/binary_from_base16.h | 2 +- + src/lib/util/encode/binary_from_base32hex.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc +index ff00374..7d34a09 100644 +--- a/src/lib/dns/name.cc ++++ b/src/lib/dns/name.cc +@@ -54,7 +54,7 @@ namespace { + /// improve the performance of message rendering (which internally uses the + /// array heavily) about 27%. Since we want to achieve very good performance + /// for message rendering in some cases, we'll keep using it. +-const char digitvalue[256] = { ++const signed char digitvalue[256] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 32 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 48 +diff --git a/src/lib/util/encode/binary_from_base16.h b/src/lib/util/encode/binary_from_base16.h +index e9fdd27..307842a 100644 +--- a/src/lib/util/encode/binary_from_base16.h ++++ b/src/lib/util/encode/binary_from_base16.h +@@ -36,7 +36,7 @@ template + struct to_4_bit { + typedef CharType result_type; + CharType operator()(CharType t) const{ +- const char lookup_table[] = { ++ const signed char lookup_table[] = { + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 00-0f + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 10-1f + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 20-2f +diff --git a/src/lib/util/encode/binary_from_base32hex.h b/src/lib/util/encode/binary_from_base32hex.h +index 43b7d64..457fa3c 100644 +--- a/src/lib/util/encode/binary_from_base32hex.h ++++ b/src/lib/util/encode/binary_from_base32hex.h +@@ -38,7 +38,7 @@ template + struct to_5_bit { + typedef CharType result_type; + CharType operator()(CharType t) const{ +- const char lookup_table[] = { ++ const signed char lookup_table[] = { + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 00-0f + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 10-1f + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, // 20-2f +-- +1.9.3 + diff --git a/kea.spec b/kea.spec new file mode 100644 index 0000000..38ffba0 --- /dev/null +++ b/kea.spec @@ -0,0 +1,218 @@ +#http://lists.fedoraproject.org/pipermail/devel/2011-August/155358.html +%global _hardened_build 1 + +%global prever beta1 + +#%%global VERSION %{version}-%{patchver} +#%%global VERSION %{version} +%global VERSION %{version}-%{prever} + +Summary: DHCPv4, DHCPv6 and DDNS server from ISC +Name: kea +Version: 0.9 +Release: 0.3.%{prever}%{?dist} +License: ISC and Boost +URL: http://kea.isc.org +Source0: http://ftp.isc.org/isc/kea/%{VERSION}/kea-%{VERSION}.tar.gz +Source1: kea-dhcp4.service +Source2: kea-dhcp6.service +Source3: kea-dhcp-ddns.service + +# http://kea.isc.org/ticket/3523 +Patch0: kea-data-dir.patch +# http://kea.isc.org/ticket/3525 +Patch1: kea-LT_INIT.patch +# http://kea.isc.org/ticket/3526 +Patch2: kea-narrowing.patch + +BuildRequires: autoconf automake libtool +BuildRequires: boost-devel +BuildRequires: openssl-devel +BuildRequires: log4cplus-devel +BuildRequires: valgrind-devel +BuildRequires: systemd +# src/lib/testutils/dhcp_test_lib.sh +BuildRequires: procps-ng + +Requires: kea-libs%{?_isa} = %{version}-%{release} +Requires(post): systemd +Requires(preun): systemd +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. + +%package libs +Summary: Shared libraries used by Kea DHCP server + +%description libs +This package contains shared libraries used by Kea DHCP server. + +%package devel +Summary: Development headers and libraries for Kea DHCP server +Requires: kea-libs%{?_isa} = %{version}-%{release} + +%description devel +Header files and API documentation. + +%prep +%setup -q -n kea-%{VERSION} + +%patch0 -p1 -b .data-dir +%patch1 -p1 -b .LT +%patch2 -p1 -b .narrowing + +%build +autoreconf --verbose --force --install + +%configure \ + --disable-silent-rules \ + --disable-static \ + --with-openssl \ + --disable-rpath \ + --enable-debug + +make %{?_smp_mflags} + + +%check +make check + + +%install +make install DESTDIR=%{buildroot} + +# Get rid of .la files +rm -f %{buildroot}%{_libdir}/libkea-*.la + +# Start empty lease databases +mkdir -p %{buildroot}%{_sharedstatedir}/kea/ +touch %{buildroot}%{_sharedstatedir}/kea/kea-leases4.csv +touch %{buildroot}%{_sharedstatedir}/kea/kea-leases6.csv + +# Copy sample config files +install -p -m 644 doc/examples/kea4/single-subnet.json %{buildroot}%{_sysconfdir}/kea/dhcp4.json +install -p -m 644 doc/examples/kea6/simple.json %{buildroot}%{_sysconfdir}/kea/dhcp6.json +install -p -m 644 doc/examples/ddns/template.json %{buildroot}%{_sysconfdir}/kea/dhcp-ddns.json + +# systemd unit files +mkdir -p %{buildroot}%{_unitdir} +install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir} +install -p -m 644 %{SOURCE2} %{buildroot}%{_unitdir} +install -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir} + +install -p -m 644 ext/LICENSE_1_0.txt %{buildroot}%{_defaultdocdir}/kea/ + +%post +%systemd_post kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service + + +%preun +%systemd_preun kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service + + +%postun +%systemd_postun_with_restart kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service + + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + +%files +%{_sbindir}/kea-dhcp-ddns +%{_sbindir}/kea-dhcp4 +%{_sbindir}/kea-dhcp6 +%{_sbindir}/keactrl +%{_sbindir}/perfdhcp +%{_unitdir}/kea-dhcp4.service +%{_unitdir}/kea-dhcp6.service +%{_unitdir}/kea-dhcp-ddns.service +%dir %{_sysconfdir}/kea/ +%config(noreplace) %{_sysconfdir}/kea/kea.conf +%config(noreplace) %{_sysconfdir}/kea/keactrl.conf +%config(noreplace) %{_sysconfdir}/kea/dhcp4.json +%config(noreplace) %{_sysconfdir}/kea/dhcp6.json +%config(noreplace) %{_sysconfdir}/kea/dhcp-ddns.json +%dir %{_datarootdir}/kea/ +%{_datarootdir}/kea/dhcp-ddns.spec +%{_datarootdir}/kea/dhcp4.spec +%{_datarootdir}/kea/dhcp6.spec +%{_datarootdir}/kea/dhcpdb_create.mysql +%{_datarootdir}/kea/dhcpdb_create.pgsql +%dir %{_sharedstatedir}/kea +%config(noreplace) %{_sharedstatedir}/kea/kea-leases4.csv +%config(noreplace) %{_sharedstatedir}/kea/kea-leases6.csv +%{_defaultdocdir}/kea/AUTHORS +%{_defaultdocdir}/kea/ChangeLog +%{_defaultdocdir}/kea/README +%{_defaultdocdir}/kea/examples +%{_defaultdocdir}/kea/kea-guide.* +%{_defaultdocdir}/kea/kea-messages.html +%{_mandir}/man8/kea-dhcp-ddns.8.gz +%{_mandir}/man8/kea-dhcp4.8.gz +%{_mandir}/man8/kea-dhcp6.8.gz +%{_mandir}/man8/keactrl.8.gz +%{_mandir}/man8/perfdhcp.8.gz + +%files libs +%dir %{_defaultdocdir}/kea/ +%{_defaultdocdir}/kea/COPYING +%{_defaultdocdir}/kea/LICENSE_1_0.txt +%{_libdir}/libkea-asiodns.so.* +%{_libdir}/libkea-asiolink.so.* +%{_libdir}/libkea-cc.so.* +%{_libdir}/libkea-cfgclient.so.* +%{_libdir}/libkea-cryptolink.so.* +%{_libdir}/libkea-dhcp++.so.* +%{_libdir}/libkea-dhcp_ddns.so.* +%{_libdir}/libkea-dhcpsrv.so.* +%{_libdir}/libkea-dns++.so.* +%{_libdir}/libkea-exceptions.so.* +%{_libdir}/libkea-hooks.so.* +%{_libdir}/libkea-log.so.* +%{_libdir}/libkea-threads.so.* +%{_libdir}/libkea-util-io.so.* +%{_libdir}/libkea-util.so.* + +%files devel +%{_includedir}/kea +%{_libdir}/libkea-asiodns.so +%{_libdir}/libkea-asiolink.so +%{_libdir}/libkea-cc.so +%{_libdir}/libkea-cfgclient.so +%{_libdir}/libkea-cryptolink.so +%{_libdir}/libkea-dhcp++.so +%{_libdir}/libkea-dhcp_ddns.so +%{_libdir}/libkea-dhcpsrv.so +%{_libdir}/libkea-dns++.so +%{_libdir}/libkea-exceptions.so +%{_libdir}/libkea-hooks.so +%{_libdir}/libkea-log.so +%{_libdir}/libkea-threads.so +%{_libdir}/libkea-util-io.so +%{_libdir}/libkea-util.so +%{_libdir}/pkgconfig/dns++.pc + +%changelog +* Tue Aug 19 2014 Jiri Popelka - 0.9-0.3.beta1 +- comment patches +- use --preserve-timestamps with install + + +* Mon Aug 18 2014 Jiri Popelka - 0.9-0.2.beta1 +- make it build on armv7 +- BuildRequires procps-ng for %%check +- use install instead of cp +- configure.ac: AC_PROG_LIBTOOL -> LT_INIT +- move license files to -libs + +* Thu Aug 14 2014 Jiri Popelka - 0.9-0.1.beta1 +- initial spec diff --git a/sources b/sources index e69de29..dbf5f18 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +e31a24d75b941b5350673d29e664bd14 kea-0.9-beta1.tar.gz