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