]> git.pld-linux.org Git - packages/unbound.git/blame - unbound.spec
Make python bcond more reliable
[packages/unbound.git] / unbound.spec
CommitLineData
ca75cd40 1#
89d05c6c
JB
2# Conditional build:
3%bcond_without python # Python binding
4#
5Summary: Recursive, validating DNS resolver
6Summary(pl.UTF-8): Rekurencyjny, weryfikujący resolver DNS
ca75cd40 7Name: unbound
9b986388 8Version: 1.5.3
6cbb45bd 9Release: 1
ca75cd40 10License: BSD
89d05c6c 11Group: Applications/Network
ca75cd40 12Source0: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
9b986388 13# Source0-md5: 1e95fdcbaaf5dc87432d898006a5eb13
cda91157 14Source1: %{name}.init
0ddfe461
JK
15Source2: %{name}.service
16Source3: https://data.iana.org/root-anchors/icannbundle.pem
17# Source3-md5: 59774aba58dbde1049bdf4722fb4f02c
18Source4: ftp://ftp.internic.net/domain/named.cache
42c66384 19# Source4-md5: 89241448b08af70dd5715e7ef12d71f6
b53232e5 20Patch0: %{name}-default_trust_anchor.patch
ca75cd40 21URL: http://unbound.net/
89d05c6c 22BuildRequires: expat-devel
5ec53429 23BuildRequires: libevent-devel
89d05c6c 24BuildRequires: openssl-devel
ca75cd40 25BuildRequires: rpmbuild(macros) >= 1.228
89d05c6c
JB
26%if %{with python}
27BuildRequires: python-devel >= 1:2.4.0
28BuildRequires: swig-python
29%endif
ca75cd40 30Requires(post,preun): /sbin/chkconfig
0ddfe461 31BuildRequires: rpmbuild(macros) >= 1.671
5946fd51
AM
32Provides: user(unbound)
33Requires(postun): /usr/sbin/userdel
34Requires(pre): /bin/id
35Requires(pre): /usr/sbin/useradd
0ddfe461 36Requires: systemd-units >= 38
89d05c6c 37Requires: %{name}-libs = %{version}-%{release}
ca75cd40 38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
41Unbound is a validating, recursive, and caching DNS resolver.
42
43The C implementation of Unbound is developed and maintained by NLnet
89d05c6c 44Labs. It is based on ideas and algorithms taken from a Java prototype
ca75cd40 45developed by Verisign labs, Nominet, Kirei and ep.net.
46
47Unbound is designed as a set of modular components, so that also
48DNSSEC (secure DNS) validation and stub-resolvers (that do not run as
49a server, but are linked into an application) are easily possible.
50
89d05c6c
JB
51%description -l pl.UTF-8
52Unbound to weryfikujący, rekurencyjny i cache'ujący resolver (kod
53rozwiązujący nazwy) DNS.
54
55Implementacja Unbound w C jest tworzona i utrzymywana przez NLnet
56Labs. Jest oparta na pomysłach i algorytmach zaczerpniętych z
57prototypu w Javie stworzonego przez Verisign Labs, Nominet, Kirei oraz
58ep.net.
59
60Unbound został zaprojektowany jako zbiór modularnych komponentów, więc
61możliwe są także weryfikacja DNSSEC (bezpieczny DNS) oraz
62resolvery-zaślepki (nie działające jako serwer, ale wbudowane w
63aplikację).
64
65%package libs
66Summary: Unbound shared library
67Summary(pl.UTF-8): Biblioteka współdzielona Unbound
68Group: Libraries
69Conflicts: unbound < 1.4.18-1
70
71%description libs
72Unbound shared library.
73
74%description libs -l pl.UTF-8
75Biblioteka współdzielona Unbound.
76
ca75cd40 77%package devel
78Summary: Header files for unbound library
79Summary(pl.UTF-8): Pliki nagłówkowe biblioteki unbound
80Group: Development/Libraries
89d05c6c 81Requires: %{name}-libs = %{version}-%{release}
89d05c6c 82Requires: openssl-devel
ca75cd40 83
84%description devel
85Header files for unbound library.
86
87%description devel -l pl.UTF-8
88Pliki nagłówkowe biblioteki unbound.
89
90%package static
91Summary: Static unbound library
92Summary(pl.UTF-8): Statyczna biblioteka unbound
93Group: Development/Libraries
94Requires: %{name}-devel = %{version}-%{release}
95
96%description static
97Static unbound library.
98
99%description static -l pl.UTF-8
100Statyczna biblioteka unbound.
101
89d05c6c
JB
102%package -n python-unbound
103Summary: Python interface to unbound library
104Summary(pl.UTF-8): Pythonowy interfejs do biblioteki unbound
105Group: Python/Libraries
106Requires: %{name}-libs = %{version}-%{release}
107
108%description -n python-unbound
109Python interface to unbound library.
110
111%description -n python-unbound -l pl.UTF-8
112Pythonowy interfejs do biblioteki unbound.
113
ca75cd40 114%prep
115%setup -q
b53232e5 116%patch0 -p1
ca75cd40 117
118%build
89d05c6c 119%configure \
e5f6e160
JK
120 %{__with_without python pyunbound} \
121 %{__with_without python pythonmodule} \
0ddfe461 122 --with-pidfile=/run/%{name}.pid \
267353b4 123 --with-chroot-dir="" \
0ddfe461
JK
124 --with-conf-file=%{_sysconfdir}/%{name}/%{name}.conf \
125 --with-rootkey-file=/var/lib/%{name}/root.key \
126 --with-rootcert-file=%{_sysconfdir}/%{name}/icannbundle.pem
127
ca75cd40 128%{__make}
129
130%install
131rm -rf $RPM_BUILD_ROOT
0ddfe461 132install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},/var/lib/%{name}}
ca75cd40 133
134%{__make} install \
135 DESTDIR=$RPM_BUILD_ROOT
136
0ddfe461
JK
137install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
138install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
139install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/icannbundle.pem
140install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/named.cache
141
142touch $RPM_BUILD_ROOT/var/lib/%{name}/root.key
143
89d05c6c 144%if %{with python}
42c66384 145%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_unbound.la
89d05c6c
JB
146%py_comp $RPM_BUILD_ROOT%{py_sitedir}
147%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
148%py_postclean
149%endif
150
ca75cd40 151%clean
152rm -rf $RPM_BUILD_ROOT
153
ca75cd40 154%post
155/sbin/chkconfig --add %{name}
0ddfe461 156%systemd_post %{name}.service
ca75cd40 157%service %{name} restart
158
5c77fe31
AM
159%pre
160%useradd -u 196 -g 99 -d /tmp -s /bin/false -c "unbound user" unbound
161
ca75cd40 162%preun
163if [ "$1" = "0" ]; then
164 %service -q %{name} stop
165 /sbin/chkconfig --del %{name}
166fi
0ddfe461 167%systemd_preun %{name}.service
ca75cd40 168
5c77fe31
AM
169%postun
170if [ "$1" = "0" ]; then
171 %userremove unbound
172fi
0ddfe461
JK
173%systemd_reload
174
175%triggerpostun -- %{name} < 1.4.22-1
176%systemd_trigger %{name}.service
5c77fe31 177
89d05c6c
JB
178%post libs -p /sbin/ldconfig
179%postun libs -p /sbin/ldconfig
180
ca75cd40 181%files
182%defattr(644,root,root,755)
89d05c6c 183%doc doc/{CREDITS,Changelog,FEATURES,LICENSE,README,TODO,control_proto_spec.txt,example.conf,ietf67-design-02.pdf,requirements.txt}
cda91157 184%attr(754,root,root) /etc/rc.d/init.d/unbound
0ddfe461 185%{systemdunitdir}/%{name}.service
783ab43a 186%dir %{_sysconfdir}/%{name}
187%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unbound.conf
0ddfe461
JK
188%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/named.cache
189%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/icannbundle.pem
ca75cd40 190%attr(755,root,root) %{_sbindir}/unbound
511c7cae 191%attr(755,root,root) %{_sbindir}/unbound-anchor
ca75cd40 192%attr(755,root,root) %{_sbindir}/unbound-checkconf
5ec53429 193%attr(755,root,root) %{_sbindir}/unbound-control*
ca75cd40 194%attr(755,root,root) %{_sbindir}/unbound-host
195%{_mandir}/man1/unbound-host.1*
196%{_mandir}/man5/unbound.conf.5*
197%{_mandir}/man8/unbound-checkconf.8*
198%{_mandir}/man8/unbound.8*
511c7cae 199%{_mandir}/man8/unbound-anchor.8*
379d3e5e 200%{_mandir}/man8/unbound-control*.8*
0ddfe461
JK
201%dir %attr(755,unbound,nobody) /var/lib/%{name}
202%ghost /var/lib/%{name}/root.key
ca75cd40 203
89d05c6c
JB
204%files libs
205%defattr(644,root,root,755)
206%attr(755,root,root) %{_libdir}/libunbound.so.*.*.*
207%attr(755,root,root) %ghost %{_libdir}/libunbound.so.2
208
ca75cd40 209%files devel
cda91157 210%defattr(644,root,root,755)
89d05c6c 211%attr(755,root,root) %{_libdir}/libunbound.so
ca75cd40 212%{_libdir}/libunbound.la
89d05c6c 213%{_includedir}/unbound.h
ca75cd40 214%{_mandir}/man3/libunbound.3*
44b158d7 215%{_mandir}/man3/ub_*.3*
ca75cd40 216
217%files static
cda91157 218%defattr(644,root,root,755)
ca75cd40 219%{_libdir}/libunbound.a
89d05c6c
JB
220
221%if %{with python}
222%files -n python-unbound
223%defattr(644,root,root,755)
224%attr(755,root,root) %{py_sitedir}/_unbound.so*
225%{py_sitedir}/unbound.py[co]
226%endif
This page took 0.141564 seconds and 4 git commands to generate.