2 # - stop using nobody group
5 %bcond_without python # Python binding
6 %bcond_with dnscrypt # dnscrypt support
7 %bcond_with dnstap # dnstap replication support
8 %bcond_with redis # cachedb support for redis (using hiredis)
9 %bcond_with systemd # systemd support
10 %bcond_without tests # unit tests
12 Summary: Recursive, validating DNS resolver
13 Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS
18 Group: Applications/Network
19 Source0: https://www.unbound.net/downloads/%{name}-%{version}.tar.gz
20 # Source0-md5: bb96df2dc579c11ada537dbc52781abc
22 Source2: %{name}.service
23 Source3: https://data.iana.org/root-anchors/icannbundle.pem
24 # Source3-md5: d00ef4e253e99e93ee020da5ad5e7d9a
25 Source4: ftp://ftp.internic.net/domain/named.cache
26 # Source4-md5: 12ecc90635bdb36e2c50e83f1e0dcb90
27 Patch0: %{name}-default_trust_anchor.patch
28 Patch1: %{name}-sh.patch
29 URL: http://unbound.net/
30 BuildRequires: autoconf >= 2.56
31 BuildRequires: automake
33 BuildRequires: expat-devel >= 1.95
35 %{?with_dnstap:BuildRequires: fstrm-devel}
36 %{?with_redis:BuildRequires: hiredis-devel}
37 BuildRequires: libevent-devel
38 %{?with_dnscrypt:BuildRequires: libsodium-devel}
39 BuildRequires: libtool
40 BuildRequires: openssl-devel >= 1.0.0
41 %{?with_dnstap:BuildRequires: protobuf-c-devel}
42 BuildRequires: rpmbuild(macros) >= 1.671
43 %{?with_systemd:BuildRequires: systemd-devel}
45 BuildRequires: python3-devel
46 BuildRequires: python3-modules
47 BuildRequires: swig-python >= 2.0.1
49 Provides: user(unbound)
50 Requires(post,preun): /sbin/chkconfig
51 Requires(postun): /usr/sbin/userdel
52 Requires(pre): /bin/id
53 Requires(pre): /usr/sbin/useradd
54 Requires: systemd-units >= 38
55 Requires: %{name}-libs = %{version}-%{release}
56 Suggests: openssl-tools
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 Unbound is a validating, recursive, and caching DNS resolver.
62 The C implementation of Unbound is developed and maintained by NLnet
63 Labs. It is based on ideas and algorithms taken from a Java prototype
64 developed by Verisign labs, Nominet, Kirei and ep.net.
66 Unbound is designed as a set of modular components, so that also
67 DNSSEC (secure DNS) validation and stub-resolvers (that do not run as
68 a server, but are linked into an application) are easily possible.
70 %description -l pl.UTF-8
71 Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod
72 rozwiązujący nazwy) DNS.
74 Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet
75 Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z
76 prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz
79 Unbound został zaprojektowany jako zbiór modularnych komponentów, więc
80 możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz
81 resolvery-zaślepki (nie działające jako serwer, ale wbudowane w
85 Summary: Unbound shared library
86 Summary(pl.UTF-8): Biblioteka współdzielona Unbound
88 Conflicts: unbound < 1.4.18-1
91 Unbound shared library.
93 %description libs -l pl.UTF-8
94 Biblioteka współdzielona Unbound.
97 Summary: Header files for unbound library
98 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound
99 Group: Development/Libraries
100 Requires: %{name}-libs = %{version}-%{release}
101 Requires: openssl-devel >= 1.0.0
104 Header files for unbound library.
106 %description devel -l pl.UTF-8
107 Pliki nagłówkowe biblioteki unbound.
110 Summary: Static unbound library
111 Summary(pl.UTF-8): Statyczna biblioteka unbound
112 Group: Development/Libraries
113 Requires: %{name}-devel = %{version}-%{release}
116 Static unbound library.
118 %description static -l pl.UTF-8
119 Statyczna biblioteka unbound.
121 %package -n python3-unbound
122 Summary: Python interface to unbound library
123 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound
124 Group: Libraries/Python
125 Requires: %{name}-libs = %{version}-%{release}
126 Obsoletes: python-unbound < 1.13.1-2
128 %description -n python3-unbound
129 Python interface to unbound library.
131 %description -n python3-unbound -l pl.UTF-8
132 Pythonowy interfejs do biblioteki unbound.
145 PYTHON=%{__python3} \
146 %{?with_dnscrypt:--enable-dnscrypt} \
147 %{?with_dnstap:--enable-dnstap} \
148 %{?with_systemd:--enable-systemd} \
149 --with-chroot-dir="" \
150 --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \
151 --with-libevent=/usr \
152 --with-libexpat=/usr \
153 %{?with_redis:--with-libhiredis=/usr} \
154 --with-pidfile=/run/%{name}.pid \
155 %{__with_without python pyunbound} \
156 %{__with_without python pythonmodule} \
157 --with-rootkey-file=/var/lib/%{name}/root.key \
158 --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem
167 rm -rf $RPM_BUILD_ROOT
168 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}}
171 DESTDIR=$RPM_BUILD_ROOT
173 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
174 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
175 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem
176 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache
178 touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key
180 # obsoleted by pkg-config
181 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libunbound.la
184 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_unbound.la
185 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
186 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
190 rm -rf $RPM_BUILD_ROOT
193 /sbin/chkconfig --add %{name}
194 %systemd_post %{name}.service
195 %service %{name} restart
198 %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
201 if [ "$1" = "0" ]; then
202 %service -q %{name} stop
203 /sbin/chkconfig --del %{name}
205 %systemd_preun %{name}.service
208 if [ "$1" = "0" ]; then
213 %triggerpostun -- %{name} < 1.4.22-1
214 %systemd_trigger %{name}.service
216 %post libs -p /sbin/ldconfig
217 %postun libs -p /sbin/ldconfig
220 %defattr(644,root,root,755)
221 %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
222 %attr(754,root,root) /etc/rc.d/init.d/unbound
223 %{systemdunitdir}/%{name}.service
224 %attr(751,unbound,root) %dir %{_sysconfdir}/%{name}
225 %attr(640,unbound,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
226 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
227 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
228 %attr(755,root,root) %{_sbindir}/unbound
229 %attr(755,root,root) %{_sbindir}/unbound-anchor
230 %attr(755,root,root) %{_sbindir}/unbound-checkconf
231 %attr(755,root,root) %{_sbindir}/unbound-control*
232 %attr(755,root,root) %{_sbindir}/unbound-host
233 %{_mandir}/man1/unbound-host.1*
234 %{_mandir}/man5/unbound.conf.5*
235 %{_mandir}/man8/unbound-checkconf.8*
236 %{_mandir}/man8/unbound.8*
237 %{_mandir}/man8/unbound-anchor.8*
238 %{_mandir}/man8/unbound-control*.8*
239 %dir %attr(755,unbound,nobody) /var/lib/%{name}
240 %ghost /var/lib/%{name}/root.key
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
245 %attr(755,root,root) %ghost %{_libdir}/libunbound.so.8
248 %defattr(644,root,root,755)
249 %attr(755,root,root) %{_libdir}/libunbound.so
250 %{_pkgconfigdir}/libunbound.pc
251 %{_includedir}/unbound.h
252 %{_mandir}/man3/libunbound.3*
253 %{_mandir}/man3/ub_*.3*
256 %defattr(644,root,root,755)
257 %{_libdir}/libunbound.a
260 %files -n python3-unbound
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{py3_sitedir}/_unbound.so*
263 %{py3_sitedir}/__pycache__/unbound*.pyc
264 %{py3_sitedir}/unbound.py
265 %{py3_sitedir}/unboundmodule.py