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