]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/unbound.spec
Vendor import of Unbound 1.12.0.
[FreeBSD/FreeBSD.git] / contrib / unbound.spec
1 Summary: Validating, recursive, and caching DNS resolver
2 Name: unbound
3 Version: 1.4.18
4 Release: 1%{?dist}
5 License: BSD
6 Url: http://www.nlnetlabs.nl/unbound/
7 Source: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
8 #Source1: unbound.init
9 Group: System Environment/Daemons
10 Requires: ldns
11 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
12 BuildRequires: flex, openssl-devel, expat-devel, ldns-devel
13
14 %description
15 Unbound is a validating, recursive, and caching DNS resolver.
16
17 The C implementation of Unbound is developed and maintained by NLnet
18 Labs. It is based on ideas and algorithms taken from a java prototype
19 developed by Verisign labs, Nominet, Kirei and ep.net.
20
21 Unbound is designed as a set of modular components, so that also
22 DNSSEC (secure DNS) validation and stub-resolvers (that do not run
23 as a server, but are linked into an application) are easily possible.
24
25 The source code is under a BSD License.
26
27 %prep
28 %setup -q
29
30 # configure with /var/unbound/unbound.conf so that all default chroot, 
31 # pidfile and config file are in /var/unbound, ready for chroot jail set up.
32 %configure --with-conf-file=%{_localstatedir}/%{name}/unbound.conf --disable-rpath
33
34 %build
35 #%{__make} %{?_smp_mflags}
36 make
37
38 %install
39 rm -rf %{buildroot}
40 %{__make} DESTDIR=%{buildroot} install
41 install -d 0700 %{buildroot}%{_localstatedir}/%{name}
42 install -d 0755 %{buildroot}%{_initrddir}
43 install -m 0755 contrib/unbound.init %{buildroot}%{_initrddir}/unbound
44 # add symbolic link from /etc/unbound.conf -> /var/unbound/unbound.conf
45 ln -s %{_localstatedir}/unbound/unbound.conf %{buildroot}%{_sysconfdir}/unbound.conf 
46 # remove static library from install (fedora packaging guidelines)
47 rm -f %{buildroot}%{_libdir}/libunbound.a %{buildroot}%{_libdir}/libunbound.la
48
49 %clean
50 rm -rf ${RPM_BUILD_ROOT}
51
52 %files
53 %defattr(-,root,root,-)
54 %doc doc/README doc/CREDITS doc/LICENSE doc/FEATURES
55 %attr(0755,root,root) %{_initrddir}/%{name}
56 %attr(0700,%{name},%{name}) %dir %{_localstatedir}/%{name}
57 %attr(0644,%{name},%{name}) %config(noreplace) %{_localstatedir}/%{name}/unbound.conf
58 %attr(0644,%{name},%{name}) %config(noreplace) %{_sysconfdir}/unbound.conf
59 %{_sbindir}/*
60 %{_mandir}/*/*
61 %{_includedir}/*
62 %{_libdir}/libunbound*
63
64 %pre
65 getent group unbound >/dev/null || groupadd -r unbound
66 getent passwd unbound >/dev/null || \
67 useradd -r -g unbound -d /var/unbound -s /sbin/nologin \
68     -c "unbound name daemon" unbound
69 exit 0
70
71 %post
72 # This adds the proper /etc/rc*.d links for the script
73 /sbin/chkconfig --add %{name}
74
75 %preun
76 if [ $1 -eq 0 ]; then
77         /sbin/service %{name} stop >/dev/null 2>&1
78         /sbin/chkconfig --del %{name}
79         # remove root jail 
80         rm -f /var/unbound/dev/log /var/unbound/dev/random /var/unbound/etc/localtime /var/unbound/etc/resolv.conf >/dev/null 2>&1
81         rmdir /var/unbound/dev >/dev/null 2>&1 || :
82         rmdir /var/unbound/etc >/dev/null 2>&1 || :
83         rmdir /var/unbound >/dev/null 2>&1 || :
84 fi
85
86 %postun
87 if [ "$1" -ge "1" ]; then
88         /sbin/service %{name} condrestart >/dev/null 2>&1 || :
89 fi
90
91 %changelog
92 * Thu Jul 13 2011 Wouter Wijngaards <wouter@nlnetlabs.nl> - 1.4.8
93 - ldns required and ldns-devel required for build, no more ldns-builtin.
94
95 * Thu Mar 17 2011 Wouter Wijngaards <wouter@nlnetlabs.nl> - 1.4.8
96 - removed --disable-gost, assume recent openssl on the destination platform.
97
98 * Wed Mar 16 2011 Harold Jones <hajones@verisign.com> - 1.4.8
99 - Bump version number to latest
100 - Add expat-devel to BuildRequires
101 - Added --disable-gost for building on CentOS 5.x
102 - Added --with-ldns-builtin for CentOS 5.x
103
104 * Thu May 22 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 1.0.0
105 - contrib changes from Patrick Vande Walle.
106
107 * Thu Apr 25 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.12
108 - Using parts from ports collection entry by Jaap Akkerhuis.
109 - Using Fedoraproject wiki guidelines.
110
111 * Wed Apr 23 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.11
112 - Initial version.