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
This commit is contained in:
Marcus Rückert 2022-05-04 09:41:24 +00:00 committed by Git OBS Bridge
parent c7307c6222
commit 683e2b02c6
3 changed files with 16 additions and 8 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Dec 31 23:18:09 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Change to systemd-sysusers
-------------------------------------------------------------------
Thu Dec 9 11:14:33 UTC 2021 - Michael Ströder <michael@stroeder.com>

View File

@ -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

2
unbound.sysusers Normal file
View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u unbound - "unbound caching DNS server" /var/lib/unbound -