File nsd.spec of Package nsd

#
# spec file for package nsd
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           nsd
Version:        3.2.16
Release:        1.1
License:        GPL
Group:          Productivity/Networking/DNS/Servers
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  openssl-devel pkgconfig pwdutils tcpd-devel
PreReq:         %insserv_prereq %fillup_prereq pwdutils
%define home       %{_var}/lib/%{name}
%define configdir  %{_sysconfdir}/%{name}
%define configfile %{configdir}/nsdc.conf
%define zonesfile  %{configdir}/nsd.zones
%define zonesdir   %{configdir}/
%define dbfile     %{zonesdir}/nsd.db
Url:            http://open.nlnetlabs.nl/nsd/
Source:         http://open.nlnetlabs.nl/downloads/nsd/nsd-%{version}.tar.gz
Source1:        %{name}.init
Summary:        An authoritative only, high performance, simple and open source name server

%description
NSD is a complete implementation of an authoritative DNS name server.  For
further information about what NSD is and what NSD is not please consult the
REQUIREMENTS document which is a part of this distribution (thanks to Olaf).

Authors:
--------
    NSD team <nsd-team@nlnetlabs.nl>


%prep
%setup

%build
%configure                             \
    --with-zonesdir=%{configdir}       \
    --with-dbfile=%{home}/nsd.db       \
    --with-difffile=%{home}/ixfr.db    \
    --with-xfrdfile=%{home}/xfrd.state \
    --enable-root-server               \
    --enable-plugins                   \
    --enable-bind8-stats               \
    --enable-nsec3                     \
    --enable-nsid                      \
    --enable-mmap                      \
    --with-user=%{name}                \
    --with-libwrap
%{__make}

%install
%makeinstall
for i in %{buildroot}%{configdir}/*.sample ; do
    %{__cp} -v $i ${i%%.sample} ;
done
chmod -Rv o= %{buildroot}%{configdir}/
#
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%{__install} -Dd -m 0755 %{buildroot}%{home}
#
%{__install} -d -m 0755 %{buildroot}/var/log/
touch %{buildroot}%{home}/{nsd.db,ixfr.db,xfrd.state} %{buildroot}/var/log/nsd.log

%clean
%{__rm} -rf %{buildroot};

%pre
#
# e.g. adding user
#
%{_sbindir}/groupadd -r %{name} &>/dev/null ||:
%{_sbindir}/useradd -o -g %{name} -s /bin/false -r -c "user for %{name}" -d %{home} %{name} &>/dev/null ||:

%post
%fillup_and_insserv %{name}

%preun
%stop_on_removal %{name}

%postun
%restart_on_update %{name}
%{insserv_cleanup}

%files
%defattr(-,root,root)
%doc doc/*
%doc contrib/
%{_sysconfdir}/init.d/%{name}
%{_sbindir}/rcnsd
%{_sbindir}/nsd
%{_sbindir}/nsd-notify
%{_sbindir}/nsd-xfer
%{_sbindir}/nsdc
%{_sbindir}/zonec
%{_sbindir}/nsd-checkconf
%{_sbindir}/nsd-patch
%{_mandir}/man5/nsd.conf.5*
%{_mandir}/man8/nsd-checkconf.8*
%{_mandir}/man8/nsd-patch.8*
%{_mandir}/man8/nsd-notify.8*
%{_mandir}/man8/nsd-xfer.8*
%{_mandir}/man8/nsd.8*
%{_mandir}/man8/nsdc.8*
%{_mandir}/man8/zonec.8*
#
%config %attr(-,root,%{name}) %{configdir}
#
%dir %attr(750,%{name},%{name}) %{home}
%ghost %config %attr(640,%{name},%{name}) %{home}/nsd.db
%ghost %config %attr(640,%{name},%{name}) %{home}/ixfr.db
%ghost %config %attr(640,%{name},%{name}) %{home}/xfrd.state
#
%ghost %attr(640,%{name},%{name}) /var/log/nsd.log

%changelog
* Wed Aug 15 2012 mrueckert@suse.de
- update to 3.2.13: (bnc#774600)
  see /usr/share/doc/packages/nsd/ChangeLog
  This fixes VU#517036 CVE-2012-2979 and VU#624931 CVE-2012-2978.
* Tue Apr 12 2011 mrueckert@suse.de
- update to 3.2.8
  see /usr/share/doc/packages/nsd/ChangeLog
* Wed Sep  1 2010 suse-tux@gmx.de
- fixed build
* Mon Feb  1 2010 mrueckert@suse.de
- use the pid when sending signnals to nsd
* Thu Mar 29 2007 mrueckert@suse.de
- added pwdutils explicitly to the requires/buildrequires.
- add log file to the package
* Thu Mar 29 2007 mrueckert@suse.de
- update to 3.0.5
openSUSE Build Service is sponsored by