From 63aa52ad28d895d540cda18dfbf0f82ae591a6fd0466064f3726147317028c4c Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Tue, 26 Oct 2021 12:49:46 +0000 Subject: [PATCH 1/3] - Add a fallback definition for %make_build to fix build on SLE-12. - Handle sysusers with a bcond to improve readability and simplify removal once we don't have to support SLE-12 anymore. - bsc#1192020: Drop the obsolete dependency on "group(nogroup)". OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=232 --- dhcp.changes | 8 ++++++++ dhcp.spec | 31 +++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dhcp.changes b/dhcp.changes index 7d14e5b..2c294bb 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Oct 26 11:58:59 UTC 2021 - Reinhard Max + +- Add a fallback definition for %make_build to fix build on SLE-12. +- Handle sysusers with a bcond to improve readability and simplify + removal once we don't have to support SLE-12 anymore. +- bsc#1192020: Drop the obsolete dependency on "group(nogroup)". + ------------------------------------------------------------------- Thu Aug 5 11:33:54 UTC 2021 - Reinhard Max diff --git a/dhcp.spec b/dhcp.spec index 856195f..9cf0e80 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -26,6 +26,11 @@ %else %define sbindir /sbin %endif +%if 0%{?suse_version} >= 1330 +%bcond_without sysusers +%else +%bcond_with sysusers +%endif Name: dhcp Version: 4.4.2.P1 Release: 0 @@ -95,8 +100,7 @@ BuildRequires: automake BuildRequires: dos2unix BuildRequires: libtool BuildRequires: openldap2-devel -%if 0%{?suse_version} >= 1330 -BuildRequires: sysuser-shadow +%if %{with sysusers} BuildRequires: sysuser-tools %endif @@ -105,13 +109,12 @@ Summary: ISC DHCP Server Group: Productivity/Networking/Boot/Servers Requires: dhcp = %{version} Requires(post): %fillup_prereq -%systemd_ordering +%{?systemd_ordering} %if 0%{?suse_version} < 1500 Requires: net-tools %endif -%if 0%{?suse_version} >= 1330 -Requires(pre): group(nogroup) -# %sysusers_requires +%if %{with sysusers} +%sysusers_requires %else Requires(pre): shadow %endif @@ -134,7 +137,7 @@ Summary: ISC DHCP Relay Agent Group: Productivity/Networking/Boot/Servers Requires: dhcp = %{version} Requires(post): %fillup_prereq -%systemd_ordering +%{?systemd_ordering} %if 0%{?suse_version} < 1500 Requires: net-tools %endif @@ -260,13 +263,17 @@ export CFLAGS LDFLAGS FFLAGS CXXFLAGS --with-srv6-lease-file=%{_localstatedir}/lib/dhcp6/db/dhcpd6.leases # : building bind sources +%if 0%{?!make_build:1} +# SLE-12 compatbility still needed as of October 2021 +%define make_build %{__make} %{?_smp_mflags} +%endif %make_build -j1 -C bind all cat bind/configure.log cat bind/build.log cat bind/install.log : building dhcp sources %make_build -%if 0%{?suse_version} >= 1330 +%if %{with sysusers} %sysusers_generate_pre %{SOURCE47} dhcp-server %endif @@ -399,14 +406,14 @@ mv %{buildroot}%{_includedir}/{dhcpctl,omapip} \ %{buildroot}%{_includedir}/dhcp/ mv %{buildroot}%{_libdir}/lib*.* \ %{buildroot}%{_libdir}/dhcp/ -%if 0%{?suse_version} >= 1330 -mkdir -p %{buildroot}%{_sysusersdir} +%if %{with sysusers} install -m 644 %{SOURCE47} %{buildroot}%{_sysusersdir}/ %endif -%if 0%{?suse_version} >= 1330 +%if %{with sysusers} %pre server -f dhcp-server.pre %else + %pre server getent passwd dhcpd >/dev/null || useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d %{_localstatedir}/lib/dhcp dhcpd %endif @@ -479,7 +486,7 @@ fi %{_sbindir}/rcdhcpd6 %{_unitdir}/dhcpd.service %{_unitdir}/dhcpd6.service -%if 0%{?suse_version} >= 1330 +%if %{with sysusers} %{_sysusersdir}/dhcp-user.conf %endif %dir %{_libexecdir}/initscripts/legacy-actions/dhcpd From e3cdf90ee1ad59b32e7622a1ecf6478e82abe51321ad7212e55963db01ffc1de Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Tue, 26 Oct 2021 16:18:08 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=233 --- dhcp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhcp.spec b/dhcp.spec index 9cf0e80..04290d5 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -407,7 +407,7 @@ mv %{buildroot}%{_includedir}/{dhcpctl,omapip} \ mv %{buildroot}%{_libdir}/lib*.* \ %{buildroot}%{_libdir}/dhcp/ %if %{with sysusers} -install -m 644 %{SOURCE47} %{buildroot}%{_sysusersdir}/ +install -D -m 644 %{SOURCE47} %{buildroot}%{_sysusersdir}/ %endif %if %{with sysusers} From 59be18d13536aa34cf120d4210509c8212906cf5e12bda5c8ac5119f50c91fa3 Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Tue, 26 Oct 2021 16:24:06 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=234 --- dhcp.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhcp.spec b/dhcp.spec index 04290d5..fe58d6f 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -407,7 +407,8 @@ mv %{buildroot}%{_includedir}/{dhcpctl,omapip} \ mv %{buildroot}%{_libdir}/lib*.* \ %{buildroot}%{_libdir}/dhcp/ %if %{with sysusers} -install -D -m 644 %{SOURCE47} %{buildroot}%{_sysusersdir}/ +mkdir -p %{buildroot}%{_sysusersdir} +install -m 644 %{SOURCE47} %{buildroot}%{_sysusersdir}/ %endif %if %{with sysusers}