public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Patrick Lauer" <patrick@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/carbon/files/, dev-python/carbon/
Date: Tue,  3 May 2016 13:21:09 +0000 (UTC)	[thread overview]
Message-ID: <1462281646.3a4d27ad1fe202a62851a317af7f1784c685939d.patrick@gentoo> (raw)

commit:     3a4d27ad1fe202a62851a317af7f1784c685939d
Author:     Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Tue May  3 13:20:46 2016 +0000
Commit:     Patrick Lauer <patrick <AT> gentoo <DOT> org>
CommitDate: Tue May  3 13:20:46 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a4d27ad

dev-python/carbon: Fix relay-rules check in init script

Package-Manager: portage-2.2.28

 dev-python/carbon/carbon-0.9.13-r1.ebuild | 65 +++++++++++++++++++++++++++++++
 dev-python/carbon/carbon-0.9.14-r1.ebuild | 65 +++++++++++++++++++++++++++++++
 dev-python/carbon/carbon-0.9.15-r1.ebuild | 65 +++++++++++++++++++++++++++++++
 dev-python/carbon/files/carbon.initd2     | 53 +++++++++++++++++++++++++
 4 files changed, 248 insertions(+)

diff --git a/dev-python/carbon/carbon-0.9.13-r1.ebuild b/dev-python/carbon/carbon-0.9.13-r1.ebuild
new file mode 100644
index 0000000..a38c39e
--- /dev/null
+++ b/dev-python/carbon/carbon-0.9.13-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Backend data caching and persistence daemon for Graphite"
+HOMEPAGE="http://graphite.wikidot.com/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+	dev-python/twisted-core[${PYTHON_USEDEP}]
+	dev-python/whisper[${PYTHON_USEDEP}]
+	dev-python/txAMQP[${PYTHON_USEDEP}]"
+
+PATCHES=(
+	# Do not install the configuration and data files. We install them
+	# somewhere sensible by hand.
+	"${FILESDIR}"/${PN}-0.9.12-no-data-files.patch
+	)
+
+python_prepare_all() {
+	# This sets prefix to /opt/graphite. We want FHS-style paths instead.
+	rm setup.cfg || die
+	distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	insinto /etc/carbon
+	doins conf/*
+
+	dodir /var/log/carbon /var/lib/carbon/{whisper,lists,rrd}
+
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-cache
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-relay
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-aggregator
+
+	newconfd "${FILESDIR}"/carbon.confd carbon-cache
+	newconfd "${FILESDIR}"/carbon.confd carbon-relay
+	newconfd "${FILESDIR}"/carbon.confd carbon-aggregator
+}
+
+pkg_postinst() {
+	einfo 'This ebuild installs carbon into FHS-style paths.'
+	einfo 'You will probably have to set GRAPHITE_CONF_DIR to /etc/carbon'
+	einfo 'and GRAPHITE_STORAGE_DIR to /var/lib/carbon to make use of this'
+	einfo '(see /etc/carbon/carbon.conf.example).'
+	einfo ' '
+	einfo 'OpenRC init script supports multiple instances !'
+	einfo 'Example to run an instance b of carbon-cache :'
+	einfo '    ln -s /etc/init.d/carbon-cache /etc/init.d/carbon-cache.b'
+	einfo '    cp /etc/conf.d/carbon-cache /etc/conf.d/carbon-cache.b'
+}

diff --git a/dev-python/carbon/carbon-0.9.14-r1.ebuild b/dev-python/carbon/carbon-0.9.14-r1.ebuild
new file mode 100644
index 0000000..cd241d9
--- /dev/null
+++ b/dev-python/carbon/carbon-0.9.14-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Backend data caching and persistence daemon for Graphite"
+HOMEPAGE="http://graphite.wikidot.com/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86 ~x64-solaris"
+
+# whisper appears to have been missed from listing in install_requires in setup.py
+RDEPEND="
+	dev-python/twisted-core[${PYTHON_USEDEP}]
+	dev-python/whisper[${PYTHON_USEDEP}]
+	dev-python/txAMQP[${PYTHON_USEDEP}]"
+
+PATCHES=(
+	# Do not install the configuration and data files. We install them
+	# somewhere sensible by hand. Patch for this vn. 0.9.14 has been extended
+	# due to redhat's init scripts set to install unconditionally in setup.py
+	"${FILESDIR}"/${P}-no-data-files.patch
+	)
+
+python_prepare_all() {
+	# This sets prefix to /opt/graphite. We want FHS-style paths instead.
+	rm setup.cfg || die
+	distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	insinto /etc/carbon
+	doins conf/*
+
+	dodir /var/log/carbon /var/lib/carbon/{whisper,lists,rrd}
+
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-cache
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-relay
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-aggregator
+
+	newconfd "${FILESDIR}"/carbon.confd carbon-cache
+	newconfd "${FILESDIR}"/carbon.confd carbon-relay
+	newconfd "${FILESDIR}"/carbon.confd carbon-aggregator
+}
+
+pkg_postinst() {
+	einfo 'This ebuild installs carbon into FHS-style paths.'
+	einfo 'You will probably have to set GRAPHITE_CONF_DIR to /etc/carbon'
+	einfo 'and GRAPHITE_STORAGE_DIR to /var/lib/carbon to make use of this'
+	einfo '(see /etc/carbon/carbon.conf.example).'
+	einfo ' '
+	einfo 'OpenRC init script supports multiple instances !'
+	einfo 'Example to run an instance b of carbon-cache :'
+	einfo '    ln -s /etc/init.d/carbon-cache /etc/init.d/carbon-cache.b'
+	einfo '    cp /etc/conf.d/carbon-cache /etc/conf.d/carbon-cache.b'
+}

diff --git a/dev-python/carbon/carbon-0.9.15-r1.ebuild b/dev-python/carbon/carbon-0.9.15-r1.ebuild
new file mode 100644
index 0000000..37560df
--- /dev/null
+++ b/dev-python/carbon/carbon-0.9.15-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Backend data caching and persistence daemon for Graphite"
+HOMEPAGE="http://graphite.wikidot.com/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86 ~x64-solaris"
+
+# whisper appears to have been missed from listing in install_requires in setup.py
+RDEPEND="
+	dev-python/twisted-core[${PYTHON_USEDEP}]
+	dev-python/whisper[${PYTHON_USEDEP}]
+	dev-python/txAMQP[${PYTHON_USEDEP}]"
+
+PATCHES=(
+	# Do not install the configuration and data files. We install them
+	# somewhere sensible by hand. Patch for this vn. 0.9.14 has been extended
+	# due to redhat's init scripts set to install unconditionally in setup.py
+	"${FILESDIR}"/${PN}-0.9.14-no-data-files.patch
+	)
+
+python_prepare_all() {
+	# This sets prefix to /opt/graphite. We want FHS-style paths instead.
+	rm setup.cfg || die
+	distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	insinto /etc/carbon
+	doins conf/*
+
+	dodir /var/log/carbon /var/lib/carbon/{whisper,lists,rrd}
+
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-cache
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-relay
+	newinitd "${FILESDIR}"/carbon.initd2 carbon-aggregator
+
+	newconfd "${FILESDIR}"/carbon.confd carbon-cache
+	newconfd "${FILESDIR}"/carbon.confd carbon-relay
+	newconfd "${FILESDIR}"/carbon.confd carbon-aggregator
+}
+
+pkg_postinst() {
+	einfo 'This ebuild installs carbon into FHS-style paths.'
+	einfo 'You will probably have to set GRAPHITE_CONF_DIR to /etc/carbon'
+	einfo 'and GRAPHITE_STORAGE_DIR to /var/lib/carbon to make use of this'
+	einfo '(see /etc/carbon/carbon.conf.example).'
+	einfo ' '
+	einfo 'OpenRC init script supports multiple instances !'
+	einfo 'Example to run an instance b of carbon-cache :'
+	einfo '    ln -s /etc/init.d/carbon-cache /etc/init.d/carbon-cache.b'
+	einfo '    cp /etc/conf.d/carbon-cache /etc/conf.d/carbon-cache.b'
+}

diff --git a/dev-python/carbon/files/carbon.initd2 b/dev-python/carbon/files/carbon.initd2
new file mode 100644
index 0000000..1dea421
--- /dev/null
+++ b/dev-python/carbon/files/carbon.initd2
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+export GRAPHITE_CONF_DIR=/etc/carbon
+export GRAPHITE_STORAGE_DIR=/var/lib/carbon
+
+INSTANCE=${SVCNAME/#*.}
+if [ "${INSTANCE}" == "${SVCNAME}" ]; then
+	INSTANCE="a"
+fi
+
+PIDFILE="/var/run/${SVCNAME}.pid"
+PROGRAMNAME=${SVCNAME/.*}
+
+CARBON_CONFIG=${CARBON_CONFIG:-/etc/carbon/carbon.conf}
+
+depend() {
+	use net
+}
+
+
+start_pre() {
+	if [ ! -f ${CARBON_CONFIG} ] ; then
+		eend "Missing ${CARBON_CONFIG}"
+	fi
+	case "${PROGRAMNAME}" in
+		"carbon-relay" )
+			if `grep -q "^RELAY_METHOD = rules$" ${CARBON_CONFIG}`; then
+				[ -f /etc/carbon/relay-rules.conf ] || eend "Missing relay-rules.conf"
+			fi
+			;;
+		"carbon-aggregator" )
+			[ -f /etc/carbon/aggregation-rules.conf ] || eend "Missing missing aggregation-rules.conf"
+			;;
+	esac
+}
+
+start() {
+	ebegin "Starting ${PROGRAMNAME} instance ${INSTANCE}"
+	start-stop-daemon --start --exec /usr/bin/${PROGRAMNAME}.py \
+	    --pidfile ${PIDFILE} \
+	    -- --pidfile ${PIDFILE} --instance ${INSTANCE} \
+		--logdir /var/log/carbon/ --config ${CARBON_CONFIG} start >/dev/null
+	eend $? "Failed to start ${SVCNAME}"
+}
+
+stop() {
+	ebegin "Stopping ${PROGRAMNAME} instance ${INSTANCE}"
+	start-stop-daemon --stop \
+		--pidfile ${PIDFILE}
+	eend $? "Failed to stop ${SVCNAME}"
+}


             reply	other threads:[~2016-05-03 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03 13:21 Patrick Lauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-14  8:46 [gentoo-commits] repo/gentoo:master commit in: dev-python/carbon/files/, dev-python/carbon/ Michał Górny
2020-01-27 10:13 Michał Górny
2015-12-27  1:23 Ian Delaney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462281646.3a4d27ad1fe202a62851a317af7f1784c685939d.patrick@gentoo \
    --to=patrick@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox