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