From 683e2b02c62f0fed84b4e764be672d82d910d1d79708af8b2cd27f079218b509 Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Wed, 4 May 2022 09:41:24 +0000 Subject: [PATCH] Accepting request 943368 from home:gmbr3:Active - Change to systemd-sysusers OBS-URL: https://build.opensuse.org/request/show/943368 OBS-URL: https://build.opensuse.org/package/show/server:dns/unbound?expand=0&rev=144 --- unbound.changes | 5 +++++ unbound.spec | 17 +++++++++-------- unbound.sysusers | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 unbound.sysusers diff --git a/unbound.changes b/unbound.changes index 42fc1eb..f2c9b40 100644 --- a/unbound.changes +++ b/unbound.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 31 23:18:09 UTC 2021 - Callum Farmer + +- Change to systemd-sysusers + ------------------------------------------------------------------- Thu Dec 9 11:14:33 UTC 2021 - Michael Ströder diff --git a/unbound.spec b/unbound.spec index 359e5fe..e6efd4f 100644 --- a/unbound.spec +++ b/unbound.spec @@ -42,6 +42,7 @@ Release: 0 # BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: flex +BuildRequires: sysuser-tools BuildRequires: ldns-devel >= %{ldns_version} BuildRequires: libevent-devel BuildRequires: libexpat-devel @@ -93,6 +94,7 @@ Source14: unbound.sysconfig Source15: unbound-anchor.timer Source16: unbound-munin.README Source18: unbound-anchor.service +Source19: unbound.sysusers Summary: Validating, recursive, and caching DNS(SEC) resolver License: BSD-3-Clause @@ -155,7 +157,7 @@ This package holds the development files to work with libunbound. # Summary: Unbound Anchor cert management tools Group: Productivity/Networking/DNS/Servers -Requires(pre): shadow +%sysusers_requires %description anchor Unbound is a validating, recursive, and caching DNS(SEC) resolver. @@ -197,6 +199,7 @@ popd %endif %build +%sysusers_generate_pre %{SOURCE19} anchor unbound.conf export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" @@ -323,18 +326,15 @@ install -m 0640 -p %{SOURCE11} %{buildroot}%{_sysconfdir}/unbound/local.d/ # Link unbound-control-setup.8 manpage to unbound-control.8 echo ".so man8/unbound-control.8" > %{buildroot}/%{_mandir}/man8/unbound-control-setup.8 +# sysusers.d +install -Dm0644 %{SOURCE19} %{buildroot}%{_sysusersdir}/unbound.conf + %check # it currently fails in the ldns unit test. which is weird as both come from the same project make check ||: -%pre anchor -%if %{with systemd} +%pre anchor -f anchor.pre %service_add_pre unbound-anchor.service unbound-anchor.timer -%endif -getent group unbound >/dev/null || groupadd -r unbound -getent passwd unbound >/dev/null || \ - useradd -g unbound -s /bin/false -r -c "unbound caching DNS server" \ - -d /var/lib/unbound unbound %if %{with systemd} %pre @@ -463,6 +463,7 @@ systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : %config %{_sysconfdir}/%{name}/icannbundle.pem %{_unitdir}/unbound-anchor.timer %{_unitdir}/unbound-anchor.service +%{_sysusersdir}/unbound.conf %dir %attr(-,unbound,unbound) %{_sharedstatedir}/%{name} %attr(0644,unbound,unbound) %config(noreplace) %{_sharedstatedir}/%{name}/root.key %attr(0644,root,unbound) %config(noreplace) %{_sysconfdir}/%{name}/dlv.isc.org.key diff --git a/unbound.sysusers b/unbound.sysusers new file mode 100644 index 0000000..ae1812f --- /dev/null +++ b/unbound.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u unbound - "unbound caching DNS server" /var/lib/unbound -