Gentoo Archives: gentoo-commits

From: Sven Wegener <swegener@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns-recursor/, net-dns/pdns-recursor/files/
Date: Thu, 25 May 2017 15:05:01
Message-Id: 1495724686.38f6898fabe5d0954bed1b965a9217679b5b43d7.swegener@gentoo
1 commit: 38f6898fabe5d0954bed1b965a9217679b5b43d7
2 Author: Sven Wegener <swegener <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 14 13:26:33 2017 +0000
4 Commit: Sven Wegener <swegener <AT> gentoo <DOT> org>
5 CommitDate: Thu May 25 15:04:46 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38f6898f
7
8 net-dns/pdns-recursor: Update init script
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 net-dns/pdns-recursor/files/pdns-recursor-r1 | 37 +++++++++++
13 .../pdns-recursor/pdns-recursor-4.0.4-r1.ebuild | 75 ++++++++++++++++++++++
14 2 files changed, 112 insertions(+)
15
16 diff --git a/net-dns/pdns-recursor/files/pdns-recursor-r1 b/net-dns/pdns-recursor/files/pdns-recursor-r1
17 new file mode 100644
18 index 00000000000..57c9df1eaa4
19 --- /dev/null
20 +++ b/net-dns/pdns-recursor/files/pdns-recursor-r1
21 @@ -0,0 +1,37 @@
22 +#!/sbin/openrc-run
23 +# Copyright 1999-2017 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +PDNS_CONFIGDIR="${PDNS_CONFIGDIR:-/etc/powerdns}"
27 +
28 +PDNS_CONFIG="${PDNS_CONFIGDIR}/recursor.conf"
29 +PDNS_CHROOTDIR="$( awk -F = '$1 == "chroot" { print $2 }' "${PDNS_CONFIG}" )"
30 +PDNS_SOCKETDIR="$( awk -F = '$1 == "socket-dir" { print $2 }' "${PDNS_CONFIG}" )"
31 +[ -z "${PDNS_SOCKETDIR}" -a -z "${PDNS_CHROOTDIR}" ] && PDNS_SOCKETDIR="/var/run"
32 +
33 +name="PowerDNS Recursor"
34 +description="Recursive name server"
35 +
36 +extra_started_commands="ping"
37 +description_ping="Ping the PowerDNS instance"
38 +
39 +command="/usr/sbin/pdns_recursor"
40 +command_args="--config-dir=${PDNS_CONFIGDIR}"
41 +command_args_foreground="--daemon=no"
42 +command_args_background="--daemon=yes"
43 +yesno ${rc_verbose} || command_args_background="${command_args_background} >/dev/null 2>&1"
44 +
45 +pidfile="${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}/pdns_recursor.pid"
46 +
47 +control_command="/usr/bin/rec_control"
48 +control_command_args="${command_args}"
49 +
50 +depend() {
51 + need net
52 +}
53 +
54 +ping() {
55 + ebegin "Pinging ${name}"
56 + ${control_command} ${control_command_args} ping >/dev/null 2>&1
57 + eend $?
58 +}
59
60 diff --git a/net-dns/pdns-recursor/pdns-recursor-4.0.4-r1.ebuild b/net-dns/pdns-recursor/pdns-recursor-4.0.4-r1.ebuild
61 new file mode 100644
62 index 00000000000..b748e27b710
63 --- /dev/null
64 +++ b/net-dns/pdns-recursor/pdns-recursor-4.0.4-r1.ebuild
65 @@ -0,0 +1,75 @@
66 +# Copyright 1999-2017 Gentoo Foundation
67 +# Distributed under the terms of the GNU General Public License v2
68 +
69 +EAPI="6"
70 +
71 +inherit toolchain-funcs flag-o-matic eutils versionator
72 +
73 +DESCRIPTION="The PowerDNS Recursor"
74 +HOMEPAGE="https://www.powerdns.com/"
75 +SRC_URI="https://downloads.powerdns.com/releases/${P/_/-}.tar.bz2"
76 +
77 +LICENSE="GPL-2"
78 +SLOT="0"
79 +KEYWORDS="~amd64 ~arm ~x86"
80 +IUSE="lua luajit protobuf systemd"
81 +REQUIRED_USE="?? ( lua luajit )"
82 +
83 +DEPEND="lua? ( >=dev-lang/lua-5.1:= )
84 + luajit? ( dev-lang/luajit:= )
85 + protobuf? (
86 + dev-libs/protobuf
87 + >=dev-libs/boost-1.42
88 + )
89 + systemd? ( sys-apps/systemd:0= )
90 + >=dev-libs/boost-1.35"
91 +RDEPEND="${DEPEND}
92 + !<net-dns/pdns-2.9.20-r1"
93 +DEPEND="${DEPEND}
94 + virtual/pkgconfig"
95 +
96 +S="${WORKDIR}"/${P/_/-}
97 +
98 +pkg_setup() {
99 + filter-flags -ftree-vectorize
100 +}
101 +
102 +src_configure() {
103 + econf \
104 + --sysconfdir=/etc/powerdns \
105 + $(use_enable systemd) \
106 + $(use_with lua) \
107 + $(use_with luajit) \
108 + $(use_with protobuf)
109 +}
110 +
111 +src_install() {
112 + default
113 +
114 + mv "${D}"/etc/powerdns/recursor.conf{-dist,}
115 +
116 + # set defaults: setuid=nobody, setgid=nobody
117 + sed -i \
118 + -e 's/^# set\([ug]\)id=$/set\1id=nobody/' \
119 + -e 's/^# quiet=$/quiet=on/' \
120 + -e 's/^# chroot=$/chroot=\/var\/lib\/powerdns/' \
121 + "${D}"/etc/powerdns/recursor.conf
122 +
123 + newinitd "${FILESDIR}"/pdns-recursor-r1 pdns-recursor
124 +
125 + keepdir /var/lib/powerdns
126 +}
127 +
128 +pkg_postinst() {
129 + local old
130 +
131 + for old in ${REPLACING_VERSIONS}; do
132 + version_compare ${old} 4.0.0-r1
133 + [[ $? -eq 1 ]] || continue
134 +
135 + ewarn "Starting with 4.0.0-r1 the init script has been renamed from precursor"
136 + ewarn "to pdns-recursor, please update your runlevels accordingly."
137 +
138 + break
139 + done
140 +}