2 # - stop using nobody group
5 %bcond_without python # Python binding
6 %bcond_with dnstap # dnstap replication support
7 %bcond_with redis # cachedb support for redis (using hiredis)
8 %bcond_with systemd # systemd support
9 %bcond_without tests # unit tests
11 Summary: Recursive, validating DNS resolver
12 Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS
17 Group: Applications/Network
18 Source0: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
19 # Source0-md5: fe1af630616d7d88d621e300fb87e5d5
21 Source2: %{name}.service
22 Source3: https://data.iana.org/root-anchors/icannbundle.pem
23 # Source3-md5: 24a426d59b61524623695f1b849f159b
24 Source4: ftp://ftp.internic.net/domain/named.cache
25 # Source4-md5: dae96030c23cfe108333680564b65b7f
26 Patch0: %{name}-default_trust_anchor.patch
27 Patch1: %{name}-sh.patch
28 Patch2: %{name}-pythondir.patch
29 Patch3: %{name}-flex.patch
30 URL: http://unbound.net/
31 BuildRequires: autoconf >= 2.56
32 BuildRequires: automake
34 BuildRequires: expat-devel >= 1.95
36 %{?with_dnstap:BuildRequires: fstrm-devel}
37 %{?with_redis:BuildRequires: hiredis-devel}
38 BuildRequires: libevent-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: python-devel >= 1:2.4.0
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 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 Unbound is a validating, recursive, and caching DNS resolver.
60 The C implementation of Unbound is developed and maintained by NLnet
61 Labs. It is based on ideas and algorithms taken from a Java prototype
62 developed by Verisign labs, Nominet, Kirei and ep.net.
64 Unbound is designed as a set of modular components, so that also
65 DNSSEC (secure DNS) validation and stub-resolvers (that do not run as
66 a server, but are linked into an application) are easily possible.
68 %description -l pl.UTF-8
69 Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod
70 rozwiązujący nazwy) DNS.
72 Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet
73 Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z
74 prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz
77 Unbound został zaprojektowany jako zbiór modularnych komponentów, więc
78 możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz
79 resolvery-zaślepki (nie działające jako serwer, ale wbudowane w
83 Summary: Unbound shared library
84 Summary(pl.UTF-8): Biblioteka współdzielona Unbound
86 Conflicts: unbound < 1.4.18-1
89 Unbound shared library.
91 %description libs -l pl.UTF-8
92 Biblioteka współdzielona Unbound.
95 Summary: Header files for unbound library
96 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound
97 Group: Development/Libraries
98 Requires: %{name}-libs = %{version}-%{release}
99 Requires: openssl-devel >= 1.0.0
102 Header files for unbound library.
104 %description devel -l pl.UTF-8
105 Pliki nagłówkowe biblioteki unbound.
108 Summary: Static unbound library
109 Summary(pl.UTF-8): Statyczna biblioteka unbound
110 Group: Development/Libraries
111 Requires: %{name}-devel = %{version}-%{release}
114 Static unbound library.
116 %description static -l pl.UTF-8
117 Statyczna biblioteka unbound.
119 %package -n python-unbound
120 Summary: Python interface to unbound library
121 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound
122 Group: Libraries/Python
123 Requires: %{name}-libs = %{version}-%{release}
125 %description -n python-unbound
126 Python interface to unbound library.
128 %description -n python-unbound -l pl.UTF-8
129 Pythonowy interfejs do biblioteki unbound.
144 %{?with_dnstap:--enable-dnstap} \
145 %{?with_systemd:--enable-systemd} \
146 --with-chroot-dir="" \
147 --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \
148 --with-libevent=/usr \
149 --with-libexpat=/usr \
150 %{?with_redis:--with-libhiredis=/usr} \
151 --with-pidfile=/run/%{name}.pid \
152 %{__with_without python pyunbound} \
153 %{__with_without python pythonmodule} \
154 --with-rootkey-file=/var/lib/%{name}/root.key \
155 --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem
164 rm -rf $RPM_BUILD_ROOT
165 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}}
168 DESTDIR=$RPM_BUILD_ROOT
170 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
171 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
172 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem
173 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache
175 touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key
178 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_unbound.la
179 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
180 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
185 rm -rf $RPM_BUILD_ROOT
188 /sbin/chkconfig --add %{name}
189 %systemd_post %{name}.service
190 %service %{name} restart
193 %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
196 if [ "$1" = "0" ]; then
197 %service -q %{name} stop
198 /sbin/chkconfig --del %{name}
200 %systemd_preun %{name}.service
203 if [ "$1" = "0" ]; then
208 %triggerpostun -- %{name} < 1.4.22-1
209 %systemd_trigger %{name}.service
211 %post libs -p /sbin/ldconfig
212 %postun libs -p /sbin/ldconfig
215 %defattr(644,root,root,755)
216 %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
217 %attr(754,root,root) /etc/rc.d/init.d/unbound
218 %{systemdunitdir}/%{name}.service
219 %dir %{_sysconfdir}/%{name}
220 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
221 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
222 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
223 %attr(755,root,root) %{_sbindir}/unbound
224 %attr(755,root,root) %{_sbindir}/unbound-anchor
225 %attr(755,root,root) %{_sbindir}/unbound-checkconf
226 %attr(755,root,root) %{_sbindir}/unbound-control*
227 %attr(755,root,root) %{_sbindir}/unbound-host
228 %{_mandir}/man1/unbound-host.1*
229 %{_mandir}/man5/unbound.conf.5*
230 %{_mandir}/man8/unbound-checkconf.8*
231 %{_mandir}/man8/unbound.8*
232 %{_mandir}/man8/unbound-anchor.8*
233 %{_mandir}/man8/unbound-control*.8*
234 %dir %attr(755,unbound,nobody) /var/lib/%{name}
235 %ghost /var/lib/%{name}/root.key
238 %defattr(644,root,root,755)
239 %attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
240 %attr(755,root,root) %ghost %{_libdir}/libunbound.so.8
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_libdir}/libunbound.so
245 %{_libdir}/libunbound.la
246 %{_pkgconfigdir}/libunbound.pc
247 %{_includedir}/unbound.h
248 %{_mandir}/man3/libunbound.3*
249 %{_mandir}/man3/ub_*.3*
252 %defattr(644,root,root,755)
253 %{_libdir}/libunbound.a
256 %files -n python-unbound
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{py_sitedir}/_unbound.so*
259 %{py_sitedir}/unbound.py[co]
260 %{py_sitedir}/unboundmodule.py[co]