From e504b73f9d8334349b6146b710168e89134da462 Mon Sep 17 00:00:00 2001 From: Martin Osvald Date: Tue, 22 Aug 2023 08:52:05 +0200 Subject: [PATCH] Various spec file improvements - Remove _hardened_build variable as it is no longer needed - Clean up numbering of sources - Further %{name} changes to allow different package name - Move documentation into sub-package - Move tpmfiles.d configuration into separate file - Start using %autorelease and %autochangelog - Remove %license COPYING for devel due to lib dependency --- kea-tmpfiles.d.conf | 5 ++++ kea.spec | 66 +++++++++++++++++++++++++-------------------- 2 files changed, 42 insertions(+), 29 deletions(-) create mode 100644 kea-tmpfiles.d.conf diff --git a/kea-tmpfiles.d.conf b/kea-tmpfiles.d.conf new file mode 100644 index 0000000..dcd2418 --- /dev/null +++ b/kea-tmpfiles.d.conf @@ -0,0 +1,5 @@ +# kea needs existing /run/kea/ to create logger_lockfile there +# See tmpfiles.d(5) for details + +d /run/kea 0755 root root - + diff --git a/kea.spec b/kea.spec index 8fa8df3..816cfae 100644 --- a/kea.spec +++ b/kea.spec @@ -1,5 +1,3 @@ -#http://lists.fedoraproject.org/pipermail/devel/2011-August/155358.html -%global _hardened_build 1 %global sysrepo 0 #%%global prever P1 @@ -12,15 +10,16 @@ Summary: DHCPv4, DHCPv6 and DDNS server from ISC License: MPL-2.0 AND BSL-1.0 URL: http://kea.isc.org Source0: https://downloads.isc.org/isc/kea/%{version}%{?prever:-%{prever}}/kea-%{version}%{?prever:-%{prever}}.tar.gz -Source5: https://downloads.isc.org/isc/kea/%{version}%{?prever:-%{prever}}/kea-%{version}%{?prever:-%{prever}}.tar.gz.asc +Source1: https://downloads.isc.org/isc/kea/%{version}%{?prever:-%{prever}}/kea-%{version}%{?prever:-%{prever}}.tar.gz.asc # Obtained from https://www.isc.org/pgpkey/ -Source6: isc-keyblock.asc -Source1: kea-dhcp4.service -Source2: kea-dhcp6.service -Source3: kea-dhcp-ddns.service -Source4: kea-ctrl-agent.service +Source2: isc-keyblock.asc +Source3: kea-dhcp4.service +Source4: kea-dhcp6.service +Source5: kea-dhcp-ddns.service +Source6: kea-ctrl-agent.service +Source7: kea-tmpfiles.d.conf -Patch3: kea-openssl-version.patch +Patch1: kea-openssl-version.patch # autoreconf BuildRequires: autoconf automake libtool @@ -64,7 +63,7 @@ BuildRequires: python3-sphinx_rtd_theme BuildRequires: make BuildRequires: gnupg2 -Requires: kea-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -78,9 +77,17 @@ rebinding and release. The DHCPv6 server supports prefix delegation. Both servers support DNS Update mechanism, using stand-alone DDNS daemon. +%package doc +Summary: Documentation for Kea DHCP server +BuildArch: noarch + +%description doc +Documentation and example configuration for Kea DHCP server. + + %package devel Summary: Development headers and libraries for Kea DHCP server -Requires: kea-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} # to build hooks (#1335900) Requires: boost-devel Requires: openssl-devel @@ -92,7 +99,7 @@ Header files and API documentation. %package hooks Summary: Hooks libraries for kea -Requires: kea-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description hooks Hooking mechanism allow Kea to load one or more dynamically-linked libraries @@ -110,7 +117,7 @@ This package contains shared libraries used by Kea DHCP server. %prep %if 0%{?fedora} -%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{S:2}' --signature='%{S:1}' --data='%{S:0}' %endif rm -rf doc/sphinx/_build %autosetup -p1 -n kea-%{version}%{?prever:-%{prever}} @@ -154,10 +161,10 @@ autoreconf --verbose --force --install 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 +install -Dpm 0644 %{S:3} %{buildroot}%{_unitdir}/kea-dhcp4.service +install -Dpm 0644 %{S:4} %{buildroot}%{_unitdir}/kea-dhcp6.service +install -Dpm 0644 %{S:5} %{buildroot}%{_unitdir}/kea-dhcp-ddns.service +install -Dpm 0644 %{S:6} %{buildroot}%{_unitdir}/kea-ctrl-agent.service # Start empty lease databases mkdir -p %{buildroot}%{_sharedstatedir}/kea/ @@ -165,19 +172,12 @@ touch %{buildroot}%{_sharedstatedir}/kea/kea-leases4.csv touch %{buildroot}%{_sharedstatedir}/kea/kea-leases6.csv rm -f %{buildroot}%{_pkgdocdir}/COPYING - +rm -f %{buildroot}%{_pkgdocdir}/html/.buildinfo mkdir -p %{buildroot}/run -install -d -m 0755 %{buildroot}/run/kea/ +install -dm 0755 %{buildroot}/run/kea/ -# install /usr/lib/tmpfiles.d/kea.conf -mkdir -p %{buildroot}%{_tmpfilesdir} -cat > %{buildroot}%{_tmpfilesdir}/kea.conf <