nsd.spec revision 1.1 1 1.1 christos Summary: NSD is a complete implementation of an authoritative DNS name server
2 1.1 christos Name: nsd
3 1.1 christos Version: 4.1.6
4 1.1 christos Release: 1%{?dist}
5 1.1 christos License: BSD
6 1.1 christos Url: http://www.nlnetlabs.nl/%{name}/
7 1.1 christos #Source: http://www.nlnetlabs.nl/downloads/%{name}/%{name}-%{version}.tar.gz
8 1.1 christos Source: %{name}-%{version}.tar.gz
9 1.1 christos Source1: nsd.init
10 1.1 christos Source2: nsd.cron
11 1.1 christos Group: System Environment/Daemons
12 1.1 christos BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13 1.1 christos BuildRequires: flex, openssl-devel
14 1.1 christos Requires(pre): shadow-utils
15 1.1 christos
16 1.1 christos %description
17 1.1 christos NSD is a complete implementation of an authoritative DNS name server.
18 1.1 christos It can function as a primary or secondary DNS server, with DNSSEC support.
19 1.1 christos For further information about what NSD is and what NSD is not please
20 1.1 christos consult the REQUIREMENTS document which is a part of this distribution.
21 1.1 christos (thanks to Olaf).
22 1.1 christos
23 1.1 christos %prep
24 1.1 christos %setup -q -n %{name}-%{version}
25 1.1 christos
26 1.1 christos %build
27 1.1 christos %configure --enable-pie --enable-relro-now --enable-ratelimit \
28 1.1 christos --enable-bind8-stats --enable-plugins --enable-checking \
29 1.1 christos --enable-mmap --with-ssl --enable-nsec3 --enable-nsid \
30 1.1 christos --with-pidfile=%{_localstatedir}/run/%{name}/%{name}.pid --with-ssl \
31 1.1 christos --with-user=nsd --with-xfrdfile=%{_localstatedir}/lib/%{name}/ixfr.state
32 1.1 christos
33 1.1 christos %{__make} %{?_smp_mflags}
34 1.1 christos #convert to utf8
35 1.1 christos iconv -f iso8859-1 -t utf-8 doc/RELNOTES > doc/RELNOTES.utf8
36 1.1 christos iconv -f iso8859-1 -t utf-8 doc/CREDITS > doc/CREDITS.utf8
37 1.1 christos mv -f doc/RELNOTES.utf8 doc/RELNOTES
38 1.1 christos mv -f doc/CREDITS.utf8 doc/CREDITS
39 1.1 christos
40 1.1 christos
41 1.1 christos %install
42 1.1 christos rm -rf %{buildroot}
43 1.1 christos %{__make} DESTDIR=%{buildroot} install
44 1.1 christos install -d -m 0755 %{buildroot}%{_initrddir}
45 1.1 christos install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly
46 1.1 christos install -c -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/nsd
47 1.1 christos install -m 0755 %{SOURCE1} %{buildroot}/%{_initrddir}/nsd
48 1.1 christos install -d -m 0700 %{buildroot}%{_localstatedir}/run/%{name}
49 1.1 christos install -d -m 0700 %{buildroot}%{_localstatedir}/lib/%{name}
50 1.1 christos
51 1.1 christos # change .sample to normal config files
52 1.1 christos head -76 %{buildroot}%{_sysconfdir}/nsd/nsd.conf.sample > %{buildroot}%{_sysconfdir}/nsd/nsd.conf
53 1.1 christos rm %{buildroot}%{_sysconfdir}/nsd/nsd.conf.sample
54 1.1 christos echo "database: /var/lib/nsd/nsd.db" >> %{buildroot}%{_sysconfdir}/nsd/nsd.conf
55 1.1 christos echo "# include: \"/some/path/file\"" >> %{buildroot}%{_sysconfdir}/nsd/nsd.conf
56 1.1 christos
57 1.1 christos %clean
58 1.1 christos rm -rf ${RPM_BUILD_ROOT}
59 1.1 christos
60 1.1 christos %files
61 1.1 christos %defattr(-,root,root,-)
62 1.1 christos %doc doc/*
63 1.1 christos %doc contrib/nsd.zones2nsd.conf
64 1.1 christos %dir %{_sysconfdir}/nsd/
65 1.1 christos %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.conf
66 1.1 christos #%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.zones
67 1.1 christos %attr(0755,root,root) %{_initrddir}/%{name}
68 1.1 christos %{_sysconfdir}/cron.hourly/nsd
69 1.1 christos %attr(0755,%{name},%{name}) %dir %{_localstatedir}/run/%{name}
70 1.1 christos %attr(0755,%{name},%{name}) %dir %{_localstatedir}/lib/%{name}
71 1.1 christos %{_sbindir}/*
72 1.1 christos %{_mandir}/*/*
73 1.1 christos
74 1.1 christos %pre
75 1.1 christos getent group nsd >/dev/null || groupadd -r nsd
76 1.1 christos getent passwd nsd >/dev/null || \
77 1.1 christos useradd -r -g nsd -d /etc/nsd -s /sbin/nologin \
78 1.1 christos -c "nsd daemon account" nsd
79 1.1 christos exit 0
80 1.1 christos
81 1.1 christos %post
82 1.1 christos /sbin/chkconfig --add %{name}
83 1.1 christos
84 1.1 christos %preun
85 1.1 christos if [ $1 -eq 0 ]; then
86 1.1 christos /sbin/service %{name} stop
87 1.1 christos /sbin/chkconfig --del %{name}
88 1.1 christos fi
89 1.1 christos
90 1.1 christos %postun
91 1.1 christos if [ "$1" -ge "1" ]; then
92 1.1 christos /sbin/service %{name} condrestart
93 1.1 christos fi
94