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