kea/kea.spec
2016-03-17 17:22:13 +00:00

414 lines
13 KiB
RPMSpec

#
# spec file for package kea
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: kea
Version: 1.0.0
Release: 0
Url: http://kea.isc.org/
Summary: Dynamic Host Configuration Protocol daemon
License: GPL-2.0+
Group: Productivity/Networking/Boot/Servers
#Git-Clone: git://github.com/isc-projects/kea
Source: http://ftp.isc.org/isc/kea/%version/%name-%version.tar.gz
Source2: http://ftp.isc.org/isc/kea/%version/%name-%version.tar.gz.asc
BuildRequires: autoconf >= 2.59
BuildRequires: automake
BuildRequires: boost-devel
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libtool >= 2
BuildRequires: libxslt-tools
BuildRequires: log4cplus-devel
BuildRequires: libmysqlclient-devel
BuildRequires: pkgconfig >= 0.23
BuildRequires: postgresql-devel
BuildRequires: xz
BuildRequires: pkgconfig(libcrypto)
%if 0%{?suse_version} >= 1310
BuildRequires: systemd-rpm-macros
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd
%description
Kea is a new DHCPv4/DHCPv6 server being developed by ISC in C++, a
continuation of the DHCP server in the (ended) BIND10 project. The
objective of this project is to provide a very high-performance,
extensible DHCP server engine for use by enterprises and service
providers, either as-is or with extensions and modifications.
%package -n libkea-asiodns0
Summary: Kea DHCP server asiolink abstraction layer library
Group: System/Libraries
%description -n libkea-asiodns0
The asiodns library provides an abstraction layer between BIND10/Kea
modules and the asiolink library.
%package -n libkea-asiolink2
Summary: Kea DHCP server socket I/O abstraction layer library
Group: System/Libraries
%description -n libkea-asiolink2
The asiolink library provides an abstraction layer between BIND10/Kea
modules and the socket I/O subsystem Kea is using (currently,
boost::asio).
%package -n libkea-cc1
Summary: Kea DHCP server command channel library
Group: System/Libraries
%description -n libkea-cc1
libkea-cc is used for the control channel protocol between keactrl
and the server.
%package -n libkea-cfgclient2
Summary: Kea DHCP server configuration client library
Group: System/Libraries
%description -n libkea-cfgclient2
The Kea DHCP server can be managed at runtime via the Control
Channel. The CC allows an external entity (e.g. a tool run by a
sysadmin or a script) to issue commands to the server which can
influence its behavior or retreive information from it. Examples
envisioned are: reconfiguration, statistics retrieval and
manipulation, and shutdown.
Communication over the Control Channel is conducted using JSON
structures. The CC is a UNIX stream socket as of kea 0.9.2.
%package -n libkea-cryptolink1
Summary: Kea DHCP server crypto abstraction layer library
Group: System/Libraries
%description -n libkea-cryptolink1
The Kea cryptolink library is an abstraction layer for crypto
library backends (such as Botan, OpenSSL).
%package -n libkea-dhcp++3
Summary: Kea DHCP library
Group: System/Libraries
%description -n libkea-dhcp++3
libdhcp++ is an all-purpose DHCP-manipulation library, written in
C++. It offers packet parsing and assembly, DHCPv4 and DHCPv6 options
parsing and assembly, interface detection, and socket operations It
can be used by server, client, relay, performance tools and other
DHCP-related tools. For a server-specific library, see
libkea-dhcpsrv.
%package -n libkea-dhcp_ddns1
Summary: Kea DHCP Dynamic DNS library
Group: System/Libraries
%description -n libkea-dhcp_ddns1
This is a library of classes for sending and receiving requests used
by ISC's DHCP-DDNS (aka D2) service to carry out DHCP-driven DNS
updates.
%package -n libkea-dhcpsrv4
Summary: Kea DHCP server component library
Group: System/Libraries
%description -n libkea-dhcpsrv4
This library contains code used for the DHCPv4 and DHCPv6 servers'
operations, including the "Lease Manager" that manages information
about leases and the "Configuration Manager" that stores the servers'
configuration etc.
%package -n libkea-dns++1
Summary: Kea DHCP server component library
Group: System/Libraries
%description -n libkea-dns++1
One of the many libraries the Kea DHCP server is composed of.
%package -n libkea-eval3
Summary: Kea DHCP expression evaluation library
Group: System/Libraries
%description -n libkea-eval3
The core of the libeval library is a parser that is able to parse an
expression (e.g. option[123].text == 'APC'). This is currently used
for client classification.
%package -n libkea-exceptions0
Summary: Kea DHCP server component library
Group: System/Libraries
%description -n libkea-exceptions0
One of the many libraries the Kea DHCP server is composed of.
%package -n libkea-hooks1
Summary: Kea DHCP server hook library
Group: System/Libraries
%description -n libkea-hooks1
The hooks framework is a Kea system that simplifies the way that
users can write code to modify the behavior of Kea. Instead of
altering the Kea source code, they write functions that are compiled
and linked into one or more dynamic shared objects. The library is
specified in the Kea configuration and, at runtime, Kea dynamically
loads the library into its address space. At various points in the
processing, the component "calls out" to functions in the library,
passing to them the data is it currently working on. They can examine
and modify the data as required.
%package -n libkea-log0
Summary: Kea DHCP logging system library
Group: System/Libraries
%description -n libkea-log0
This library contains the Kea logging system, which is based on the
log4J logging system common in Java development, and includes the
following ideas: a set of severity levels; a hierarchy of logging
sources; separation of message use from message text.
%package -n libkea-stats1
Summary: Kea DHCP Statistics Manager library
Group: System/Libraries
%description -n libkea-stats1
One of the many libraries the Kea DHCP server is composed of.
%package -n libkea-threads0
Summary: Kea DHCP thread abstraction library
Group: System/Libraries
%description -n libkea-threads0
Kea's C++ wrapper library for pthreads and mutexes.
%package -n libkea-util-io0
Summary: Kea I/O utility function library
Group: System/Library
%description -n libkea-util-io0
One of the many libraries the Kea DHCP server is composed of.
%package -n libkea-util1
Summary: Kea utility function library
Group: System/Library
%description -n libkea-util1
One of the many libraries the Kea DHCP server is composed of.
%package devel
Summary: Development files for the Kea DHCP server
Group: Development/Libraries/C and C++
# Bundy DHCP and Kea share the same origin, so conflict
Conflicts: otheproviders(pkgconfig(dns++))
Requires: libkea-asiodns0 = %version
Requires: libkea-asiolink2 = %version
Requires: libkea-cc1 = %version
Requires: libkea-cfgclient2 = %version
Requires: libkea-cryptolink1 = %version
Requires: libkea-dhcp++3 = %version
Requires: libkea-dhcp_ddns1 = %version
Requires: libkea-dhcpsrv4 = %version
Requires: libkea-dns++1 = %version
Requires: libkea-eval3 = %version
Requires: libkea-exceptions0 = %version
Requires: libkea-hooks1 = %version
Requires: libkea-log0 = %version
Requires: libkea-stats1 = %version
Requires: libkea-threads0 = %version
Requires: libkea-util-io0 = %version
Requires: libkea-util1 = %version
%description devel
%prep
%setup -q
%build
autoreconf -fi
%configure --disable-static
make %{?_smp_mflags}
%install
b="%buildroot"
%make_install
rm -fv "$b/%_libdir"/*.la
mkdir -p "$b/%_unitdir" "$b/%_prefix/lib/tmpfiles.d"
ls -l "$b/%_unitdir/" "$b/%_prefix/lib/tmpfiles.d/" || :
cat <<-EOF >"$b/%_unitdir/kea.service"
[Unit]
Description=ISC Kea DHCP server
Before=multi-user.target
After=remote-fs.target network.target nss-lookup.target time-sync.target ldap.service ndsd.service
[Service]
Type=forking
ExecStart=%_sbindir/keactrl start
ExecReload=%_sbindir/keactrl reload
ExecStop=%_sbindir/keactrl stop
[Install]
WantedBy=multi-user.target
Alias=dhcp-server.service
EOF
cat <<-EOF >"$b/%_prefix/lib/tmpfiles.d/kea.conf"
d /run/kea 0775 keadhcp keadhcp -
EOF
perl -i -pe 's{/var/run}{/run};s{/var/log/kea-}{/var/log/kea/}' \
"$b/%_sysconfdir/kea"/*.conf
mkdir -p "$b/var/log/kea"
%fdupes %buildroot/%_prefix
%pre
getent group keadhcp >/dev/null || groupadd -r keadhcp || :
getent passwd keadhcp >/dev/null || useradd -r -N -M -g keadhcp \
-s /sbin/nologin -d /var/lib/kea -c "Kea DHCP server" \
keadhcp || :
systemd-tmpfiles --create kea.conf || :
%service_add_pre kea.service
%post
%service_add_post kea.service
%preun
%service_del_preun kea.service
%postun
%service_del_postun kea.service
%post -n libkea-asiodns0 -p /sbin/ldconfig
%postun -n libkea-asiodns0 -p /sbin/ldconfig
%post -n libkea-asiolink2 -p /sbin/ldconfig
%postun -n libkea-asiolink2 -p /sbin/ldconfig
%post -n libkea-cc1 -p /sbin/ldconfig
%postun -n libkea-cc1 -p /sbin/ldconfig
%post -n libkea-cfgclient2 -p /sbin/ldconfig
%postun -n libkea-cfgclient2 -p /sbin/ldconfig
%post -n libkea-cryptolink1 -p /sbin/ldconfig
%postun -n libkea-cryptolink1 -p /sbin/ldconfig
%post -n libkea-dhcp++3 -p /sbin/ldconfig
%postun -n libkea-dhcp++3 -p /sbin/ldconfig
%post -n libkea-dhcp_ddns1 -p /sbin/ldconfig
%postun -n libkea-dhcp_ddns1 -p /sbin/ldconfig
%post -n libkea-dhcpsrv4 -p /sbin/ldconfig
%postun -n libkea-dhcpsrv4 -p /sbin/ldconfig
%post -n libkea-dns++1 -p /sbin/ldconfig
%postun -n libkea-dns++1 -p /sbin/ldconfig
%post -n libkea-eval3 -p /sbin/ldconfig
%postun -n libkea-eval3 -p /sbin/ldconfig
%post -n libkea-exceptions0 -p /sbin/ldconfig
%postun -n libkea-exceptions0 -p /sbin/ldconfig
%post -n libkea-hooks1 -p /sbin/ldconfig
%postun -n libkea-hooks1 -p /sbin/ldconfig
%post -n libkea-log0 -p /sbin/ldconfig
%postun -n libkea-log0 -p /sbin/ldconfig
%post -n libkea-stats1 -p /sbin/ldconfig
%postun -n libkea-stats1 -p /sbin/ldconfig
%post -n libkea-threads0 -p /sbin/ldconfig
%postun -n libkea-threads0 -p /sbin/ldconfig
%post -n libkea-util-io0 -p /sbin/ldconfig
%postun -n libkea-util-io0 -p /sbin/ldconfig
%post -n libkea-util1 -p /sbin/ldconfig
%postun -n libkea-util1 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%dir %_sysconfdir/kea
%config(noreplace) %_sysconfdir/kea/*.conf
%_datadir/doc/kea/
%_mandir/man8/*.8*
%_bindir/kea*
%_sbindir/kea*
%_sbindir/perfdhcp
%_datadir/kea/
%_unitdir/*.service
%_prefix/lib/tmpfiles.d/
%attr(0775,keadhcp,keadhcp) %_localstatedir/log/kea/
%files -n libkea-asiodns0
%defattr(-,root,root)
%_libdir/libkea-asiodns.so.0*
%files -n libkea-asiolink2
%defattr(-,root,root)
%_libdir/libkea-asiolink.so.2*
%files -n libkea-cc1
%defattr(-,root,root)
%_libdir/libkea-cc.so.1*
%files -n libkea-cfgclient2
%defattr(-,root,root)
%_libdir/libkea-cfgclient.so.2*
%files -n libkea-cryptolink1
%defattr(-,root,root)
%_libdir/libkea-cryptolink.so.1*
%files -n libkea-dhcp++3
%defattr(-,root,root)
%_libdir/libkea-dhcp++.so.3*
%files -n libkea-dhcp_ddns1
%defattr(-,root,root)
%_libdir/libkea-dhcp_ddns.so.1*
%files -n libkea-dhcpsrv4
%defattr(-,root,root)
%_libdir/libkea-dhcpsrv.so.4*
%files -n libkea-dns++1
%defattr(-,root,root)
%_libdir/libkea-dns++.so.1*
%files -n libkea-eval3
%defattr(-,root,root)
%_libdir/libkea-eval.so.3*
%files -n libkea-exceptions0
%defattr(-,root,root)
%_libdir/libkea-exceptions.so.0*
%files -n libkea-hooks1
%defattr(-,root,root)
%_libdir/libkea-hooks.so.1*
%files -n libkea-log0
%defattr(-,root,root)
%_libdir/libkea-log.so.0*
%files -n libkea-stats1
%defattr(-,root,root)
%_libdir/libkea-stats.so.1*
%files -n libkea-threads0
%defattr(-,root,root)
%_libdir/libkea-threads.so.0*
%files -n libkea-util-io0
%defattr(-,root,root)
%_libdir/libkea-util-io.so.0*
%files -n libkea-util1
%defattr(-,root,root)
%_libdir/libkea-util.so.1*
%files devel
%defattr(-,root,root)
%_includedir/kea/
%_libdir/pkgconfig/*.pc
%_libdir/libkea*.so
%changelog