diff --git a/.gitignore b/.gitignore index 28dbe0c..9ec8c5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ maradns-1.3.07.09.tar.lzma +/maradns-2.0.06.tar.xz diff --git a/dead.package b/dead.package deleted file mode 100644 index b8c7442..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -This package was retired on 2012-02-06 due to lack of a maintainer. diff --git a/maradns-0001-add-systemd-unit-files-Fedora-15-and-later-RHEL7.patch b/maradns-0001-add-systemd-unit-files-Fedora-15-and-later-RHEL7.patch new file mode 100644 index 0000000..39634a0 --- /dev/null +++ b/maradns-0001-add-systemd-unit-files-Fedora-15-and-later-RHEL7.patch @@ -0,0 +1,87 @@ +From d82391b6f2c2a3632d3a6bfea91e120d8694bbb4 Mon Sep 17 00:00:00 2001 +From: Tomasz Torcz +Date: Mon, 16 Jul 2012 16:04:59 +0200 +Subject: [PATCH] add systemd unit files (Fedora 15 and later, RHEL7) + +--- + build/install.sh | 10 ++++++++++ + build/maradns-deadwood.service | 11 +++++++++++ + build/maradns-zoneserver.service | 11 +++++++++++ + build/maradns.service | 11 +++++++++++ + 4 files changed, 43 insertions(+) + create mode 100644 build/maradns-deadwood.service + create mode 100644 build/maradns-zoneserver.service + create mode 100644 build/maradns.service + +diff --git a/build/install.sh b/build/install.sh +index 2e81170..fabc4f6 100755 +--- a/build/install.sh ++++ b/build/install.sh +@@ -211,3 +211,13 @@ if [ -d $RPM_BUILD_ROOT/etc/rc.d/init.d ] ; then + fi + fi + ++# copy systemd unit files if systemd is available ++UNITDIR=$( pkg-config --variable=systemdsystemunitdir systemd ) ++if [ -d "$UNITDIR" ]; then ++ echo Installing systemd unit files in $UNITDIR ++ cp $BUILDDIR/maradns.service $UNITDIR/maradns.service ++ cp $BUILDDIR/maradns-zoneserver.service $UNITDIR/maradns-zoneserver.service ++ cp $BUILDDIR/maradns-deadwood.service $UNITDIR/maradns-deadwood.service ++fi ++ ++ +diff --git a/build/maradns-deadwood.service b/build/maradns-deadwood.service +new file mode 100644 +index 0000000..db822fb +--- /dev/null ++++ b/build/maradns-deadwood.service +@@ -0,0 +1,11 @@ ++[Unit] ++Description=MaraDNS secure Domain Name Server (DNS) recursive resolver ++Documentation=man:Deadwood(1) ++Requires=network.target ++ ++[Service] ++ExecStart=/usr/sbin/Deadwood ++Restart=always ++ ++[Install] ++WantedBy=multi-user.target +diff --git a/build/maradns-zoneserver.service b/build/maradns-zoneserver.service +new file mode 100644 +index 0000000..12ca8f2 +--- /dev/null ++++ b/build/maradns-zoneserver.service +@@ -0,0 +1,11 @@ ++[Unit] ++Description=MaraDNS Zoneserver handles DNS zone transfers and any TCP DNS queries ++Documentation=man:zoneserver(8) ++Requires=network.target ++ ++[Service] ++ExecStart=/usr/sbin/zoneserver -f /etc/mararc ++Restart=always ++ ++[Install] ++WantedBy=multi-user.target +diff --git a/build/maradns.service b/build/maradns.service +new file mode 100644 +index 0000000..8e3a1ff +--- /dev/null ++++ b/build/maradns.service +@@ -0,0 +1,11 @@ ++[Unit] ++Description=MaraDNS secure Domain Name Server (DNS) ++Documentation=man:maradns(8) ++Requires=network.target ++ ++[Service] ++ExecStart=/usr/sbin/maradns -f /etc/mararc ++Restart=always ++ ++[Install] ++WantedBy=multi-user.target +-- +1.7.10.4 + diff --git a/maradns.spec b/maradns.spec new file mode 100644 index 0000000..647fde6 --- /dev/null +++ b/maradns.spec @@ -0,0 +1,181 @@ +Name: maradns +Version: 2.0.06 +Release: 3%{?dist} +Summary: Authoritative and recursive DNS server made with security in mind +# recursive resolver is shipped in versioned directory +%global dwood_ver 3.2.02 + +Source0: http://www.maradns.org/download/2.0/%{version}/%{name}-%{version}.tar.xz +# submitted upstream: http://woodlane.webconquest.com/pipermail/list/2012-July/001123.html +Patch0: %{name}-0001-add-systemd-unit-files-Fedora-15-and-later-RHEL7.patch +License: BSD +URL: http://www.maradns.org/ + +BuildRequires: systemd-units +Requires(pre): shadow-utils +%systemd_requires + +%description +MaraDNS is a package that implements the Domain Name Service (DNS), an +essential internet service. MaraDNS has the following advantages: + * Secure. + * Supported. + * Easy to use. + * Small. + * Open Source. + +%prep +%setup -q +%patch0 -p1 + +# wrong permissions +chmod 0644 doc/en/man/make.pdf +chmod 0644 doc/en/tutorial/make.index +chmod 0644 doc/en/webpage/make.page + +%build + +# We don't use %%configure here because this is a homebrew configure not generated by autoconf +./configure --ipv6 --libdir=%{_libdir} + +# first compile Deadwood, otherwise we have no control over make flags +pushd deadwood-%{dwood_ver}/src +make %{?_smp_mflags} FLAGS="%{optflags} -DIPV6 -lrt" +popd +make %{?_smp_mflags} FLAGS="%{optflags} -DSELECT_PROBLEM -DAUTHONLY" + + +%install +# create /etc/maradns, /etc/mararc and /etc/dwood3rc first +install -p -d -m 0755 %{buildroot}%{_sysconfdir}/maradns/logger/ +install -p -D -m 0644 build/rpm.mararc %{buildroot}%{_sysconfdir}/mararc +install -p -D -m 0644 deadwood-%{dwood_ver}/doc/dwood3rc %{buildroot}%{_sysconfdir}/dwood3rc + +# cache dir +install -p -d -m 0755 %{buildroot}/var/cache/deadwood + +# sbin files +install -p -D -m 0755 server/maradns %{buildroot}%{_sbindir}/maradns +install -p -D -m 0755 tcp/zoneserver %{buildroot}%{_sbindir}/zoneserver +install -p -D -m 0755 deadwood-%{dwood_ver}/src/Deadwood %{buildroot}%{_sbindir}/Deadwood + +# bin files +install -p -D -m 0755 tcp/getzone %{buildroot}%{_bindir}/getzone +install -p -D -m 0755 tcp/fetchzone %{buildroot}%{_bindir}/fetchzone +install -p -D -m 0755 tools/askmara %{buildroot}%{_bindir}/askmara + +# man pages +install -p -d -m 0755 %{buildroot}%{_mandir}/man{1,5,8} +install -p -D -m 0644 -t %{buildroot}%{_mandir}/man1/ \ + doc/en/man/askmara.1 \ + doc/en/man/getzone.1 \ + doc/en/man/fetchzone.1 +install -p -D -m 0644 -t %{buildroot}%{_mandir}/man1/ \ + deadwood-%{dwood_ver}/doc/Deadwood.1 +install -p -D -m 0644 -t %{buildroot}%{_mandir}/man5/ \ + doc/en/man/csv1.5 \ + doc/en/man/csv2.5 \ + doc/en/man/csv2_txt.5 \ + doc/en/man/mararc.5 +install -p -D -m 0644 -t %{buildroot}%{_mandir}/man8/ \ + doc/en/man/maradns.8 \ + doc/en/man/zoneserver.8 \ + +# systemd units +mkdir -p %{buildroot}%{_unitdir} +install -p -D -m 0644 -t %{buildroot}%{_unitdir}/ \ + build/maradns.service \ + build/maradns-zoneserver.service \ + build/maradns-deadwood.service + +%files +%doc COPYING doc/en/changelog.txt doc/en/credits.txt doc/en/faq.txt doc/en/{examples,tutorial,webpage} +%config(noreplace) %{_sysconfdir}/mararc +%config(noreplace) %{_sysconfdir}/dwood3rc +%attr(-,maradns,maradns) %{_sysconfdir}/maradns/ +%attr(-,maradns,maradns) /var/cache/deadwood/ +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}-zoneserver.service +%{_unitdir}/%{name}-deadwood.service + +%{_bindir}/askmara +%{_bindir}/fetchzone +%{_bindir}/getzone +%{_sbindir}/maradns +%{_sbindir}/zoneserver +%{_sbindir}/Deadwood + +%{_mandir}/man1/askmara.1* +%{_mandir}/man1/getzone.1* +%{_mandir}/man1/fetchzone.1* +%{_mandir}/man1/Deadwood.1* +%{_mandir}/man5/csv1.5* +%{_mandir}/man5/csv2.5* +%{_mandir}/man5/csv2_txt.5* +%{_mandir}/man5/mararc.5* +%{_mandir}/man8/maradns.8* +%{_mandir}/man8/zoneserver.8* + + +%pre +if [ $1 -eq 1 ]; then + getent group maradns >/dev/null || groupadd -r maradns + getent passwd maradns >/dev/null || \ + useradd -r -g maradns -d /etc/maradns -s /sbin/nologin \ + -c "MaraDns chroot user" maradns + exit 0 +fi + + +%post +if [ $1 -eq 1 ]; then + # correct UID/GID of maradns user + sed --in-place -e "s/^maradns_uid.*/maradns_uid = $(id -u maradns)/" %{_sysconfdir}/mararc + sed --in-place -e "s/^maradns_gid.*/maradns_gid = $(id -g maradns)/" %{_sysconfdir}/mararc + sed --in-place -e "s/^maradns_uid.*/maradns_uid = $(id -u maradns)/" %{_sysconfdir}/dwood3rc + sed --in-place -e "s/^maradns_gid.*/maradns_gid = $(id -g maradns)/" %{_sysconfdir}/dwood3rc + # correct cache file directory + sed --in-place -e 's@/etc/deadwood@/var/cache/deadwood@' %{_sysconfdir}/dwood3rc +fi +%systemd_post maradns.service maradns-zoneserver.service maradns-deadwood.service + +%preun +%systemd_preun maradns.service maradns-zoneserver.service maradns-deadwood.service + +%postun +%systemd_postun_with_restart maradns.service maradns-zoneserver.service maradns-deadwood.service + +%triggerun -- maradns < 1.3.07.09-6 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply maradns +# systemd-sysv-convert --apply maradns-zoneserver +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save maradns >/dev/null 2>&1 ||: +/usr/bin/systemd-sysv-convert --save maradns-zoneserver >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del maradns >/dev/null 2>&1 || : +/bin/systemctl try-restart maradns.service >/dev/null 2>&1 || : +/sbin/chkconfig --del maradns-zoneserver >/dev/null 2>&1 || : +/bin/systemctl try-restart maradns-zoneserver.service >/dev/null 2>&1 || : + + +%changelog +* Mon Oct 22 2012 Tomasz Torcz - 2.0.06-3 +- fix review issues + - use name macro in Patch, rename Patch itself + - add "-p" to install lines + - add --libdir... to configure +- use macros for systemd operations + +* Tue Aug 21 2012 Tomasz Torcz - 2.0.06-2 +- provide link to patch sent upstream +- review remarks: + - removed grouptag + - do not use macros for system executables + - use more readable version of sed command in post + - remove maradns.gpg.key + - be more specific in doc line + +* Mon Jul 16 2012 Tomasz Torcz - 2.0.06-1 +- initial package for 2.0 branch diff --git a/sources b/sources new file mode 100644 index 0000000..7c71880 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +3dbe820936fb7e99551925819e689d0a maradns-2.0.06.tar.xz