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