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