]> git.pld-linux.org Git - packages/unbound.git/blob - unbound.spec
BR: python3-modules for %py3_*comp
[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.17.1
16 Release:        1
17 License:        BSD
18 Group:          Applications/Network
19 Source0:        https://www.unbound.net/downloads/%{name}-%{version}.tar.gz
20 # Source0-md5:  bb96df2dc579c11ada537dbc52781abc
21 Source1:        %{name}.init
22 Source2:        %{name}.service
23 Source3:        https://data.iana.org/root-anchors/icannbundle.pem
24 # Source3-md5:  d00ef4e253e99e93ee020da5ad5e7d9a
25 Source4:        ftp://ftp.internic.net/domain/named.cache
26 # Source4-md5:  12ecc90635bdb36e2c50e83f1e0dcb90
27 Patch0:         %{name}-default_trust_anchor.patch
28 Patch1:         %{name}-sh.patch
29 URL:            http://unbound.net/
30 BuildRequires:  autoconf >= 2.56
31 BuildRequires:  automake
32 BuildRequires:  bison
33 BuildRequires:  expat-devel >= 1.95
34 BuildRequires:  flex
35 %{?with_dnstap:BuildRequires:   fstrm-devel}
36 %{?with_redis:BuildRequires:    hiredis-devel}
37 BuildRequires:  libevent-devel
38 %{?with_dnscrypt:BuildRequires: libsodium-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:  python3-devel
46 BuildRequires:  python3-modules
47 BuildRequires:  swig-python >= 2.0.1
48 %endif
49 Provides:       user(unbound)
50 Requires(post,preun):   /sbin/chkconfig
51 Requires(postun):       /usr/sbin/userdel
52 Requires(pre):  /bin/id
53 Requires(pre):  /usr/sbin/useradd
54 Requires:       systemd-units >= 38
55 Requires:       %{name}-libs = %{version}-%{release}
56 Suggests:       openssl-tools
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 python3-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 Obsoletes:      python-unbound < 1.13.1-2
127
128 %description -n python3-unbound
129 Python interface to unbound library.
130
131 %description -n python3-unbound -l pl.UTF-8
132 Pythonowy interfejs do biblioteki unbound.
133
134 %prep
135 %setup -q
136 %patch0 -p1
137 %patch1 -p1
138
139 %build
140 %{__libtoolize}
141 %{__aclocal}
142 %{__autoconf}
143 %{__autoheader}
144 %configure \
145         PYTHON=%{__python3} \
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%{py3_sitedir}/_unbound.la
185 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
186 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
187 %endif
188
189 %clean
190 rm -rf $RPM_BUILD_ROOT
191
192 %post
193 /sbin/chkconfig --add %{name}
194 %systemd_post %{name}.service
195 %service %{name} restart
196
197 %pre
198 %useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
199
200 %preun
201 if [ "$1" = "0" ]; then
202         %service -q %{name} stop
203         /sbin/chkconfig --del %{name}
204 fi
205 %systemd_preun %{name}.service
206
207 %postun
208 if [ "$1" = "0" ]; then
209         %userremove unbound
210 fi
211 %systemd_reload
212
213 %triggerpostun -- %{name} < 1.4.22-1
214 %systemd_trigger %{name}.service
215
216 %post   libs -p /sbin/ldconfig
217 %postun libs -p /sbin/ldconfig
218
219 %files
220 %defattr(644,root,root,755)
221 %doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
222 %attr(754,root,root) /etc/rc.d/init.d/unbound
223 %{systemdunitdir}/%{name}.service
224 %attr(751,unbound,root) %dir %{_sysconfdir}/%{name}
225 %attr(640,unbound,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
226 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
227 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
228 %attr(755,root,root) %{_sbindir}/unbound
229 %attr(755,root,root) %{_sbindir}/unbound-anchor
230 %attr(755,root,root) %{_sbindir}/unbound-checkconf
231 %attr(755,root,root) %{_sbindir}/unbound-control*
232 %attr(755,root,root) %{_sbindir}/unbound-host
233 %{_mandir}/man1/unbound-host.1*
234 %{_mandir}/man5/unbound.conf.5*
235 %{_mandir}/man8/unbound-checkconf.8*
236 %{_mandir}/man8/unbound.8*
237 %{_mandir}/man8/unbound-anchor.8*
238 %{_mandir}/man8/unbound-control*.8*
239 %dir %attr(755,unbound,nobody) /var/lib/%{name}
240 %ghost /var/lib/%{name}/root.key
241
242 %files libs
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
245 %attr(755,root,root) %ghost %{_libdir}/libunbound.so.8
246
247 %files devel
248 %defattr(644,root,root,755)
249 %attr(755,root,root) %{_libdir}/libunbound.so
250 %{_pkgconfigdir}/libunbound.pc
251 %{_includedir}/unbound.h
252 %{_mandir}/man3/libunbound.3*
253 %{_mandir}/man3/ub_*.3*
254
255 %files static
256 %defattr(644,root,root,755)
257 %{_libdir}/libunbound.a
258
259 %if %{with python}
260 %files -n python3-unbound
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{py3_sitedir}/_unbound.so*
263 %{py3_sitedir}/__pycache__/unbound*.pyc
264 %{py3_sitedir}/unbound.py
265 %{py3_sitedir}/unboundmodule.py
266 %endif
This page took 0.12636 seconds and 4 git commands to generate.