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