41fa067
# not ready yet
213d4a3
%{?!with_python:      %global with_python      0}
41fa067
b51bd8a
%if %{with_python}
b51bd8a
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
b51bd8a
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
b51bd8a
%endif
b51bd8a
05f86a0
Summary: Validating, recursive, and caching DNS(SEC) resolver
05f86a0
Name: unbound
cdaabce
Version: 1.4.4
213d4a3
Release: 1%{?dist}
05f86a0
License: BSD
05f86a0
Url: http://www.nlnetlabs.nl/unbound/
05f86a0
Source: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
05f86a0
Source1: unbound.init
05f86a0
Source2: unbound.conf
d2fe1dc
Source3: unbound.munin
cdaabce
Source4: dlv.isc.org.key
cdaabce
Patch1: unbound-1.2-glob.patch
cdaabce
Patch2: unbound-1.4.4-c2baa7.patch
cdaabce
Patch3: unbound-1.4.4-40d18f.patch
cdaabce
Patch4: unbound-1.4.4-7f27d6.patch
cdaabce
Patch5: unbound-1.4.4-74d75e.patch
cdaabce
Patch6: unbound-1.4.4-374822.patch
cdaabce
Patch7: unbound-1.4.4-00f12c.patch
cdaabce
Patch8: unbound-1.4.4-41b631.patch
cdaabce
Patch9: unbound-1.4.4-5f58ed.patch
cdaabce
Patch10: unbound-1.4.4-d7ef7b.patch
cdaabce
Patch11: unbound-1.4.4-778d4a.patch
cdaabce
Patch12: unbound-1.4.4-5e989a.patch
cdaabce
Patch13: unbound-1.4.4-a6f07b.patch
cdaabce
Patch14: unbound-1.4.4-28093c.patch
41fa067
05f86a0
Group: System Environment/Daemons
05f86a0
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
41fa067
BuildRequires: flex, openssl-devel , ldns-devel >= 1.5.0, 
41fa067
BuildRequires: libevent-devel 
41fa067
%if %{with_python}
cdaabce
BuildRequires:  python-devel swig
41fa067
%endif
cdaabce
# Required for SVN versions
cdaabce
#BuildRequires: bison
cdaabce
41fa067
05f86a0
Requires(post): chkconfig
05f86a0
Requires(preun): chkconfig
05f86a0
Requires(preun): initscripts
05f86a0
Requires(postun): initscripts
cdaabce
Requires: ldns >= 1.5.0
05f86a0
Requires(pre): shadow-utils
cdaabce
cdaabce
Obsoletes:      dnssec-conf < 1.27-2
cdaabce
Provides:       dnssec-conf = 1.27-1
05f86a0
05f86a0
%description
05f86a0
Unbound is a validating, recursive, and caching DNS(SEC) resolver.
05f86a0
05f86a0
The C implementation of Unbound is developed and maintained by NLnet
05f86a0
Labs. It is based on ideas and algorithms taken from a java prototype
05f86a0
developed by Verisign labs, Nominet, Kirei and ep.net.
05f86a0
05f86a0
Unbound is designed as a set of modular components, so that also
05f86a0
DNSSEC (secure DNS) validation and stub-resolvers (that do not run
05f86a0
as a server, but are linked into an application) are easily possible.
05f86a0
d2fe1dc
%package munin
d2fe1dc
Summary: Plugin for the munin / munin-node monitoring package
d2fe1dc
Group:     System Environment/Daemons
d2fe1dc
Requires: munin-node
24585b9
Requires: %{name} = %{version}-%{release}, bc
d2fe1dc
d2fe1dc
%description munin
d2fe1dc
Plugin for the munin / munin-node monitoring package
d2fe1dc
05f86a0
%package devel
05f86a0
Summary: Development package that includes the unbound header files
05f86a0
Group: Development/Libraries
9366b83
Requires: %{name}-libs = %{version}-%{release}, openssl-devel, ldns-devel
05f86a0
05f86a0
%description devel
05f86a0
The devel package contains the unbound library and the include files
05f86a0
05f86a0
%package libs
05f86a0
Summary: Libraries used by the unbound server and client applications
05f86a0
Group: Applications/System
05f86a0
Requires(post): /sbin/ldconfig
05f86a0
Requires(postun): /sbin/ldconfig
24585b9
Requires: openssl >= 0.9.8g-12
05f86a0
05f86a0
%description libs
05f86a0
Contains libraries used by the unbound server and client applications
05f86a0
41fa067
%if %{with_python}
41fa067
%package python
41fa067
Summary: Python modules and extensions for unbound
41fa067
Group: Applications/System
41fa067
Requires: %{name}-libs = %{version}-%{release}
41fa067
41fa067
%description python
41fa067
Python modules and extensions for unbound
41fa067
%endif
41fa067
05f86a0
%prep
05f86a0
%setup -q 
cdaabce
%patch1 -p1
cdaabce
# svn/git patches
cdaabce
%patch2 -p1
41fa067
%patch4 -p1
cdaabce
%patch6 -p1
cdaabce
%patch7 -p1
cdaabce
%patch8 -p1
cdaabce
%patch9 -p1
cdaabce
%patch10 -p1
cdaabce
%patch11 -p1
cdaabce
%patch12 -p1
cdaabce
%patch13 -p1
cdaabce
%patch14 -p1
cdaabce
%patch3 -p1
cdaabce
%patch5 -p1
05f86a0
05f86a0
%build
3968053
%configure  --with-ldns= --with-libevent --with-pthreads --with-ssl \
05f86a0
            --disable-rpath --enable-debug --disable-static \
12d3cd5
            --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \
41fa067
            --with-pidfile=%{_localstatedir}/run/%{name}/%{name}.pid \
41fa067
%if %{with_python}
41fa067
            --with-pythonmodule --with-pyunbound \
41fa067
%endif
cdaabce
            --enable-sha2
cdaabce
%{__make} %{?_smp_mflags}
05f86a0
05f86a0
%install
05f86a0
rm -rf %{buildroot}
05f86a0
%{__make} DESTDIR=%{buildroot} install
05f86a0
install -d 0755 %{buildroot}%{_initrddir}
05f86a0
install -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/unbound
12d3cd5
install -m 0755 %{SOURCE2} %{buildroot}%{_sysconfdir}/unbound
12d3cd5
# Install munin plugin and its softlinks
d2fe1dc
install -d 0755 %{buildroot}%{_sysconfdir}/munin/plugin-conf.d
d2fe1dc
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/munin/plugin-conf.d/unbound
d2fe1dc
install -d 0755 %{buildroot}%{_datadir}/munin/plugins/
d2fe1dc
install -m 0755 contrib/unbound_munin_ %{buildroot}%{_datadir}/munin/plugins/unbound
12d3cd5
for plugin in unbound_munin_hits unbound_munin_queue unbound_munin_memory unbound_munin_by_type unbound_munin_by_class unbound_munin_by_opcode unbound_munin_by_rcode unbound_munin_by_flags unbound_munin_histogram; do
12d3cd5
    ln -s unbound %{buildroot}%{_datadir}/munin/plugins/$plugin
12d3cd5
done 
05f86a0
cdaabce
# install DLV key
cdaabce
install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/unbound/
cdaabce
05f86a0
# remove static library from install (fedora packaging guidelines)
05f86a0
rm -rf %{buildroot}%{_libdir}/*.la
cdaabce
%if %{with_python}
cdaabce
rm -rf %{buildroot}%{python_sitelib}/*/*.la
cdaabce
%endif
05f86a0
05f86a0
mkdir -p %{buildroot}%{_localstatedir}/run/unbound
05f86a0
05f86a0
%clean
05f86a0
rm -rf ${RPM_BUILD_ROOT}
05f86a0
05f86a0
%files 
05f86a0
%defattr(-,root,root,-)
05f86a0
%doc doc/README doc/CREDITS doc/LICENSE doc/FEATURES
05f86a0
%attr(0755,root,root) %{_initrddir}/%{name}
09de94e
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}
05f86a0
%attr(0755,unbound,unbound) %dir %{_localstatedir}/run/%{name}
12d3cd5
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/unbound.conf
cdaabce
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/dlv.isc.org.key
05f86a0
%{_sbindir}/*
05f86a0
%{_mandir}/*/*
05f86a0
41fa067
%if %{with_python}
41fa067
%files python
41fa067
%{python_sitelib}/*
41fa067
%endif
41fa067
d2fe1dc
%files munin
d2fe1dc
%defattr(-,root,root,-)
e4c51b0
%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/unbound
12d3cd5
%{_datadir}/munin/plugins/unbound*
d2fe1dc
05f86a0
%files devel
05f86a0
%defattr(-,root,root,-)
05f86a0
%{_libdir}/libunbound.so
05f86a0
%{_includedir}/unbound.h
05f86a0
%doc README
05f86a0
05f86a0
%files libs
05f86a0
%defattr(-,root,root,-)
05f86a0
%{_libdir}/libunbound.so.*
05f86a0
%doc doc/README doc/LICENSE
05f86a0
05f86a0
%pre
05f86a0
getent group unbound >/dev/null || groupadd -r unbound
05f86a0
getent passwd unbound >/dev/null || \
Adam Tkac cd8c012
useradd -r -g unbound -d %{_sysconfdir}/unbound -s /sbin/nologin \
05f86a0
-c "Unbound DNS resolver" unbound
05f86a0
exit 0
05f86a0
Adam Tkac 4abd8a9
%post
438b0e4
/sbin/chkconfig --add %{name}
cdaabce
# dnssec-conf used to contain our DLV key, but now we include it via unbound
cdaabce
# If unbound had previously been configured with dnssec-configure, we need
cdaabce
# to migrate the location of the DLV key file (to keep DLV enabled, and because
cdaabce
# unbound won't start with a bad location for a DLV key file.
cdaabce
sed -i "s:/etc/pki/dnssec-keys[/]*dlv:/etc/unbound:" %{_sysconfdir}/unbound/unbound.conf
05f86a0
05f86a0
%post libs -p /sbin/ldconfig
05f86a0
05f86a0
%preun
Adam Tkac 39b47db
if [ "$1" -eq 0 ]; then
05f86a0
        /sbin/service %{name} stop >/dev/null 2>&1
05f86a0
        /sbin/chkconfig --del %{name} 
05f86a0
fi
05f86a0
05f86a0
%postun 
05f86a0
if [ "$1" -ge "1" ]; then
05f86a0
  /sbin/service %{name} condrestart >/dev/null 2>&1 || :
05f86a0
fi
05f86a0
05f86a0
%postun libs -p /sbin/ldconfig
05f86a0
05f86a0
%changelog
cdaabce
* Mon May 31 2010 Paul Wouters <paul@xelerance.com> - 1.4.4-1
cdaabce
- Upgraded to 1.4.4 with svn patches
cdaabce
- Obsolete dnssec-conf to ensure it is de-installed
cdaabce
213d4a3
* Tue Jan 05 2010 Paul Wouters <paul@xelerance.com> - 1.4.1-1
213d4a3
- Updated to 1.4.1
213d4a3
- Changed %%define to %%global
213d4a3
6b8c1b5
* Thu Oct 08 2009 Paul Wouters <paul@xelerance.com> - 1.3.4-2
6b8c1b5
- Bump version
6b8c1b5
bd0a549
* Thu Oct 08 2009 Paul Wouters <paul@xelerance.com> - 1.3.4-1
bd0a549
- Upgraded to 1.3.4. Security fix with validating NSEC3 records
bd0a549
03856e0
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.3.3-2
03856e0
- rebuilt with new openssl
03856e0
dacab27
* Mon Aug 17 2009 Paul Wouters <paul@xelerance.com> - 1.3.3-1
dacab27
- Updated to 1.3.3
dacab27
aa5a68f
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
aa5a68f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
aa5a68f
b51bd8a
* Sat Jun 20 2009 Paul Wouters <paul@xelerance.com> - 1.3.0-2
b51bd8a
- Added missing glob patch to cvs
b51bd8a
- Place python macros within the %%with_python check
b51bd8a
41fa067
* Sat Jun 20 2009 Paul Wouters <paul@xelerance.com> - 1.3.0-1
41fa067
- Updated to 1.3.0
41fa067
- Added unbound-python sub package. disabled for now
41fa067
- Patch from svn to fix DLV lookups
41fa067
- Patches from svn to detect wrong truncated response from BIND 9.6.1 with
41fa067
  minimal-responses)
41fa067
- Added Default-Start and Default-Stop to unbound.init
41fa067
- Re-enabled --enable-sha2
41fa067
- Re-enabled glob.patch
41fa067
422c05d
* Wed May 20 2009 Paul Wouters <paul@xelerance.com> - 1.2.1-7
422c05d
- unbound-iterator.patch was not commited
422c05d
7a4cedc
* Wed May 20 2009 Paul Wouters <paul@xelerance.com> - 1.2.1-6
7a4cedc
- Fix for https://bugzilla.redhat.com/show_bug.cgi?id=499793
7a4cedc
c63c0b4
* Tue Mar 17 2009 Paul Wouters <paul@xelerance.com> - 1.2.1-5
c63c0b4
- Use --nocheck to avoid giving an error on missing unbound-remote certs/keys
c63c0b4
438b0e4
* Tue Mar 10 2009 Adam Tkac <atkac redhat com> - 1.2.1-4
438b0e4
- enable DNSSEC only if it is enabled in sysconfig/dnssec
438b0e4
Adam Tkac 4abd8a9
* Mon Mar 09 2009 Adam Tkac <atkac redhat com> - 1.2.1-3
Adam Tkac 4abd8a9
- add DNSSEC support to initscript and enabled it per default
Adam Tkac 4abd8a9
- add requires dnssec-conf
Adam Tkac 4abd8a9
77a522a
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
77a522a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
77a522a
70a277a
* Tue Feb 10 2009 Paul Wouters 
70a277a
- updated to 1.2.1
70a277a
6719db8
* Sun Jan 18 2009 Tomas Mraz <tmraz@redhat.com> - 1.2.0-2
6719db8
- rebuild with new openssl
6719db8
24585b9
* Wed Jan 14 2009 Paul Wouters 
24585b9
- Updated to 1.2.0
24585b9
- Added dependancy on minimum SSL for CVE-2008-5077
24585b9
- Added dependancy on bc for unbound-munin
10df4c1
- Added minimum requirement of libevent 1.4.5. Crashes with older versions
10df4c1
  (note: libevent is stale in EL-4 and not in EL-5, needs fixing there)
24585b9
- Removed dependancy on selinux-policy (will get used when available)
24585b9
- Enable options as per draft-wijngaards-dnsext-resolver-side-mitigation-00.txt
24585b9
- Enable unwanted-reply-threshold to mitigate against a Kaminsky attack
24585b9
- Enable val-clean-additional to drop addition unsigned data from signed
24585b9
  response.
dc8410b
- Removed patches (got merged into upstream)
24585b9
482e5e4
* Mon Jan  5 2009 Paul Wouters <paul@xelerance.com> - 1.1.1-7
482e5e4
- Modified scandir patch to silently fail when wildcard matches nothing
482e5e4
- Patch to allow unbound-checkconf to find empty wildcard matches
482e5e4
1555a15
* Mon Jan  5 2009 Paul Wouters <paul@xelerance.com> - 1.1.1-6
fbc16b5
- Added scandir patch for trusted-keys-file: option, which
fbc16b5
  is used to load multiple dnssec keys in bind file format
fbc16b5
1e7e03b
* Mon Dec  8 2008 Paul Wouters <paul@xelerance.com> - 1.1.1-4
1e7e03b
- Added Requires: for selinux-policy >= 3.5.13-33 for proper SElinux rules.
1e7e03b
09de94e
* Mon Dec  1 2008 Paul Wouters <paul@xelerance.com> - 1.1.1-3
09de94e
- We did not own the /etc/unbound directory (#474020)
09de94e
- Fixed cvs anomalies
09de94e
Adam Tkac cd8c012
* Fri Nov 28 2008 Adam Tkac <atkac redhat com> - 1.1.1-2
Adam Tkac cd8c012
- removed all obsolete chroot related stuff
Adam Tkac cd8c012
- label control certs after generation correctly
Adam Tkac cd8c012
7403530
* Thu Nov 20 2008 Paul Wouters <paul@xelerance.com> - 1.1.1-1
7403530
- Updated to unbound 1.1.1 which fixes a crasher and
7403530
  addresses nlnetlabs bug #219
7403530
12d3cd5
* Wed Nov 19 2008 Paul Wouters <paul@xelerance.com> - 1.1.0-3
12d3cd5
- Remove the chroot, obsoleted by SElinux
12d3cd5
- Add additional munin plugin links supported by unbound plugin
12d3cd5
- Move configuration directory from /var/lib/unbound to /etc/unbound
12d3cd5
- Modified unbound.init and unbound.conf to account for chroot changes
12d3cd5
- Updated unbound.conf with new available options
12d3cd5
- Enabled dns-0x20 protection per default
12d3cd5
Adam Tkac 39b47db
* Wed Nov 19 2008 Adam Tkac <atkac redhat com> - 1.1.0-2
Adam Tkac 39b47db
- unbound-1.1.0-log_open.patch
Adam Tkac 39b47db
  - make sure log is opened before chroot call
Adam Tkac 39b47db
  - tracked as http://www.nlnetlabs.nl/bugs/show_bug.cgi?id=219
Adam Tkac 39b47db
- removed /dev/log and /var/run/unbound and /etc/resolv.conf from
Adam Tkac 39b47db
  chroot, not needed
Adam Tkac 39b47db
- don't mount files in chroot, it causes problems during updates
Adam Tkac 39b47db
- fixed typo in default config file
Adam Tkac 39b47db
c41f9f1
* Fri Nov 14 2008 Paul Wouters <paul@xelerance.com> - 1.1.0-1
c41f9f1
- Updated to version 1.1.0
d2fe1dc
- Updated unbound.conf's statistics options and remote-control
d2fe1dc
  to work properly for munin
d2fe1dc
- Added unbound-munin package
d2fe1dc
- Generate unbound remote-control  key/certs on first startup
c41f9f1
- Required ldns is now 1.4.0
c41f9f1
05f86a0
* Wed Oct 22 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-5
05f86a0
- Only call ldconfig in -libs package
05f86a0
- Move configure into build section
05f86a0
- devel subpackage should only depend on libs subpackage
05f86a0
05f86a0
* Tue Oct 21 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-4
05f86a0
- Fix CFLAGS getting lost in build
05f86a0
- Don't enable interface-automatic:yes because that
05f86a0
  causes unbound to listen on 0.0.0.0 instead of 127.0.0.1
05f86a0
05f86a0
* Sun Oct 19 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-3
05f86a0
- Split off unbound-libs, make build verbose 
05f86a0
05f86a0
* Thu Oct  9 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-2
05f86a0
- FSB compliance, chroot fixes, initscript fixes
05f86a0
05f86a0
* Thu Sep 11 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-1
05f86a0
- Upgraded to 1.0.2
05f86a0
05f86a0
* Wed Jul 16 2008 Paul Wouters <paul@xelerance.com> - 1.0.1-1
05f86a0
- upgraded to new release
05f86a0
05f86a0
* Wed May 21 2008 Paul Wouters <paul@xelerance.com> - 1.0.0-2
05f86a0
- Build against ldns-1.3.0
05f86a0
05f86a0
* Wed May 21 2008 Paul Wouters <paul@xelerance.com> - 1.0.0-1
05f86a0
- Split of -devel package, fixed dependancies, make rpmlint happy
05f86a0
05f86a0
* Thu Apr 25 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.12
05f86a0
- Using parts from ports collection entry by Jaap Akkerhuis.
05f86a0
- Using Fedoraproject wiki guidelines.
05f86a0
05f86a0
* Wed Apr 23 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.11
05f86a0
- Initial version.