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: 974cbd17e2e2373f36bfce0ad5b1d4a1
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: 174738e23c506ddb1b5c24178e5fdc13
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: swig-python >= 2.0.1
48 Provides: user(unbound)
49 Requires(post,preun): /sbin/chkconfig
50 Requires(postun): /usr/sbin/userdel
51 Requires(pre): /bin/id
52 Requires(pre): /usr/sbin/useradd
53 Requires: systemd-units >= 38
54 Requires: %{name}-libs = %{version}-%{release}
55 Suggests: openssl-tools
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 Unbound is a validating, recursive, and caching DNS resolver.
61 The C implementation of Unbound is developed and maintained by NLnet
62 Labs. It is based on ideas and algorithms taken from a Java prototype
63 developed by Verisign labs, Nominet, Kirei and ep.net.
65 Unbound is designed as a set of modular components, so that also
66 DNSSEC (secure DNS) validation and stub-resolvers (that do not run as
67 a server, but are linked into an application) are easily possible.
69 %description -l pl.UTF-8
70 Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod
71 rozwiązujący nazwy) DNS.
73 Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet
74 Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z
75 prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz
78 Unbound został zaprojektowany jako zbiór modularnych komponentów, więc
79 możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz
80 resolvery-zaślepki (nie działające jako serwer, ale wbudowane w
84 Summary: Unbound shared library
85 Summary(pl.UTF-8): Biblioteka współdzielona Unbound
87 Conflicts: unbound < 1.4.18-1
90 Unbound shared library.
92 %description libs -l pl.UTF-8
93 Biblioteka współdzielona Unbound.
96 Summary: Header files for unbound library
97 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound
98 Group: Development/Libraries
99 Requires: %{name}-libs = %{version}-%{release}
100 Requires: openssl-devel >= 1.0.0
103 Header files for unbound library.
105 %description devel -l pl.UTF-8
106 Pliki nagłówkowe biblioteki unbound.
109 Summary: Static unbound library
110 Summary(pl.UTF-8): Statyczna biblioteka unbound
111 Group: Development/Libraries
112 Requires: %{name}-devel = %{version}-%{release}
115 Static unbound library.
117 %description static -l pl.UTF-8
118 Statyczna biblioteka unbound.
120 %package -n python3-unbound
121 Summary: Python interface to unbound library
122 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound
123 Group: Libraries/Python
124 Requires: %{name}-libs = %{version}-%{release}
125 Obsoletes: python-unbound < 1.13.1-2
127 %description -n python3-unbound
128 Python interface to unbound library.
130 %description -n python3-unbound -l pl.UTF-8
131 Pythonowy interfejs do biblioteki unbound.
144 PYTHON=%{__python3} \
145 %{?with_dnscrypt:--enable-dnscrypt} \
146 %{?with_dnstap:--enable-dnstap} \
147 %{?with_systemd:--enable-systemd} \
148 --with-chroot-dir="" \
149 --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \
150 --with-libevent=/usr \
151 --with-libexpat=/usr \
152 %{?with_redis:--with-libhiredis=/usr} \
153 --with-pidfile=/run/%{name}.pid \
154 %{__with_without python pyunbound} \
155 %{__with_without python pythonmodule} \
156 --with-rootkey-file=/var/lib/%{name}/root.key \
157 --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}}
170 DESTDIR=$RPM_BUILD_ROOT
172 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
173 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
174 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem
175 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache
177 touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key
179 # obsoleted by pkg-config
180 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libunbound.la
183 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_unbound.la
184 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
185 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
189 rm -rf $RPM_BUILD_ROOT
192 /sbin/chkconfig --add %{name}
193 %systemd_post %{name}.service
194 %service %{name} restart
197 %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
200 if [ "$1" = "0" ]; then
201 %service -q %{name} stop
202 /sbin/chkconfig --del %{name}
204 %systemd_preun %{name}.service
207 if [ "$1" = "0" ]; then
212 %triggerpostun -- %{name} < 1.4.22-1
213 %systemd_trigger %{name}.service
215 %post libs -p /sbin/ldconfig
216 %postun libs -p /sbin/ldconfig
219 %defattr(644,root,root,755)
220 %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
221 %attr(754,root,root) /etc/rc.d/init.d/unbound
222 %{systemdunitdir}/%{name}.service
223 %dir %{_sysconfdir}/%{name}
224 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
225 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
226 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
227 %attr(755,root,root) %{_sbindir}/unbound
228 %attr(755,root,root) %{_sbindir}/unbound-anchor
229 %attr(755,root,root) %{_sbindir}/unbound-checkconf
230 %attr(755,root,root) %{_sbindir}/unbound-control*
231 %attr(755,root,root) %{_sbindir}/unbound-host
232 %{_mandir}/man1/unbound-host.1*
233 %{_mandir}/man5/unbound.conf.5*
234 %{_mandir}/man8/unbound-checkconf.8*
235 %{_mandir}/man8/unbound.8*
236 %{_mandir}/man8/unbound-anchor.8*
237 %{_mandir}/man8/unbound-control*.8*
238 %dir %attr(755,unbound,nobody) /var/lib/%{name}
239 %ghost /var/lib/%{name}/root.key
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
244 %attr(755,root,root) %ghost %{_libdir}/libunbound.so.8
247 %defattr(644,root,root,755)
248 %attr(755,root,root) %{_libdir}/libunbound.so
249 %{_pkgconfigdir}/libunbound.pc
250 %{_includedir}/unbound.h
251 %{_mandir}/man3/libunbound.3*
252 %{_mandir}/man3/ub_*.3*
255 %defattr(644,root,root,755)
256 %{_libdir}/libunbound.a
259 %files -n python3-unbound
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{py3_sitedir}/_unbound.so*
262 %{py3_sitedir}/__pycache__/unbound*.pyc
263 %{py3_sitedir}/unbound.py
264 %{py3_sitedir}/unboundmodule.py