Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/carbon/files/, dev-python/carbon/
Date: Tue, 03 May 2016 13:21:16
Message-Id: 1462281646.3a4d27ad1fe202a62851a317af7f1784c685939d.patrick@gentoo
1 commit: 3a4d27ad1fe202a62851a317af7f1784c685939d
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 3 13:20:46 2016 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Tue May 3 13:20:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a4d27ad
7
8 dev-python/carbon: Fix relay-rules check in init script
9
10 Package-Manager: portage-2.2.28
11
12 dev-python/carbon/carbon-0.9.13-r1.ebuild | 65 +++++++++++++++++++++++++++++++
13 dev-python/carbon/carbon-0.9.14-r1.ebuild | 65 +++++++++++++++++++++++++++++++
14 dev-python/carbon/carbon-0.9.15-r1.ebuild | 65 +++++++++++++++++++++++++++++++
15 dev-python/carbon/files/carbon.initd2 | 53 +++++++++++++++++++++++++
16 4 files changed, 248 insertions(+)
17
18 diff --git a/dev-python/carbon/carbon-0.9.13-r1.ebuild b/dev-python/carbon/carbon-0.9.13-r1.ebuild
19 new file mode 100644
20 index 0000000..a38c39e
21 --- /dev/null
22 +++ b/dev-python/carbon/carbon-0.9.13-r1.ebuild
23 @@ -0,0 +1,65 @@
24 +# Copyright 1999-2016 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +# $Id$
27 +
28 +EAPI=5
29 +
30 +PYTHON_COMPAT=( python2_7 )
31 +
32 +inherit distutils-r1
33 +
34 +DESCRIPTION="Backend data caching and persistence daemon for Graphite"
35 +HOMEPAGE="http://graphite.wikidot.com/"
36 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
37 +
38 +SLOT="0"
39 +LICENSE="Apache-2.0"
40 +KEYWORDS="~amd64 ~x86"
41 +IUSE=""
42 +
43 +DEPEND=""
44 +RDEPEND="
45 + dev-python/twisted-core[${PYTHON_USEDEP}]
46 + dev-python/whisper[${PYTHON_USEDEP}]
47 + dev-python/txAMQP[${PYTHON_USEDEP}]"
48 +
49 +PATCHES=(
50 + # Do not install the configuration and data files. We install them
51 + # somewhere sensible by hand.
52 + "${FILESDIR}"/${PN}-0.9.12-no-data-files.patch
53 + )
54 +
55 +python_prepare_all() {
56 + # This sets prefix to /opt/graphite. We want FHS-style paths instead.
57 + rm setup.cfg || die
58 + distutils-r1_python_prepare_all
59 +}
60 +
61 +python_install_all() {
62 + distutils-r1_python_install_all
63 +
64 + insinto /etc/carbon
65 + doins conf/*
66 +
67 + dodir /var/log/carbon /var/lib/carbon/{whisper,lists,rrd}
68 +
69 + newinitd "${FILESDIR}"/carbon.initd2 carbon-cache
70 + newinitd "${FILESDIR}"/carbon.initd2 carbon-relay
71 + newinitd "${FILESDIR}"/carbon.initd2 carbon-aggregator
72 +
73 + newconfd "${FILESDIR}"/carbon.confd carbon-cache
74 + newconfd "${FILESDIR}"/carbon.confd carbon-relay
75 + newconfd "${FILESDIR}"/carbon.confd carbon-aggregator
76 +}
77 +
78 +pkg_postinst() {
79 + einfo 'This ebuild installs carbon into FHS-style paths.'
80 + einfo 'You will probably have to set GRAPHITE_CONF_DIR to /etc/carbon'
81 + einfo 'and GRAPHITE_STORAGE_DIR to /var/lib/carbon to make use of this'
82 + einfo '(see /etc/carbon/carbon.conf.example).'
83 + einfo ' '
84 + einfo 'OpenRC init script supports multiple instances !'
85 + einfo 'Example to run an instance b of carbon-cache :'
86 + einfo ' ln -s /etc/init.d/carbon-cache /etc/init.d/carbon-cache.b'
87 + einfo ' cp /etc/conf.d/carbon-cache /etc/conf.d/carbon-cache.b'
88 +}
89
90 diff --git a/dev-python/carbon/carbon-0.9.14-r1.ebuild b/dev-python/carbon/carbon-0.9.14-r1.ebuild
91 new file mode 100644
92 index 0000000..cd241d9
93 --- /dev/null
94 +++ b/dev-python/carbon/carbon-0.9.14-r1.ebuild
95 @@ -0,0 +1,65 @@
96 +# Copyright 1999-2016 Gentoo Foundation
97 +# Distributed under the terms of the GNU General Public License v2
98 +# $Id$
99 +
100 +EAPI=5
101 +
102 +PYTHON_COMPAT=( python2_7 )
103 +
104 +inherit distutils-r1
105 +
106 +DESCRIPTION="Backend data caching and persistence daemon for Graphite"
107 +HOMEPAGE="http://graphite.wikidot.com/"
108 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
109 +
110 +SLOT="0"
111 +LICENSE="Apache-2.0"
112 +KEYWORDS="~amd64 ~x86 ~x64-solaris"
113 +
114 +# whisper appears to have been missed from listing in install_requires in setup.py
115 +RDEPEND="
116 + dev-python/twisted-core[${PYTHON_USEDEP}]
117 + dev-python/whisper[${PYTHON_USEDEP}]
118 + dev-python/txAMQP[${PYTHON_USEDEP}]"
119 +
120 +PATCHES=(
121 + # Do not install the configuration and data files. We install them
122 + # somewhere sensible by hand. Patch for this vn. 0.9.14 has been extended
123 + # due to redhat's init scripts set to install unconditionally in setup.py
124 + "${FILESDIR}"/${P}-no-data-files.patch
125 + )
126 +
127 +python_prepare_all() {
128 + # This sets prefix to /opt/graphite. We want FHS-style paths instead.
129 + rm setup.cfg || die
130 + distutils-r1_python_prepare_all
131 +}
132 +
133 +python_install_all() {
134 + distutils-r1_python_install_all
135 +
136 + insinto /etc/carbon
137 + doins conf/*
138 +
139 + dodir /var/log/carbon /var/lib/carbon/{whisper,lists,rrd}
140 +
141 + newinitd "${FILESDIR}"/carbon.initd2 carbon-cache
142 + newinitd "${FILESDIR}"/carbon.initd2 carbon-relay
143 + newinitd "${FILESDIR}"/carbon.initd2 carbon-aggregator
144 +
145 + newconfd "${FILESDIR}"/carbon.confd carbon-cache
146 + newconfd "${FILESDIR}"/carbon.confd carbon-relay
147 + newconfd "${FILESDIR}"/carbon.confd carbon-aggregator
148 +}
149 +
150 +pkg_postinst() {
151 + einfo 'This ebuild installs carbon into FHS-style paths.'
152 + einfo 'You will probably have to set GRAPHITE_CONF_DIR to /etc/carbon'
153 + einfo 'and GRAPHITE_STORAGE_DIR to /var/lib/carbon to make use of this'
154 + einfo '(see /etc/carbon/carbon.conf.example).'
155 + einfo ' '
156 + einfo 'OpenRC init script supports multiple instances !'
157 + einfo 'Example to run an instance b of carbon-cache :'
158 + einfo ' ln -s /etc/init.d/carbon-cache /etc/init.d/carbon-cache.b'
159 + einfo ' cp /etc/conf.d/carbon-cache /etc/conf.d/carbon-cache.b'
160 +}
161
162 diff --git a/dev-python/carbon/carbon-0.9.15-r1.ebuild b/dev-python/carbon/carbon-0.9.15-r1.ebuild
163 new file mode 100644
164 index 0000000..37560df
165 --- /dev/null
166 +++ b/dev-python/carbon/carbon-0.9.15-r1.ebuild
167 @@ -0,0 +1,65 @@
168 +# Copyright 1999-2016 Gentoo Foundation
169 +# Distributed under the terms of the GNU General Public License v2
170 +# $Id$
171 +
172 +EAPI=5
173 +
174 +PYTHON_COMPAT=( python2_7 )
175 +
176 +inherit distutils-r1
177 +
178 +DESCRIPTION="Backend data caching and persistence daemon for Graphite"
179 +HOMEPAGE="http://graphite.wikidot.com/"
180 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
181 +
182 +SLOT="0"
183 +LICENSE="Apache-2.0"
184 +KEYWORDS="~amd64 ~x86 ~x64-solaris"
185 +
186 +# whisper appears to have been missed from listing in install_requires in setup.py
187 +RDEPEND="
188 + dev-python/twisted-core[${PYTHON_USEDEP}]
189 + dev-python/whisper[${PYTHON_USEDEP}]
190 + dev-python/txAMQP[${PYTHON_USEDEP}]"
191 +
192 +PATCHES=(
193 + # Do not install the configuration and data files. We install them
194 + # somewhere sensible by hand. Patch for this vn. 0.9.14 has been extended
195 + # due to redhat's init scripts set to install unconditionally in setup.py
196 + "${FILESDIR}"/${PN}-0.9.14-no-data-files.patch
197 + )
198 +
199 +python_prepare_all() {
200 + # This sets prefix to /opt/graphite. We want FHS-style paths instead.
201 + rm setup.cfg || die
202 + distutils-r1_python_prepare_all
203 +}
204 +
205 +python_install_all() {
206 + distutils-r1_python_install_all
207 +
208 + insinto /etc/carbon
209 + doins conf/*
210 +
211 + dodir /var/log/carbon /var/lib/carbon/{whisper,lists,rrd}
212 +
213 + newinitd "${FILESDIR}"/carbon.initd2 carbon-cache
214 + newinitd "${FILESDIR}"/carbon.initd2 carbon-relay
215 + newinitd "${FILESDIR}"/carbon.initd2 carbon-aggregator
216 +
217 + newconfd "${FILESDIR}"/carbon.confd carbon-cache
218 + newconfd "${FILESDIR}"/carbon.confd carbon-relay
219 + newconfd "${FILESDIR}"/carbon.confd carbon-aggregator
220 +}
221 +
222 +pkg_postinst() {
223 + einfo 'This ebuild installs carbon into FHS-style paths.'
224 + einfo 'You will probably have to set GRAPHITE_CONF_DIR to /etc/carbon'
225 + einfo 'and GRAPHITE_STORAGE_DIR to /var/lib/carbon to make use of this'
226 + einfo '(see /etc/carbon/carbon.conf.example).'
227 + einfo ' '
228 + einfo 'OpenRC init script supports multiple instances !'
229 + einfo 'Example to run an instance b of carbon-cache :'
230 + einfo ' ln -s /etc/init.d/carbon-cache /etc/init.d/carbon-cache.b'
231 + einfo ' cp /etc/conf.d/carbon-cache /etc/conf.d/carbon-cache.b'
232 +}
233
234 diff --git a/dev-python/carbon/files/carbon.initd2 b/dev-python/carbon/files/carbon.initd2
235 new file mode 100644
236 index 0000000..1dea421
237 --- /dev/null
238 +++ b/dev-python/carbon/files/carbon.initd2
239 @@ -0,0 +1,53 @@
240 +#!/sbin/runscript
241 +# Copyright 1999-2016 Gentoo Foundation
242 +# Distributed under the terms of the GNU General Public License v2
243 +
244 +export GRAPHITE_CONF_DIR=/etc/carbon
245 +export GRAPHITE_STORAGE_DIR=/var/lib/carbon
246 +
247 +INSTANCE=${SVCNAME/#*.}
248 +if [ "${INSTANCE}" == "${SVCNAME}" ]; then
249 + INSTANCE="a"
250 +fi
251 +
252 +PIDFILE="/var/run/${SVCNAME}.pid"
253 +PROGRAMNAME=${SVCNAME/.*}
254 +
255 +CARBON_CONFIG=${CARBON_CONFIG:-/etc/carbon/carbon.conf}
256 +
257 +depend() {
258 + use net
259 +}
260 +
261 +
262 +start_pre() {
263 + if [ ! -f ${CARBON_CONFIG} ] ; then
264 + eend "Missing ${CARBON_CONFIG}"
265 + fi
266 + case "${PROGRAMNAME}" in
267 + "carbon-relay" )
268 + if `grep -q "^RELAY_METHOD = rules$" ${CARBON_CONFIG}`; then
269 + [ -f /etc/carbon/relay-rules.conf ] || eend "Missing relay-rules.conf"
270 + fi
271 + ;;
272 + "carbon-aggregator" )
273 + [ -f /etc/carbon/aggregation-rules.conf ] || eend "Missing missing aggregation-rules.conf"
274 + ;;
275 + esac
276 +}
277 +
278 +start() {
279 + ebegin "Starting ${PROGRAMNAME} instance ${INSTANCE}"
280 + start-stop-daemon --start --exec /usr/bin/${PROGRAMNAME}.py \
281 + --pidfile ${PIDFILE} \
282 + -- --pidfile ${PIDFILE} --instance ${INSTANCE} \
283 + --logdir /var/log/carbon/ --config ${CARBON_CONFIG} start >/dev/null
284 + eend $? "Failed to start ${SVCNAME}"
285 +}
286 +
287 +stop() {
288 + ebegin "Stopping ${PROGRAMNAME} instance ${INSTANCE}"
289 + start-stop-daemon --stop \
290 + --pidfile ${PIDFILE}
291 + eend $? "Failed to stop ${SVCNAME}"
292 +}