1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = System/Daemons
11 url = https://www.nlnetlabs.nl/unbound/
13 summary = A validating, recursive, and caching DNS(SEC) resolver.
16 Unbound is a validating, recursive, and caching DNS(SEC) resolver.
17 The C implementation of Unbound is developed and maintained by NLnet
18 Labs and is based on ideas and algorithms taken from a java prototype
19 developed by Verisign labs, Nominet, Kirei and ep.net. Unbound is
20 designed as a set of modular components, so that also
21 DNSSEC (secure DNS) validation and stub-resolvers are easily possible.
24 source_dl = https://www.unbound.net/downloads/
29 openssl-devel >= 1.0.1h-2
34 configure_options += \
35 --with-conf-file=%{sysconfdir}/%{name}/unbound.conf \
36 --with-pidfile=/run/%{name}/%{name}.pid \
37 --with-rootkey-file=%{sharedstatedir}/unbound/root.key \
45 --with-pyunbound PYTHON=%{python3}
56 # Directory for user specified and additional config files.
57 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/conf.d/
59 # Directory for stub and forward zones.
60 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/local.d/
62 # Directory for trusted-keys-file.
63 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/keys.d/
65 # Directory for the root anchor.
66 mkdir -pv %{BUILDROOT}%{sharedstatedir}/%{name}
68 # Install unbound config file.
69 install -p -m 0664 %{DIR_SOURCE}/%{name}.conf \
70 %{BUILDROOT}%{sysconfdir}/%{name}/
72 # Install pem file for icannbundle.
73 install -p -m 0664 %{DIR_SOURCE}/icannbundle.pem \
74 %{BUILDROOT}%{sysconfdir}/%{name}/
76 # Install root and DLV keys.
77 install -p -m 0644 %{DIR_SOURCE}/root.key \
78 %{BUILDROOT}%{sysconfdir}/%{name}/
79 install -p -m 0664 %{DIR_SOURCE}/dlv.isc.org.key \
80 %{BUILDROOT}%{sysconfdir}/%{name}/
81 install -p -m 0664 %{DIR_SOURCE}/root.anchor \
82 %{BUILDROOT}%{sharedstatedir}/%{name}/root.key
85 chown -R unbound:unbound %{BUILDROOT}%{sharedstatedir}/%{name}/
90 getent group unound >/dev/null || /usr/sbin/groupadd -r unbound
91 getent passwd unbound >/dev/null || /usr/sbin/useradd -r -g unbound \
92 -d %{sysconfdir}/%{name} -s /sbin/nologin unbound
106 %{sysconfdir}/%{name}.conf
110 %{sysconfdir}/%{name}/conf.d/
111 %{sysconfdir}/%{name}/local.d/
112 %{sysconfdir}/%{name}/keys.d/
120 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
122 # Enable root anchor for DNSSEC validation.
123 systemctl enable unbound-anchor.timer >/dev/null 2>&1 || :
127 systemctl --no-reload disable unbound-anchor.timer >/dev/null 2>&1 || :
128 systemctl --no-reload disable unbound-keygen.service >/dev/null 2>&1 || :
129 systemctl --no-reload disable unbound.service >/dev/null 2>&1 || :
130 systemctl stop unbound.service >/dev/null 2>&1 || :
131 systemctl stop unbound-keygen.service >/dev/null 2>&1 || :
135 systemctl daemon-reload >/dev/null 2>&1 || :
139 systemctl daemon-reload >/dev/null 2>&1 || :
140 systemctl try-restart unbound-keygen.service >/dev/null 2>&1 || :
141 systemctl try-restart unbound.service >/dev/null 2>&1 || :
149 package python3-%{name}
153 package %{name}-devel
157 package %{name}-debuginfo