]>
Commit | Line | Data |
---|---|---|
ca75cd40 | 1 | # |
89d05c6c JB |
2 | # Conditional build: |
3 | %bcond_without python # Python binding | |
60c650ce | 4 | %bcond_with dnstap # dnstap replication support |
2b3ec506 | 5 | %bcond_with systemd # systemd support |
d970dbd1 | 6 | %bcond_without tests |
89d05c6c JB |
7 | # |
8 | Summary: Recursive, validating DNS resolver | |
9 | Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS | |
ca75cd40 | 10 | Name: unbound |
4b05911c | 11 | Version: 1.6.8 |
d970dbd1 | 12 | Release: 3 |
ca75cd40 | 13 | License: BSD |
89d05c6c | 14 | Group: Applications/Network |
ca75cd40 | 15 | Source0: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz |
4b05911c | 16 | # Source0-md5: c9d26cef224b10705229d5072142636c |
cda91157 | 17 | Source1: %{name}.init |
0ddfe461 JK |
18 | Source2: %{name}.service |
19 | Source3: https://data.iana.org/root-anchors/icannbundle.pem | |
032fe745 | 20 | # Source3-md5: 24a426d59b61524623695f1b849f159b |
0ddfe461 | 21 | Source4: ftp://ftp.internic.net/domain/named.cache |
4b05911c | 22 | # Source4-md5: f4a35c0015a679d1605c18d40aad7506 |
b53232e5 | 23 | Patch0: %{name}-default_trust_anchor.patch |
f33b27d4 | 24 | Patch1: %{name}-sh.patch |
05a660e9 | 25 | Patch2: %{name}-pythondir.patch |
2b3ec506 | 26 | Patch3: %{name}-flex.patch |
e30ec7d4 | 27 | Patch4: unbound-bug-3512.patch |
ca75cd40 | 28 | URL: http://unbound.net/ |
f33b27d4 JB |
29 | BuildRequires: autoconf >= 2.56 |
30 | BuildRequires: automake | |
2b3ec506 | 31 | BuildRequires: bison |
89d05c6c | 32 | BuildRequires: expat-devel |
2b3ec506 | 33 | BuildRequires: flex |
60c650ce | 34 | %{?with_dnstap:BuildRequires: fstrm-devel} |
5ec53429 | 35 | BuildRequires: libevent-devel |
f33b27d4 JB |
36 | BuildRequires: libtool |
37 | BuildRequires: openssl-devel >= 1.0 | |
60c650ce | 38 | %{?with_dnstap:BuildRequires: protobuf-c-devel} |
2b3ec506 JB |
39 | BuildRequires: rpmbuild(macros) >= 1.671 |
40 | %{?with_systemd:BuildRequires: systemd-devel} | |
89d05c6c JB |
41 | %if %{with python} |
42 | BuildRequires: python-devel >= 1:2.4.0 | |
43 | BuildRequires: swig-python | |
44 | %endif | |
5946fd51 | 45 | Provides: user(unbound) |
2b3ec506 | 46 | Requires(post,preun): /sbin/chkconfig |
5946fd51 AM |
47 | Requires(postun): /usr/sbin/userdel |
48 | Requires(pre): /bin/id | |
49 | Requires(pre): /usr/sbin/useradd | |
0ddfe461 | 50 | Requires: systemd-units >= 38 |
89d05c6c | 51 | Requires: %{name}-libs = %{version}-%{release} |
ca75cd40 | 52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
53 | ||
54 | %description | |
55 | Unbound is a validating, recursive, and caching DNS resolver. | |
56 | ||
57 | The C implementation of Unbound is developed and maintained by NLnet | |
89d05c6c | 58 | Labs. It is based on ideas and algorithms taken from a Java prototype |
ca75cd40 | 59 | developed by Verisign labs, Nominet, Kirei and ep.net. |
60 | ||
61 | Unbound is designed as a set of modular components, so that also | |
62 | DNSSEC (secure DNS) validation and stub-resolvers (that do not run as | |
63 | a server, but are linked into an application) are easily possible. | |
64 | ||
89d05c6c JB |
65 | %description -l pl.UTF-8 |
66 | Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod | |
67 | rozwiązujący nazwy) DNS. | |
68 | ||
69 | Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet | |
70 | Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z | |
71 | prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz | |
72 | ep.net. | |
73 | ||
74 | Unbound został zaprojektowany jako zbiór modularnych komponentów, więc | |
75 | możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz | |
76 | resolvery-zaślepki (nie działające jako serwer, ale wbudowane w | |
77 | aplikację). | |
78 | ||
79 | %package libs | |
80 | Summary: Unbound shared library | |
81 | Summary(pl.UTF-8): Biblioteka współdzielona Unbound | |
82 | Group: Libraries | |
83 | Conflicts: unbound < 1.4.18-1 | |
84 | ||
85 | %description libs | |
86 | Unbound shared library. | |
87 | ||
88 | %description libs -l pl.UTF-8 | |
89 | Biblioteka współdzielona Unbound. | |
90 | ||
ca75cd40 | 91 | %package devel |
92 | Summary: Header files for unbound library | |
93 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound | |
94 | Group: Development/Libraries | |
89d05c6c | 95 | Requires: %{name}-libs = %{version}-%{release} |
89d05c6c | 96 | Requires: openssl-devel |
ca75cd40 | 97 | |
98 | %description devel | |
99 | Header files for unbound library. | |
100 | ||
101 | %description devel -l pl.UTF-8 | |
102 | Pliki nagłówkowe biblioteki unbound. | |
103 | ||
104 | %package static | |
105 | Summary: Static unbound library | |
106 | Summary(pl.UTF-8): Statyczna biblioteka unbound | |
107 | Group: Development/Libraries | |
108 | Requires: %{name}-devel = %{version}-%{release} | |
109 | ||
110 | %description static | |
111 | Static unbound library. | |
112 | ||
113 | %description static -l pl.UTF-8 | |
114 | Statyczna biblioteka unbound. | |
115 | ||
89d05c6c JB |
116 | %package -n python-unbound |
117 | Summary: Python interface to unbound library | |
118 | Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound | |
119 | Group: Python/Libraries | |
120 | Requires: %{name}-libs = %{version}-%{release} | |
121 | ||
122 | %description -n python-unbound | |
123 | Python interface to unbound library. | |
124 | ||
125 | %description -n python-unbound -l pl.UTF-8 | |
126 | Pythonowy interfejs do biblioteki unbound. | |
127 | ||
ca75cd40 | 128 | %prep |
129 | %setup -q | |
b53232e5 | 130 | %patch0 -p1 |
f33b27d4 | 131 | %patch1 -p1 |
05a660e9 | 132 | %patch2 -p1 |
2b3ec506 | 133 | %patch3 -p1 |
e30ec7d4 | 134 | %patch4 -p1 |
ca75cd40 | 135 | |
136 | %build | |
f33b27d4 JB |
137 | %{__libtoolize} |
138 | %{__aclocal} | |
139 | %{__autoconf} | |
140 | %{__autoheader} | |
89d05c6c | 141 | %configure \ |
60c650ce | 142 | %{?with_dnstap:--enable-dnstap} \ |
2b3ec506 | 143 | %{?with_systemd:--enable-systemd} \ |
e5f6e160 JK |
144 | %{__with_without python pyunbound} \ |
145 | %{__with_without python pythonmodule} \ | |
0ddfe461 | 146 | --with-pidfile=/run/%{name}.pid \ |
267353b4 | 147 | --with-chroot-dir="" \ |
0ddfe461 JK |
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 | |
151 | ||
ca75cd40 | 152 | %{__make} |
153 | ||
154 | %install | |
155 | rm -rf $RPM_BUILD_ROOT | |
0ddfe461 | 156 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}} |
ca75cd40 | 157 | |
158 | %{__make} install \ | |
159 | DESTDIR=$RPM_BUILD_ROOT | |
160 | ||
0ddfe461 JK |
161 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
162 | install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service | |
163 | install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem | |
164 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache | |
165 | ||
166 | touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key | |
167 | ||
89d05c6c | 168 | %if %{with python} |
42c66384 | 169 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_unbound.la |
89d05c6c JB |
170 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
171 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
172 | %py_postclean | |
173 | %endif | |
174 | ||
d970dbd1 AM |
175 | %if %{with tests} |
176 | %{__make} check | |
177 | %endif | |
178 | ||
ca75cd40 | 179 | %clean |
180 | rm -rf $RPM_BUILD_ROOT | |
181 | ||
ca75cd40 | 182 | %post |
183 | /sbin/chkconfig --add %{name} | |
0ddfe461 | 184 | %systemd_post %{name}.service |
ca75cd40 | 185 | %service %{name} restart |
186 | ||
5c77fe31 AM |
187 | %pre |
188 | %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound | |
189 | ||
ca75cd40 | 190 | %preun |
191 | if [ "$1" = "0" ]; then | |
192 | %service -q %{name} stop | |
193 | /sbin/chkconfig --del %{name} | |
194 | fi | |
0ddfe461 | 195 | %systemd_preun %{name}.service |
ca75cd40 | 196 | |
5c77fe31 AM |
197 | %postun |
198 | if [ "$1" = "0" ]; then | |
199 | %userremove unbound | |
200 | fi | |
0ddfe461 JK |
201 | %systemd_reload |
202 | ||
203 | %triggerpostun -- %{name} < 1.4.22-1 | |
204 | %systemd_trigger %{name}.service | |
5c77fe31 | 205 | |
89d05c6c JB |
206 | %post libs -p /sbin/ldconfig |
207 | %postun libs -p /sbin/ldconfig | |
208 | ||
ca75cd40 | 209 | %files |
210 | %defattr(644,root,root,755) | |
89d05c6c | 211 | %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt} |
cda91157 | 212 | %attr(754,root,root) /etc/rc.d/init.d/unbound |
0ddfe461 | 213 | %{systemdunitdir}/%{name}.service |
783ab43a | 214 | %dir %{_sysconfdir}/%{name} |
215 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf | |
0ddfe461 JK |
216 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache |
217 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem | |
ca75cd40 | 218 | %attr(755,root,root) %{_sbindir}/unbound |
511c7cae | 219 | %attr(755,root,root) %{_sbindir}/unbound-anchor |
ca75cd40 | 220 | %attr(755,root,root) %{_sbindir}/unbound-checkconf |
5ec53429 | 221 | %attr(755,root,root) %{_sbindir}/unbound-control* |
ca75cd40 | 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* | |
511c7cae | 227 | %{_mandir}/man8/unbound-anchor.8* |
379d3e5e | 228 | %{_mandir}/man8/unbound-control*.8* |
0ddfe461 JK |
229 | %dir %attr(755,unbound,nobody) /var/lib/%{name} |
230 | %ghost /var/lib/%{name}/root.key | |
ca75cd40 | 231 | |
89d05c6c JB |
232 | %files libs |
233 | %defattr(644,root,root,755) | |
234 | %attr(755,root,root) %{_libdir}/libunbound.so.*.*.* | |
235 | %attr(755,root,root) %ghost %{_libdir}/libunbound.so.2 | |
236 | ||
ca75cd40 | 237 | %files devel |
cda91157 | 238 | %defattr(644,root,root,755) |
89d05c6c | 239 | %attr(755,root,root) %{_libdir}/libunbound.so |
ca75cd40 | 240 | %{_libdir}/libunbound.la |
89d05c6c | 241 | %{_includedir}/unbound.h |
ca75cd40 | 242 | %{_mandir}/man3/libunbound.3* |
44b158d7 | 243 | %{_mandir}/man3/ub_*.3* |
ca75cd40 | 244 | |
245 | %files static | |
cda91157 | 246 | %defattr(644,root,root,755) |
ca75cd40 | 247 | %{_libdir}/libunbound.a |
89d05c6c JB |
248 | |
249 | %if %{with python} | |
250 | %files -n python-unbound | |
251 | %defattr(644,root,root,755) | |
252 | %attr(755,root,root) %{py_sitedir}/_unbound.so* | |
253 | %{py_sitedir}/unbound.py[co] | |
d1474b1b | 254 | %{py_sitedir}/unboundmodule.py[co] |
89d05c6c | 255 | %endif |