2007-03-29 17:19:09 +02:00
|
|
|
#
|
2011-04-12 04:25:25 +02:00
|
|
|
# spec file for package nsd
|
2007-03-29 17:19:09 +02:00
|
|
|
#
|
2011-04-12 04:25:25 +02:00
|
|
|
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-03-29 17:19:09 +02:00
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2006-07-07 14:18:42 +02:00
|
|
|
# norootforbuild
|
2013-12-29 05:30:31 +01:00
|
|
|
%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}
|
2006-07-07 14:18:42 +02:00
|
|
|
|
2007-03-29 17:19:09 +02:00
|
|
|
Name: nsd
|
2015-03-11 02:35:46 +01:00
|
|
|
Version: 4.1.1
|
2007-03-29 17:19:09 +02:00
|
|
|
Release: 0
|
|
|
|
#
|
2013-12-29 05:30:31 +01:00
|
|
|
License: BSD-3-Clause
|
2007-03-29 17:19:09 +02:00
|
|
|
Group: Productivity/Networking/DNS/Servers
|
|
|
|
#
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-12-29 05:30:31 +01:00
|
|
|
BuildRequires: libevent-devel
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: pwdutils
|
|
|
|
BuildRequires: tcpd-devel
|
|
|
|
%if %{with systemd}
|
|
|
|
BuildRequires: systemd-devel
|
|
|
|
%{?systemd_requires}
|
|
|
|
%endif
|
2007-03-29 17:19:09 +02:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq pwdutils
|
|
|
|
#
|
2006-07-07 14:18:42 +02:00
|
|
|
%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
|
2013-12-29 05:30:31 +01:00
|
|
|
%define pidfile %{_rundir}/nsd/nsd.pid
|
2006-07-07 14:18:42 +02:00
|
|
|
#
|
2007-03-29 17:19:09 +02:00
|
|
|
Url: http://open.nlnetlabs.nl/nsd/
|
2012-08-15 12:09:37 +02:00
|
|
|
Source: http://open.nlnetlabs.nl/downloads/nsd/nsd-%{version}.tar.gz
|
2013-12-29 05:30:31 +01:00
|
|
|
Source1: nsd.service
|
|
|
|
Source2: tmpfiles-nsd.conf
|
|
|
|
Source3: %{name}.init
|
2006-07-07 14:18:42 +02:00
|
|
|
#
|
2011-04-12 04:25:25 +02:00
|
|
|
Summary: An authoritative only, high performance, simple and open source name server
|
2006-07-07 14:18:42 +02:00
|
|
|
%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>
|
|
|
|
|
2007-03-29 07:17:02 +02:00
|
|
|
|
2006-07-07 14:18:42 +02:00
|
|
|
%prep
|
|
|
|
%setup
|
|
|
|
|
|
|
|
%build
|
2013-12-29 05:30:31 +01:00
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -fPIE -Wformat-nonliteral -Wformat-security"
|
|
|
|
export LDFLAGS="-pie -Wl,-z,relro,-z,now"
|
2007-03-29 07:17:02 +02:00
|
|
|
%configure \
|
2013-12-29 05:30:31 +01:00
|
|
|
--with-configdir=%{configdir} \
|
2007-03-29 07:17:02 +02:00
|
|
|
--with-zonesdir=%{configdir} \
|
|
|
|
--with-dbfile=%{home}/nsd.db \
|
|
|
|
--with-xfrdfile=%{home}/xfrd.state \
|
2013-12-29 05:30:31 +01:00
|
|
|
--with-pidfile=%{pidfile} \
|
|
|
|
--with-logfile=/var/log/nsd.log \
|
2007-03-29 07:17:02 +02:00
|
|
|
--enable-root-server \
|
|
|
|
--enable-bind8-stats \
|
|
|
|
--enable-nsec3 \
|
|
|
|
--enable-mmap \
|
|
|
|
--with-user=%{name} \
|
2013-12-29 05:30:31 +01:00
|
|
|
--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
|
2006-07-07 14:18:42 +02:00
|
|
|
|
|
|
|
%install
|
2013-12-29 05:30:31 +01:00
|
|
|
make install DESTDIR="%{buildroot}"
|
2006-07-07 14:18:42 +02:00
|
|
|
for i in %{buildroot}%{configdir}/*.sample ; do
|
2007-03-29 07:17:02 +02:00
|
|
|
%{__cp} -v $i ${i%%.sample} ;
|
2006-07-07 14:18:42 +02:00
|
|
|
done
|
2013-12-29 05:30:31 +01:00
|
|
|
|
2011-04-12 04:25:25 +02:00
|
|
|
chmod -Rv o= %{buildroot}%{configdir}/
|
2007-03-29 07:17:02 +02:00
|
|
|
#
|
2013-12-29 05:30:31 +01:00
|
|
|
install -d -m 0700 %{buildroot}%{home} \
|
|
|
|
%{buildroot}%{_rundir}/%{name}
|
2007-03-29 07:17:02 +02:00
|
|
|
#
|
2013-12-29 05:30:31 +01:00
|
|
|
install -d -m 0755 %{buildroot}/var/log/
|
2007-03-29 17:19:09 +02:00
|
|
|
touch %{buildroot}%{home}/{nsd.db,ixfr.db,xfrd.state} %{buildroot}/var/log/nsd.log
|
2006-07-07 14:18:42 +02:00
|
|
|
|
2013-12-29 05:30:31 +01:00
|
|
|
%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
|
|
|
|
|
2006-07-07 14:18:42 +02:00
|
|
|
%clean
|
|
|
|
%{__rm} -rf %{buildroot};
|
|
|
|
|
|
|
|
%pre
|
|
|
|
#
|
|
|
|
# e.g. adding user
|
|
|
|
#
|
|
|
|
%{_sbindir}/groupadd -r %{name} &>/dev/null ||:
|
2013-12-29 05:30:31 +01:00
|
|
|
%{_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
|
2006-07-07 14:18:42 +02:00
|
|
|
|
|
|
|
%post
|
2013-12-29 05:30:31 +01:00
|
|
|
%fillup_only %{name}
|
|
|
|
%if %{with systemd}
|
|
|
|
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
|
|
|
|
%service_add_post %{name}.service
|
|
|
|
%endif
|
2006-07-07 14:18:42 +02:00
|
|
|
|
|
|
|
%preun
|
2013-12-29 05:30:31 +01:00
|
|
|
%if %{with systemd}
|
|
|
|
%service_del_preun %{name}.service
|
|
|
|
%else
|
2006-07-07 14:18:42 +02:00
|
|
|
%stop_on_removal %{name}
|
2013-12-29 05:30:31 +01:00
|
|
|
%endif
|
2006-07-07 14:18:42 +02:00
|
|
|
|
|
|
|
%postun
|
2013-12-29 05:30:31 +01:00
|
|
|
%if %{with systemd}
|
|
|
|
%service_del_postun %{name}.service
|
|
|
|
%else
|
2006-07-07 14:18:42 +02:00
|
|
|
%restart_on_update %{name}
|
|
|
|
%{insserv_cleanup}
|
2013-12-29 05:30:31 +01:00
|
|
|
%endif
|
2006-07-07 14:18:42 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2007-03-29 07:17:02 +02:00
|
|
|
%doc doc/*
|
2006-07-07 14:18:42 +02:00
|
|
|
%doc contrib/
|
2013-12-29 05:30:31 +01:00
|
|
|
%if %{with systemd}
|
|
|
|
%{_unitdir}/nsd.service
|
|
|
|
%{_tmpfilesdir}/nsd.conf
|
|
|
|
%else
|
2006-07-07 14:18:42 +02:00
|
|
|
%{_sysconfdir}/init.d/%{name}
|
2013-12-29 05:30:31 +01:00
|
|
|
%dir %attr(0700,%{name},%{name}) %{_rundir}/%{name}/
|
|
|
|
%endif
|
2006-07-07 14:18:42 +02:00
|
|
|
%{_sbindir}/rcnsd
|
|
|
|
%{_sbindir}/nsd
|
2013-12-29 05:30:31 +01:00
|
|
|
%{_sbindir}/nsd-control
|
|
|
|
%{_sbindir}/nsd-control-setup
|
2007-03-29 07:17:02 +02:00
|
|
|
%{_sbindir}/nsd-checkconf
|
2014-12-15 13:32:10 +01:00
|
|
|
%{_sbindir}/nsd-checkzone
|
2007-03-29 07:17:02 +02:00
|
|
|
%{_mandir}/man5/nsd.conf.5*
|
|
|
|
%{_mandir}/man8/nsd-checkconf.8*
|
2014-12-15 13:32:10 +01:00
|
|
|
%{_mandir}/man8/nsd-checkzone.8*
|
2007-03-29 07:17:02 +02:00
|
|
|
%{_mandir}/man8/nsd.8*
|
2013-12-29 05:30:31 +01:00
|
|
|
%{_mandir}/man8/nsd-control.8*
|
2011-04-12 04:25:25 +02:00
|
|
|
#
|
2013-12-29 05:30:31 +01:00
|
|
|
%config(noreplace) %attr(-,root,%{name}) %{configdir}
|
2011-04-12 04:25:25 +02:00
|
|
|
#
|
2007-03-29 07:17:02 +02:00
|
|
|
%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
|
2011-04-12 04:25:25 +02:00
|
|
|
#
|
|
|
|
%ghost %attr(640,%{name},%{name}) /var/log/nsd.log
|
2013-12-29 05:30:31 +01:00
|
|
|
#
|
2007-03-29 07:17:02 +02:00
|
|
|
|
|
|
|
%changelog
|