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