SHA256
1
0
forked from pool/nsd

- 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:
Marcus Rückert 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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c0abd77d716a80047dac5cb2998b077686f41a93be7e9d10b2746e6f7ac1ac2
size 886216

3
nsd-4.0.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:62608a409d0f68c9d8d4595031b9de9130ac02efe39733be5dee40d5a90e991c
size 1035710

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sun Dec 29 04:24:32 UTC 2013 - mrueckert@suse.de
- update to 4.0.0
see /usr/share/doc/packages/NSD-4-features for the important
changes
- added systemd support
-------------------------------------------------------------------
Wed Aug 15 10:07:44 UTC 2012 - mrueckert@suse.de

15
nsd.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=NSD DNS Server
After=syslog.target network.target
[Service]
Type=simple
PIDFile=/run/nsd/nsd.pid
#EnvironmentFile=-/etc/sysconfig/nsd
#ExecStart=/usr/sbin/nsd -D -c /etc/nsd/nsd.conf $OTHER_NSD_OPTS
ExecStart=/usr/sbin/nsd -d -c /etc/nsd/nsd.conf
ExecStopPost=/bin/rm -f /var/lib/nsd/xfrd.state
[Install]
WantedBy=multi-user.target

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

38
nsd.sysconfig Normal file
View File

@ -0,0 +1,38 @@
# /etc/sysconfig/nsd
# Configuration for /etc/init.d/nsd
OTHER_NSD_OPTS=""
#extra verbosity
#ZONEC_VERBOSE=-v
# You might also need to change SElinux policies if you decide
# to deviate from the standard locations below.
# Main configuration file
#NSD_CONF="/etc/nsd/nsd.conf"
# NSD DB
#NSD_DB="/var/lib/nsd/nsd.db"
# Path to nsdc program
#NSDC_PROG="/usr/sbin/nsdc"
# Path to nsd program
#NSD_PROG="/usr/sbin/nsd"
# Path to nsd-checkconf program
#NSD_CHECKCONF_PROG="/usr/sbin/nsd-checkconf"
# NSD pid file
#NSD_PIDFILE="/var/run/nsd/nsd.pid"
# NSD zone transfer daemon state file (should equal to the xfrdfile
# parameter set in nsd.conf)
#NSD_XFRDFILE="/var/lib/nsd/xfrd.state"
# NSD_AUTOREBUILD: Choose with "yes" or "no" whether NSD database should
# be rebuilt and reloaded automatically hourly by /etc/cron.hourly/nsd script.
# (Default value is set in the script.)
#NSD_AUTOREBUILD="yes"
# EOF

1
tmpfiles-nsd.conf Normal file
View File

@ -0,0 +1 @@
D /var/run/nsd 0755 nsd nsd -