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