]>
Commit | Line | Data |
---|---|---|
1 | # FIXME: | |
2 | # - stop using nobody group | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without python # Python binding | |
6 | %bcond_with dnstap # dnstap replication support | |
7 | %bcond_with redis # cachedb support for redis (using hiredis) | |
8 | %bcond_with systemd # systemd support | |
9 | %bcond_without tests # unit tests | |
10 | # | |
11 | Summary: Recursive, validating DNS resolver | |
12 | Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS | |
13 | Name: unbound | |
14 | Version: 1.9.4 | |
15 | Release: 1 | |
16 | License: BSD | |
17 | Group: Applications/Network | |
18 | Source0: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz | |
19 | # Source0-md5: c4d6305f6187deca9e579d4cc5abeaea | |
20 | Source1: %{name}.init | |
21 | Source2: %{name}.service | |
22 | Source3: https://data.iana.org/root-anchors/icannbundle.pem | |
23 | # Source3-md5: 24a426d59b61524623695f1b849f159b | |
24 | Source4: ftp://ftp.internic.net/domain/named.cache | |
25 | # Source4-md5: dae96030c23cfe108333680564b65b7f | |
26 | Patch0: %{name}-default_trust_anchor.patch | |
27 | Patch1: %{name}-sh.patch | |
28 | Patch2: %{name}-pythondir.patch | |
29 | Patch3: %{name}-flex.patch | |
30 | URL: http://unbound.net/ | |
31 | BuildRequires: autoconf >= 2.56 | |
32 | BuildRequires: automake | |
33 | BuildRequires: bison | |
34 | BuildRequires: expat-devel >= 1.95 | |
35 | BuildRequires: flex | |
36 | %{?with_dnstap:BuildRequires: fstrm-devel} | |
37 | %{?with_redis:BuildRequires: hiredis-devel} | |
38 | BuildRequires: libevent-devel | |
39 | BuildRequires: libtool | |
40 | BuildRequires: openssl-devel >= 1.0.0 | |
41 | %{?with_dnstap:BuildRequires: protobuf-c-devel} | |
42 | BuildRequires: rpmbuild(macros) >= 1.671 | |
43 | %{?with_systemd:BuildRequires: systemd-devel} | |
44 | %if %{with python} | |
45 | BuildRequires: python-devel >= 1:2.4.0 | |
46 | BuildRequires: swig-python >= 2.0.1 | |
47 | %endif | |
48 | Provides: user(unbound) | |
49 | Requires(post,preun): /sbin/chkconfig | |
50 | Requires(postun): /usr/sbin/userdel | |
51 | Requires(pre): /bin/id | |
52 | Requires(pre): /usr/sbin/useradd | |
53 | Requires: systemd-units >= 38 | |
54 | Requires: %{name}-libs = %{version}-%{release} | |
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 | |
61 | Labs. It is based on ideas and algorithms taken from a Java prototype | |
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 | ||
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 | ||
94 | %package devel | |
95 | Summary: Header files for unbound library | |
96 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound | |
97 | Group: Development/Libraries | |
98 | Requires: %{name}-libs = %{version}-%{release} | |
99 | Requires: openssl-devel >= 1.0.0 | |
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 | ||
119 | %package -n python-unbound | |
120 | Summary: Python interface to unbound library | |
121 | Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound | |
122 | Group: Libraries/Python | |
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 | ||
131 | %prep | |
132 | %setup -q | |
133 | %patch0 -p1 | |
134 | %patch1 -p1 | |
135 | %patch2 -p1 | |
136 | %patch3 -p1 | |
137 | ||
138 | %build | |
139 | %{__libtoolize} | |
140 | %{__aclocal} | |
141 | %{__autoconf} | |
142 | %{__autoheader} | |
143 | %configure \ | |
144 | %{?with_dnstap:--enable-dnstap} \ | |
145 | %{?with_systemd:--enable-systemd} \ | |
146 | --with-chroot-dir="" \ | |
147 | --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \ | |
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} \ | |
154 | --with-rootkey-file=/var/lib/%{name}/root.key \ | |
155 | --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem | |
156 | ||
157 | %{__make} | |
158 | ||
159 | %if %{with tests} | |
160 | %{__make} check | |
161 | %endif | |
162 | ||
163 | %install | |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}} | |
166 | ||
167 | %{__make} install \ | |
168 | DESTDIR=$RPM_BUILD_ROOT | |
169 | ||
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 | |
174 | ||
175 | touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key | |
176 | ||
177 | %if %{with python} | |
178 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_unbound.la | |
179 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
180 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
181 | %py_postclean | |
182 | %endif | |
183 | ||
184 | %clean | |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
187 | %post | |
188 | /sbin/chkconfig --add %{name} | |
189 | %systemd_post %{name}.service | |
190 | %service %{name} restart | |
191 | ||
192 | %pre | |
193 | %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound | |
194 | ||
195 | %preun | |
196 | if [ "$1" = "0" ]; then | |
197 | %service -q %{name} stop | |
198 | /sbin/chkconfig --del %{name} | |
199 | fi | |
200 | %systemd_preun %{name}.service | |
201 | ||
202 | %postun | |
203 | if [ "$1" = "0" ]; then | |
204 | %userremove unbound | |
205 | fi | |
206 | %systemd_reload | |
207 | ||
208 | %triggerpostun -- %{name} < 1.4.22-1 | |
209 | %systemd_trigger %{name}.service | |
210 | ||
211 | %post libs -p /sbin/ldconfig | |
212 | %postun libs -p /sbin/ldconfig | |
213 | ||
214 | %files | |
215 | %defattr(644,root,root,755) | |
216 | %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt} | |
217 | %attr(754,root,root) /etc/rc.d/init.d/unbound | |
218 | %{systemdunitdir}/%{name}.service | |
219 | %dir %{_sysconfdir}/%{name} | |
220 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf | |
221 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache | |
222 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem | |
223 | %attr(755,root,root) %{_sbindir}/unbound | |
224 | %attr(755,root,root) %{_sbindir}/unbound-anchor | |
225 | %attr(755,root,root) %{_sbindir}/unbound-checkconf | |
226 | %attr(755,root,root) %{_sbindir}/unbound-control* | |
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* | |
232 | %{_mandir}/man8/unbound-anchor.8* | |
233 | %{_mandir}/man8/unbound-control*.8* | |
234 | %dir %attr(755,unbound,nobody) /var/lib/%{name} | |
235 | %ghost /var/lib/%{name}/root.key | |
236 | ||
237 | %files libs | |
238 | %defattr(644,root,root,755) | |
239 | %attr(755,root,root) %{_libdir}/libunbound.so.*.*.* | |
240 | %attr(755,root,root) %ghost %{_libdir}/libunbound.so.8 | |
241 | ||
242 | %files devel | |
243 | %defattr(644,root,root,755) | |
244 | %attr(755,root,root) %{_libdir}/libunbound.so | |
245 | %{_libdir}/libunbound.la | |
246 | %{_pkgconfigdir}/libunbound.pc | |
247 | %{_includedir}/unbound.h | |
248 | %{_mandir}/man3/libunbound.3* | |
249 | %{_mandir}/man3/ub_*.3* | |
250 | ||
251 | %files static | |
252 | %defattr(644,root,root,755) | |
253 | %{_libdir}/libunbound.a | |
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] | |
260 | %{py_sitedir}/unboundmodule.py[co] | |
261 | %endif |