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