Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdnsd/files/, net-dns/pdnsd/
Date: Tue, 13 Aug 2019 16:40:49
Message-Id: 1565714428.0d4f72c0537a122dfdc2eb65e2ac82080b14f18a.polynomial-c@gentoo
1 commit: 0d4f72c0537a122dfdc2eb65e2ac82080b14f18a
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 6 23:32:16 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 13 16:40:28 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d4f72c0
7
8 net-dns/pdnsd: Revbump replacing user eclass
9
10 with pdnsd group/user packages
11 Bump to EAPI-7
12
13 Package-Manager: Portage-2.3.71, Repoman-2.3.17
14 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
15
16 net-dns/pdnsd/files/pdnsd-online.confd | 7 +++
17 net-dns/pdnsd/files/pdnsd.confd | 5 ++
18 net-dns/pdnsd/pdnsd-1.2.9a-r2.ebuild | 106 +++++++++++++++++++++++++++++++++
19 3 files changed, 118 insertions(+)
20
21 diff --git a/net-dns/pdnsd/files/pdnsd-online.confd b/net-dns/pdnsd/files/pdnsd-online.confd
22 new file mode 100644
23 index 00000000000..eb8d764f070
24 --- /dev/null
25 +++ b/net-dns/pdnsd/files/pdnsd-online.confd
26 @@ -0,0 +1,7 @@
27 +# Make sure to change the rc_need variable to the service for the
28 +# interface that connects you to the dns servers.
29 +#
30 +# For instance if you use a PPP connection on ppp0 to connect, set
31 +# rc_need="net.ppp0"
32 +
33 +rc_need="net.lo"
34
35 diff --git a/net-dns/pdnsd/files/pdnsd.confd b/net-dns/pdnsd/files/pdnsd.confd
36 new file mode 100644
37 index 00000000000..87dc6d63ae7
38 --- /dev/null
39 +++ b/net-dns/pdnsd/files/pdnsd.confd
40 @@ -0,0 +1,5 @@
41 +# Command line options, check pdnsd --help for a list of valid
42 +# parameters. Note that most of the options that can be given at
43 +# command-line are also available as configuration parameters in
44 +# /etc/pdnsd/pdnsd.conf
45 +PDNSDCONFIG=""
46
47 diff --git a/net-dns/pdnsd/pdnsd-1.2.9a-r2.ebuild b/net-dns/pdnsd/pdnsd-1.2.9a-r2.ebuild
48 new file mode 100644
49 index 00000000000..941fd2c1f91
50 --- /dev/null
51 +++ b/net-dns/pdnsd/pdnsd-1.2.9a-r2.ebuild
52 @@ -0,0 +1,106 @@
53 +# Copyright 1999-2019 Gentoo Authors
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=7
57 +
58 +inherit systemd
59 +
60 +DESCRIPTION="Proxy DNS server with permanent caching"
61 +HOMEPAGE="http://members.home.nl/p.a.rombouts/pdnsd/"
62 +SRC_URI="http://members.home.nl/p.a.rombouts/pdnsd/releases/${P}-par.tar.gz"
63 +
64 +LICENSE="GPL-3"
65 +SLOT="0"
66 +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~s390 ~sparc ~x86"
67 +IUSE="debug ipv6 isdn +urandom test"
68 +
69 +RDEPEND="
70 + acct-group/pdnsd
71 + acct-user/pdnsd
72 +"
73 +DEPEND="test? ( net-dns/bind-tools )"
74 +
75 +src_configure() {
76 + local myeconfargs=(
77 + --sysconfdir="${EPREFIX}"/etc/pdnsd
78 + --with-cachedir="${EPREFIX}"/var/cache/pdnsd
79 + --with-default-id=pdnsd
80 + $(use_enable ipv6)
81 + $(use_enable ipv6 ipv6-startup)
82 + $(use_enable isdn)
83 + $(usex debug '--with-debug=3' '')
84 + $(usex urandom "--with-random-device=${EPREFIX}/dev/urandom" '')
85 + )
86 +
87 + econf "${myeconfargs[@]}"
88 +}
89 +
90 +src_install() {
91 + local DOCS=( AUTHORS ChangeLog* NEWS README THANKS TODO README.par )
92 + default
93 +
94 + docinto contrib
95 + dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl}
96 +
97 + docinto html
98 + dodoc doc/html/*
99 + docinto txt
100 + dodoc doc/txt/*
101 + newdoc doc/pdnsd.conf pdnsd.conf.sample
102 +
103 + newinitd "${FILESDIR}/pdnsd.rc8" pdnsd
104 + newconfd "${FILESDIR}/pdnsd.confd" pdnsd
105 + newinitd "${FILESDIR}/pdnsd.online.2" pdnsd-online
106 + newconfd "${FILESDIR}/pdnsd-online.confd" pdnsd-online
107 + systemd_newtmpfilesd "${FILESDIR}/pdnsd.tmpfiles" pdnsd.conf
108 + systemd_dounit "${FILESDIR}/pdnsd.service"
109 +}
110 +
111 +src_test() {
112 + fail_kill() {
113 + kill -9 $(<"${T}"/pid)
114 + die "$1"
115 + }
116 +
117 + mkdir "${T}/pdnsd" || die
118 + echo -n -e "pd12\0\0\0\0" > "${T}/pdnsd/pdnsd.cache"
119 + IPS="$(grep ^nameserver /etc/resolv.conf | sed -e 's/nameserver \(.*\)/\tip=\1;/g' | xargs)"
120 + sed -e "s/\tip=/${IPS}/" -e "s:cache_dir=:cache_dir=${T}/pdnsd:" "${FILESDIR}/pdnsd.conf.test" \
121 + > "${T}/pdnsd.conf.test"
122 + src/pdnsd -c "${T}/pdnsd.conf.test" -g -s -d -p "${T}/pid" || die "couldn't start daemon"
123 + sleep 3
124 +
125 + find "${T}" -ls
126 + [ -s "${T}/pid" ] || die "empty or no pid file created"
127 + [ -S "${T}/pdnsd/pdnsd.status" ] || fail_kill "no socket created"
128 + src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" server all up || fail_kill "failed to start the daemon"
129 + src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" status || fail_kill "failed to communicate with the daemon"
130 + sleep 3
131 +
132 + dig @127.0.0.1 -p 33455 localhost > "${T}"/dig.output 2>&1
133 + cat "${T}"/dig.output || die
134 + fgrep -q "status: NOERROR" "${T}"/dig.output || fail_kill "www.gentoo.org lookup failed"
135 +
136 + kill $(<"${T}/pid") || fail_kill "failed to terminate daemon"
137 +}
138 +
139 +pkg_postinst() {
140 + elog
141 + elog "Add pdnsd to your default runlevel - rc-update add pdnsd default"
142 + elog ""
143 + elog "Add pdnsd-online to your online runlevel."
144 + elog "The online interface will be listed in /etc/conf.d/pdnsd-online"
145 + elog ""
146 + elog "Sample config file in /etc/pdnsd/pdnsd.conf.sample"
147 +
148 + # The tmpfiles.d configuration does not come into effect before the
149 + # next reboot so create the cachedir now.
150 + local cachedir="${EPREFIX}/var/cache/pdnsd"
151 + if [[ ! -d "${cachedir}" ]] ; then
152 + mkdir "${cachedir}" || eerror "Failed to create cache"
153 + fi
154 + chown pdnsd:pdnsd "${cachedir}" \
155 + || eerror "Failed to set ownership for cachedir"
156 + chmod 0750 "${cachedir}" \
157 + || eerror "Failed to set permissions for cachedir"
158 +}