1 # TODO: dnstap? (BR: protobuf-c-devel, libfstrm -devel)
4 %bcond_without python # Python binding
6 Summary: Recursive, validating DNS resolver
7 Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS
12 Group: Applications/Network
13 Source0: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
14 # Source0-md5: 691a34abd8e9257dd65b70f28326c1f0
16 Source2: %{name}.service
17 Source3: https://data.iana.org/root-anchors/icannbundle.pem
18 # Source3-md5: 1ad315c80d044eca2da29785eee6f7c3
19 Source4: ftp://ftp.internic.net/domain/named.cache
20 # Source4-md5: b2afc34d106e104730b63876c9a07caf
21 Patch0: %{name}-default_trust_anchor.patch
22 Patch1: %{name}-sh.patch
23 URL: http://unbound.net/
24 BuildRequires: autoconf >= 2.56
25 BuildRequires: automake
26 BuildRequires: expat-devel
27 BuildRequires: libevent-devel
28 BuildRequires: libtool
29 BuildRequires: openssl-devel >= 1.0
30 BuildRequires: rpmbuild(macros) >= 1.228
32 BuildRequires: python-devel >= 1:2.4.0
33 BuildRequires: swig-python
35 Requires(post,preun): /sbin/chkconfig
36 BuildRequires: rpmbuild(macros) >= 1.671
37 Provides: user(unbound)
38 Requires(postun): /usr/sbin/userdel
39 Requires(pre): /bin/id
40 Requires(pre): /usr/sbin/useradd
41 Requires: systemd-units >= 38
42 Requires: %{name}-libs = %{version}-%{release}
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 Unbound is a validating, recursive, and caching DNS resolver.
48 The C implementation of Unbound is developed and maintained by NLnet
49 Labs. It is based on ideas and algorithms taken from a Java prototype
50 developed by Verisign labs, Nominet, Kirei and ep.net.
52 Unbound is designed as a set of modular components, so that also
53 DNSSEC (secure DNS) validation and stub-resolvers (that do not run as
54 a server, but are linked into an application) are easily possible.
56 %description -l pl.UTF-8
57 Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod
58 rozwiązujący nazwy) DNS.
60 Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet
61 Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z
62 prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz
65 Unbound został zaprojektowany jako zbiór modularnych komponentów, więc
66 możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz
67 resolvery-zaślepki (nie działające jako serwer, ale wbudowane w
71 Summary: Unbound shared library
72 Summary(pl.UTF-8): Biblioteka współdzielona Unbound
74 Conflicts: unbound < 1.4.18-1
77 Unbound shared library.
79 %description libs -l pl.UTF-8
80 Biblioteka współdzielona Unbound.
83 Summary: Header files for unbound library
84 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound
85 Group: Development/Libraries
86 Requires: %{name}-libs = %{version}-%{release}
87 Requires: openssl-devel
90 Header files for unbound library.
92 %description devel -l pl.UTF-8
93 Pliki nagłówkowe biblioteki unbound.
96 Summary: Static unbound library
97 Summary(pl.UTF-8): Statyczna biblioteka unbound
98 Group: Development/Libraries
99 Requires: %{name}-devel = %{version}-%{release}
102 Static unbound library.
104 %description static -l pl.UTF-8
105 Statyczna biblioteka unbound.
107 %package -n python-unbound
108 Summary: Python interface to unbound library
109 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound
110 Group: Python/Libraries
111 Requires: %{name}-libs = %{version}-%{release}
113 %description -n python-unbound
114 Python interface to unbound library.
116 %description -n python-unbound -l pl.UTF-8
117 Pythonowy interfejs do biblioteki unbound.
130 %{__with_without python pyunbound} \
131 %{__with_without python pythonmodule} \
132 --with-pidfile=/run/%{name}.pid \
133 --with-chroot-dir="" \
134 --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \
135 --with-rootkey-file=/var/lib/%{name}/root.key \
136 --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem
141 rm -rf $RPM_BUILD_ROOT
142 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}}
145 DESTDIR=$RPM_BUILD_ROOT
147 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
148 install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
149 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem
150 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache
152 touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key
155 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_unbound.la
156 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
157 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
162 rm -rf $RPM_BUILD_ROOT
165 /sbin/chkconfig --add %{name}
166 %systemd_post %{name}.service
167 %service %{name} restart
170 %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
173 if [ "$1" = "0" ]; then
174 %service -q %{name} stop
175 /sbin/chkconfig --del %{name}
177 %systemd_preun %{name}.service
180 if [ "$1" = "0" ]; then
185 %triggerpostun -- %{name} < 1.4.22-1
186 %systemd_trigger %{name}.service
188 %post libs -p /sbin/ldconfig
189 %postun libs -p /sbin/ldconfig
192 %defattr(644,root,root,755)
193 %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
194 %attr(754,root,root) /etc/rc.d/init.d/unbound
195 %{systemdunitdir}/%{name}.service
196 %dir %{_sysconfdir}/%{name}
197 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
198 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
199 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
200 %attr(755,root,root) %{_sbindir}/unbound
201 %attr(755,root,root) %{_sbindir}/unbound-anchor
202 %attr(755,root,root) %{_sbindir}/unbound-checkconf
203 %attr(755,root,root) %{_sbindir}/unbound-control*
204 %attr(755,root,root) %{_sbindir}/unbound-host
205 %{_mandir}/man1/unbound-host.1*
206 %{_mandir}/man5/unbound.conf.5*
207 %{_mandir}/man8/unbound-checkconf.8*
208 %{_mandir}/man8/unbound.8*
209 %{_mandir}/man8/unbound-anchor.8*
210 %{_mandir}/man8/unbound-control*.8*
211 %dir %attr(755,unbound,nobody) /var/lib/%{name}
212 %ghost /var/lib/%{name}/root.key
215 %defattr(644,root,root,755)
216 %attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
217 %attr(755,root,root) %ghost %{_libdir}/libunbound.so.2
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_libdir}/libunbound.so
222 %{_libdir}/libunbound.la
223 %{_includedir}/unbound.h
224 %{_mandir}/man3/libunbound.3*
225 %{_mandir}/man3/ub_*.3*
228 %defattr(644,root,root,755)
229 %{_libdir}/libunbound.a
232 %files -n python-unbound
233 %defattr(644,root,root,755)
234 %attr(755,root,root) %{py_sitedir}/_unbound.so*
235 %{py_sitedir}/unbound.py[co]
236 %{py_sitedir}/unboundmodule.py[co]