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