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