fea33a3
Summary: NSD is a complete implementation of an authoritative DNS name server
fea33a3
Name: nsd
fea33a3
Version: 2.3.3
c98708c
Release: 5%{?dist}
fea33a3
License: BSD-like
fea33a3
Url: http://open.nlnetlabs.nl/nsd/
fea33a3
Source: http://open.nlnetlabs.nl/downloads/nsd/%{name}-%{version}.tar.gz
fea33a3
Source1: nsd.init
fea33a3
Patch0: nsd-2.3.3-checking.patch
fea33a3
Group: System Environment/Daemons
fea33a3
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
0fb8b47
BuildRequires: flex, openssl-devel
fea33a3
fea33a3
%description
fea33a3
NSD is a complete implementation of an authoritative DNS name server.
fea33a3
For further information about what NSD is and what NSD is not please
fea33a3
consult the REQUIREMENTS document which is a part of this distribution
fea33a3
(thanks to Olaf).
fea33a3
fea33a3
%prep
fea33a3
%setup -q 
fea33a3
%patch0 -p1 -b .checking.patch
fea33a3
fea33a3
%configure --enable-bind8-stats --enable-plugins \
fea33a3
           --enable-mmap --with-pidfile=/var/run/nsd.pid --with-ssl \
fea33a3
           --with-user=nsd
fea33a3
fea33a3
%build
fea33a3
%{__make} %{?_smp_mflags}
fea33a3
fea33a3
%install
fea33a3
# Not using their 'make install' since it uses install-sh which does not
fea33a3
# get the correct install path within the RPM_BUILD_ROOT
fea33a3
#%{__make} install
fea33a3
rm -rf %{buildroot}
fea33a3
install -d 0755 %{buildroot}/%{_sysconfdir}/nsd
fea33a3
install -d 0755 %{buildroot}/%{_sbindir}
fea33a3
install -d 0755 %{buildroot}/%{_mandir}/man8
fea33a3
install -d 0755 %{buildroot}/%{_initrddir}
fea33a3
fea33a3
install -m 0644 nsdc.conf.sample %{buildroot}/%{_sysconfdir}/nsd/nsdc.conf
fea33a3
install -m 0644 nsd.zones.sample %{buildroot}/%{_sysconfdir}/nsd/nsd.zones
fea33a3
install -m 0755 %{SOURCE1} %{buildroot}/%{_initrddir}/nsd
fea33a3
fea33a3
install -m 0755 nsd zonec nsd-notify nsd-xfer %{buildroot}/%{_sbindir}
fea33a3
install -m 0755 nsdc.sh %{buildroot}/%{_sbindir}/nsdc
fea33a3
install -m 0644 *.8 %{buildroot}/%{_mandir}/man8
fea33a3
fea33a3
%clean
fea33a3
rm -rf ${RPM_BUILD_ROOT}
fea33a3
fea33a3
%files 
fea33a3
%defattr(-,root,root)
fea33a3
%doc README LICENSE NSD-DATABASE DIFFERENCES dbaccess.c TODO RELNOTES REQUIREMENTS
fea33a3
%dir %{_sysconfdir}/nsd/
fea33a3
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsdc.conf
fea33a3
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.zones
fea33a3
%attr(0755,root,root) %{_initrddir}/%{name}
fea33a3
%{_sbindir}/*
fea33a3
%{_mandir}/*/*
fea33a3
fea33a3
%pre
fea33a3
if getent passwd nsd >/dev/null 2>&1 ; then : ; else /usr/sbin/useradd -d /etc/nsd -r -s /sbin/nologin nsd >/dev/null 2>&1 || exit 1 ; fi
fea33a3
if [ $1 = 2 -a -f /var/run/%{name}.pid ]; then
fea33a3
	/sbin/service %{name} stop
fea33a3
fi
fea33a3
# "Everyone is doing it, so why can't we?" 
fea33a3
exit 0
fea33a3
fea33a3
%post
fea33a3
# do not activate daemon upon request. Fedora Extra policy
fea33a3
fea33a3
%preun
fea33a3
if [ -f /var/run/%{name}.pid ]
fea33a3
then
fea33a3
        /sbin/service %{name} stop > /dev/null 2>&1
fea33a3
fi
fea33a3
if [ $1 -eq 0 ]
fea33a3
then
fea33a3
        /sbin/chkconfig --del %{name} > /dev/null 2>&1
fea33a3
fi
fea33a3
# "Everyone is doing it, so why can't we?"
fea33a3
exit 0
fea33a3
fea33a3
%postun
fea33a3
if [ "$1" -ge "1" ]; then
fea33a3
  /sbin/service %{name} condrestart 2>&1 >/dev/null
fea33a3
fi
fea33a3
fea33a3
%changelog
c98708c
* Tue Dec 13 2005 Paul Wouters <paul@xelerance.com> - 2.3.3-5
c98708c
- Added BuildRequires for openssl-devel, removed Requires for openssl.
c98708c
c98708c
* Mon Dec 12 2005 Paul Wouters <paul@xelerance.com> - 2.3.3-4
fea33a3
- upgraded to nsd-2.3.3
fea33a3
fea33a3
* Wed Dec  7 2005 Tom "spot" Callaway <tcallawa@redhat.com> - 2.3.2-2
fea33a3
- minor cleanups
fea33a3
fea33a3
* Mon Dec  5 2005 Paul Wouters <paul@xelerance.com> - 2.3.2-1
fea33a3
- Upgraded to 2.3.2. Changed post scripts to comply to Fedora
fea33a3
  Extras policies (eg do not start daemon on fresh install)
fea33a3
fea33a3
* Tue Oct  4 2005 Paul Wouters <paul@xelerance.com> - 2.3.1-1
fea33a3
- Initial version