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