- update to 4.0.0

see /usr/share/doc/packages/NSD-4-features for the important
  changes
- added systemd support

OBS-URL: https://build.opensuse.org/package/show/server:dns/nsd?expand=0&rev=17
This commit is contained in:
2013-12-29 04:30:31 +00:00
committed by Git OBS Bridge
parent 500a0ccd4e
commit 441fc57642
7 changed files with 143 additions and 30 deletions

105
nsd.spec
View File

@@ -9,16 +9,33 @@
#
# norootforbuild
%if 0%{?suse_version} >= 1230
%bcond_without systemd
%define _rundir /run
%else
%bcond_with systemd
%define _rundir /var/run
%endif
# only needed for < 1310
%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d}
Name: nsd
Version: 3.2.13
Version: 4.0.0
Release: 0
#
License: GPL
License: BSD-3-Clause
Group: Productivity/Networking/DNS/Servers
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl-devel pkgconfig pwdutils tcpd-devel
BuildRequires: libevent-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: pwdutils
BuildRequires: tcpd-devel
%if %{with systemd}
BuildRequires: systemd-devel
%{?systemd_requires}
%endif
PreReq: %insserv_prereq %fillup_prereq pwdutils
#
%define home %{_var}/lib/%{name}
@@ -27,10 +44,13 @@ PreReq: %insserv_prereq %fillup_prereq pwdutils
%define zonesfile %{configdir}/nsd.zones
%define zonesdir %{configdir}/
%define dbfile %{zonesdir}/nsd.db
%define pidfile %{_rundir}/nsd/nsd.pid
#
Url: http://open.nlnetlabs.nl/nsd/
Source: http://open.nlnetlabs.nl/downloads/nsd/nsd-%{version}.tar.gz
Source1: %{name}.init
Source1: nsd.service
Source2: tmpfiles-nsd.conf
Source3: %{name}.init
#
Summary: An authoritative only, high performance, simple and open source name server
%description
@@ -47,35 +67,51 @@ Authors:
%setup
%build
export CFLAGS="$RPM_OPT_FLAGS -fPIE -Wformat-nonliteral -Wformat-security"
export LDFLAGS="-pie -Wl,-z,relro,-z,now"
%configure \
--with-configdir=%{configdir} \
--with-zonesdir=%{configdir} \
--with-dbfile=%{home}/nsd.db \
--with-difffile=%{home}/ixfr.db \
--with-xfrdfile=%{home}/xfrd.state \
--with-pidfile=%{pidfile} \
--with-logfile=/var/log/nsd.log \
--enable-root-server \
--enable-plugins \
--enable-bind8-stats \
--enable-nsec3 \
--enable-nsid \
--enable-mmap \
--with-user=%{name} \
--with-libwrap
%{__make}
--enable-ratelimit \
--enable-draft-rrtypes
%{__make} %{?_smp_mflags}
iconv -f iso8859-1 -t utf-8 doc/RELNOTES > doc/RELNOTES.utf8
iconv -f iso8859-1 -t utf-8 doc/CREDITS > doc/CREDITS.utf8
mv -f doc/RELNOTES.utf8 doc/RELNOTES
mv -f doc/CREDITS.utf8 doc/CREDITS
%install
%makeinstall
make install DESTDIR="%{buildroot}"
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 0700 %{buildroot}%{home} \
%{buildroot}%{_rundir}/%{name}
#
%{__install} -d -m 0755 %{buildroot}/var/log/
install -d -m 0755 %{buildroot}/var/log/
touch %{buildroot}%{home}/{nsd.db,ixfr.db,xfrd.state} %{buildroot}/var/log/nsd.log
%if %{with systemd}
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/nsd.service
install -D -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/nsd.conf
ln -s -f /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
%else
install -D -m 0755 %{S:3} %{buildroot}%{_sysconfdir}/init.d/%{name}
ln -s -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%endif
%clean
%{__rm} -rf %{buildroot};
@@ -84,41 +120,55 @@ touch %{buildroot}%{home}/{nsd.db,ixfr.db,xfrd.state} %{buildroot}/var/log/nsd.l
# 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 ||:
%{_sbindir}/useradd -g %{name} -s /bin/false -r -c "user for %{name}" -d %{home} %{name} &>/dev/null ||:
%if %{with systemd}
%service_add_pre %{name}.service
%endif
%post
%fillup_and_insserv %{name}
%fillup_only %{name}
%if %{with systemd}
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
%service_add_post %{name}.service
%endif
%preun
%if %{with systemd}
%service_del_preun %{name}.service
%else
%stop_on_removal %{name}
%endif
%postun
%if %{with systemd}
%service_del_postun %{name}.service
%else
%restart_on_update %{name}
%{insserv_cleanup}
%endif
%files
%defattr(-,root,root)
%doc doc/*
%doc contrib/
%if %{with systemd}
%{_unitdir}/nsd.service
%{_tmpfilesdir}/nsd.conf
%else
%{_sysconfdir}/init.d/%{name}
%dir %attr(0700,%{name},%{name}) %{_rundir}/%{name}/
%endif
%{_sbindir}/rcnsd
%{_sbindir}/nsd
%{_sbindir}/nsd-notify
%{_sbindir}/nsd-xfer
%{_sbindir}/nsdc
%{_sbindir}/zonec
%{_sbindir}/nsd-control
%{_sbindir}/nsd-control-setup
%{_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*
%{_mandir}/man8/nsd-control.8*
#
%config %attr(-,root,%{name}) %{configdir}
%config(noreplace) %attr(-,root,%{name}) %{configdir}
#
%dir %attr(750,%{name},%{name}) %{home}
%ghost %config %attr(640,%{name},%{name}) %{home}/nsd.db
@@ -126,5 +176,6 @@ touch %{buildroot}%{home}/{nsd.db,ixfr.db,xfrd.state} %{buildroot}/var/log/nsd.l
%ghost %config %attr(640,%{name},%{name}) %{home}/xfrd.state
#
%ghost %attr(640,%{name},%{name}) /var/log/nsd.log
#
%changelog