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