net-dns/dnrd: EAPI7 revbump, improve ebuild
authorMichael Mair-Keimberger <m.mairkeimberger@gmail.com>
Wed, 3 Oct 2018 17:44:31 +0000 (19:44 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 19 Oct 2018 22:34:42 +0000 (00:34 +0200)
Closes: https://bugs.gentoo.org/667660
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/10054
Signed-off-by: Michał Górny <mgorny@gentoo.org>
net-dns/dnrd/dnrd-2.20.3-r2.ebuild [new file with mode: 0644]
net-dns/dnrd/files/dnrd
net-dns/dnrd/files/dnrd-2.20.3-docdir.patch

diff --git a/net-dns/dnrd/dnrd-2.20.3-r2.ebuild b/net-dns/dnrd/dnrd-2.20.3-r2.ebuild
new file mode 100644 (file)
index 0000000..5710768
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools user
+
+DESCRIPTION="A caching DNS proxy server"
+HOMEPAGE="http://dnrd.sourceforge.net/"
+SRC_URI="mirror://sourceforge/dnrd/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+PATCHES=( "${FILESDIR}"/${P}-docdir.patch )
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_install() {
+       default
+
+       keepdir /etc/dnrd
+       doinitd "${FILESDIR}"/dnrd
+       newconfd "${FILESDIR}"/dnrd.conf dnrd
+}
+
+pkg_postinst() {
+       enewgroup dnrd
+       enewuser dnrd -1 -1 /dev/null dnrd
+}
index 9fb87107b7a8198df6138c0fb64ab111c0d493bf..4fcc2112cf2ec05c2ca9622edd15df8d8dbae545 100644 (file)
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2003 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License, v2 or later
 
 PIDFILE="/var/run/dnrd.pid"
@@ -11,13 +11,16 @@ depend() {
 
 start() {
        ebegin "Starting dnrd"
-       /usr/sbin/dnrd $DNRD_OPTS &> /dev/null &
+       start-stop-daemon --start \
+               --pidfile ${PIDFILE} \
+               --exec /usr/sbin/dnrd \
+               -- ${DNRD_OPTS}
        eend $?
 }
 
 stop() {
        ebegin "Stopping dnrd"
-       /usr/sbin/dnrd -k       
+       start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
        eend $?
 }
 
index a3d1c8002d510636b3fbac9abf7d0d57e553c4a3..fe0c0d347e7e9d2ff2e90eaf9f4898c22c0da684 100644 (file)
@@ -1,7 +1,7 @@
 Index: doc/Makefile.am
 ===================================================================
---- doc/Makefile.am    (revision 247)
-+++ doc/Makefile.am    (revision 248)
+--- a/doc/Makefile.am  (revision 247)
++++ b/doc/Makefile.am  (revision 248)
 @@ -1,5 +1,4 @@
  PACKAGE = @PACKAGE_TARNAME@
 -docdir = $(datadir)/doc/$(PACKAGE)
@@ -10,8 +10,8 @@ Index: doc/Makefile.am
  EXTRA_DIST = $(man_MANS) $(doc_DATA)
 Index: Makefile.am
 ===================================================================
---- Makefile.am        (revision 247)
-+++ Makefile.am        (revision 248)
+--- a/Makefile.am      (revision 247)
++++ b/Makefile.am      (revision 248)
 @@ -1,6 +1,5 @@
  PACKAGE = @PACKAGE_TARNAME@
  SUBDIRS = src doc