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