2 # - stop using nobody group
5 %bcond_without python # Python binding
6 %bcond_with dnstap # dnstap replication support
7 %bcond_with systemd # systemd support
10 Summary: Recursive, validating DNS resolver
11 Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS
16 Group: Applications/Network
17 Source0: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
18 # Source0-md5: 49937b5f99a6fc2de8c5f3bb22a54390
20 Source2: %{name}.service
21 Source3: https://data.iana.org/root-anchors/icannbundle.pem
22 # Source3-md5: 24a426d59b61524623695f1b849f159b
23 Source4: ftp://ftp.internic.net/domain/named.cache
24 # Source4-md5: 6e87fb13229b85feafd9cca631949d92
25 Patch0: %{name}-default_trust_anchor.patch
26 Patch1: %{name}-sh.patch
27 Patch2: %{name}-pythondir.patch
28 Patch3: %{name}-flex.patch
29 URL: http://unbound.net/
30 BuildRequires: autoconf >= 2.56
31 BuildRequires: automake
33 BuildRequires: expat-devel
35 %{?with_dnstap:BuildRequires: fstrm-devel}
36 BuildRequires: libevent-devel
37 BuildRequires: libtool
38 BuildRequires: openssl-devel >= 1.0
39 %{?with_dnstap:BuildRequires: protobuf-c-devel}
40 BuildRequires: rpmbuild(macros) >= 1.671
41 %{?with_systemd:BuildRequires: systemd-devel}
43 BuildRequires: python-devel >= 1:2.4.0
44 BuildRequires: swig-python
46 Provides: user(unbound)
47 Requires(post,preun): /sbin/chkconfig
48 Requires(postun): /usr/sbin/userdel
49 Requires(pre): /bin/id
50 Requires(pre): /usr/sbin/useradd
51 Requires: systemd-units >= 38
52 Requires: %{name}-libs = %{version}-%{release}
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Unbound is a validating, recursive, and caching DNS resolver.
58 The C implementation of Unbound is developed and maintained by NLnet
59 Labs. It is based on ideas and algorithms taken from a Java prototype
60 developed by Verisign labs, Nominet, Kirei and ep.net.
62 Unbound is designed as a set of modular components, so that also
63 DNSSEC (secure DNS) validation and stub-resolvers (that do not run as
64 a server, but are linked into an application) are easily possible.
66 %description -l pl.UTF-8
67 Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod
68 rozwiązujący nazwy) DNS.
70 Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet
71 Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z
72 prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz
75 Unbound został zaprojektowany jako zbiór modularnych komponentów, więc
76 możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz
77 resolvery-zaślepki (nie działające jako serwer, ale wbudowane w
81 Summary: Unbound shared library
82 Summary(pl.UTF-8): Biblioteka współdzielona Unbound
84 Conflicts: unbound < 1.4.18-1
87 Unbound shared library.
89 %description libs -l pl.UTF-8
90 Biblioteka współdzielona Unbound.
93 Summary: Header files for unbound library
94 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound
95 Group: Development/Libraries
96 Requires: %{name}-libs = %{version}-%{release}
97 Requires: openssl-devel
100 Header files for unbound library.
102 %description devel -l pl.UTF-8
103 Pliki nagłówkowe biblioteki unbound.
106 Summary: Static unbound library
107 Summary(pl.UTF-8): Statyczna biblioteka unbound
108 Group: Development/Libraries
109 Requires: %{name}-devel = %{version}-%{release}
112 Static unbound library.
114 %description static -l pl.UTF-8
115 Statyczna biblioteka unbound.
117 %package -n python-unbound
118 Summary: Python interface to unbound library
119 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound
120 Group: Libraries/Python
121 Requires: %{name}-libs = %{version}-%{release}
123 %description -n python-unbound
124 Python interface to unbound library.
126 %description -n python-unbound -l pl.UTF-8
127 Pythonowy interfejs do biblioteki unbound.
142 %{?with_dnstap:--enable-dnstap} \
143 %{?with_systemd:--enable-systemd} \
144 %{__with_without python pyunbound} \
145 %{__with_without python pythonmodule} \
146 --with-pidfile=/run/%{name}.pid \
147 --with-chroot-dir="" \
148 --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \
149 --with-rootkey-file=/var/lib/%{name}/root.key \
150 --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem
159 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}}
163 DESTDIR=$RPM_BUILD_ROOT
165 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
166 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
167 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem
168 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache
170 touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key
173 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_unbound.la
174 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
175 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
180 rm -rf $RPM_BUILD_ROOT
183 /sbin/chkconfig --add %{name}
184 %systemd_post %{name}.service
185 %service %{name} restart
188 %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
191 if [ "$1" = "0" ]; then
192 %service -q %{name} stop
193 /sbin/chkconfig --del %{name}
195 %systemd_preun %{name}.service
198 if [ "$1" = "0" ]; then
203 %triggerpostun -- %{name} < 1.4.22-1
204 %systemd_trigger %{name}.service
206 %post libs -p /sbin/ldconfig
207 %postun libs -p /sbin/ldconfig
210 %defattr(644,root,root,755)
211 %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
212 %attr(754,root,root) /etc/rc.d/init.d/unbound
213 %{systemdunitdir}/%{name}.service
214 %dir %{_sysconfdir}/%{name}
215 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
216 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
217 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
218 %attr(755,root,root) %{_sbindir}/unbound
219 %attr(755,root,root) %{_sbindir}/unbound-anchor
220 %attr(755,root,root) %{_sbindir}/unbound-checkconf
221 %attr(755,root,root) %{_sbindir}/unbound-control*
222 %attr(755,root,root) %{_sbindir}/unbound-host
223 %{_mandir}/man1/unbound-host.1*
224 %{_mandir}/man5/unbound.conf.5*
225 %{_mandir}/man8/unbound-checkconf.8*
226 %{_mandir}/man8/unbound.8*
227 %{_mandir}/man8/unbound-anchor.8*
228 %{_mandir}/man8/unbound-control*.8*
229 %dir %attr(755,unbound,nobody) /var/lib/%{name}
230 %ghost /var/lib/%{name}/root.key
233 %defattr(644,root,root,755)
234 %attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
235 %attr(755,root,root) %ghost %{_libdir}/libunbound.so.2
238 %defattr(644,root,root,755)
239 %attr(755,root,root) %{_libdir}/libunbound.so
240 %{_libdir}/libunbound.la
241 %{_pkgconfigdir}/libunbound.pc
242 %{_includedir}/unbound.h
243 %{_mandir}/man3/libunbound.3*
244 %{_mandir}/man3/ub_*.3*
247 %defattr(644,root,root,755)
248 %{_libdir}/libunbound.a
251 %files -n python-unbound
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{py_sitedir}/_unbound.so*
254 %{py_sitedir}/unbound.py[co]
255 %{py_sitedir}/unboundmodule.py[co]