diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/carbon/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/carbon/files')
-rw-r--r-- | dev-python/carbon/files/carbon-0.9.12-no-data-files.patch | 24 | ||||
-rw-r--r-- | dev-python/carbon/files/carbon-0.9.14-no-data-files.patch | 32 | ||||
-rw-r--r-- | dev-python/carbon/files/carbon.confd | 5 | ||||
-rw-r--r-- | dev-python/carbon/files/carbon.initd | 51 | ||||
-rw-r--r-- | dev-python/carbon/files/carbon.initd2 | 53 | ||||
-rw-r--r-- | dev-python/carbon/files/no-data-files.patch | 26 |
6 files changed, 191 insertions, 0 deletions
diff --git a/dev-python/carbon/files/carbon-0.9.12-no-data-files.patch b/dev-python/carbon/files/carbon-0.9.12-no-data-files.patch new file mode 100644 index 000000000000..129c7189f3b0 --- /dev/null +++ b/dev-python/carbon/files/carbon-0.9.12-no-data-files.patch @@ -0,0 +1,24 @@ +diff -ur carbon-0.9.12.orig/setup.py carbon-0.9.12/setup.py +--- /setup.py 2013-08-22 00:53:16.000000000 +0800 ++++ /setup.py 2014-01-26 11:20:59.705864697 +0800 +@@ -13,12 +13,6 @@ + setup_kwargs = dict() + + +-storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]), +- ('storage/log',[]), ('storage/rrd',[]) ] +-conf_files = [ ('conf', glob('conf/*.example')) ] +- +-install_files = storage_dirs + conf_files +- + # If we are building on RedHat, let's use the redhat init scripts. + if platform.dist()[0] == 'redhat': + init_scripts = [ ('/etc/init.d', ['distro/redhat/init.d/carbon-cache', +@@ -39,7 +33,6 @@ + package_dir={'' : 'lib'}, + scripts=glob('bin/*'), + package_data={ 'carbon' : ['*.xml'] }, +- data_files=install_files, + install_requires=['twisted', 'txamqp'], + **setup_kwargs + ) diff --git a/dev-python/carbon/files/carbon-0.9.14-no-data-files.patch b/dev-python/carbon/files/carbon-0.9.14-no-data-files.patch new file mode 100644 index 000000000000..858d362d296d --- /dev/null +++ b/dev-python/carbon/files/carbon-0.9.14-no-data-files.patch @@ -0,0 +1,32 @@ +diff -ur carbon-0.9.14.orig/setup.py carbon-0.9.14/setup.py +--- setup.py 2015-11-07 13:50:29.000000000 +0800 ++++ setup.py 2015-12-27 08:43:46.575905408 +0800 +@@ -13,20 +13,6 @@ + setup_kwargs = dict() + + +-storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]), +- ('storage/log',[]), ('storage/rrd',[]) ] +-conf_files = [ ('conf', glob('conf/*.example')) ] +- +-install_files = storage_dirs + conf_files +- +-# Let's include redhat init scripts, despite build platform +-# but won't put them in /etc/init.d/ automatically anymore +-init_scripts = [ ('examples/init.d', ['distro/redhat/init.d/carbon-cache', +- 'distro/redhat/init.d/carbon-relay', +- 'distro/redhat/init.d/carbon-aggregator']) ] +-install_files += init_scripts +- +- + setup( + name='carbon', + version='0.9.14', +@@ -39,7 +25,6 @@ + package_dir={'' : 'lib'}, + scripts=glob('bin/*'), + package_data={ 'carbon' : ['*.xml'] }, +- data_files=install_files, + install_requires=['twisted', 'txamqp'], + **setup_kwargs + ) diff --git a/dev-python/carbon/files/carbon.confd b/dev-python/carbon/files/carbon.confd new file mode 100644 index 000000000000..b1875e134678 --- /dev/null +++ b/dev-python/carbon/files/carbon.confd @@ -0,0 +1,5 @@ +# Use the given config file +CARBON_CONFIG="/etc/carbon/carbon.conf" + +# Add extra parameters +CARBON_EXTRA_PARAMETERS="" diff --git a/dev-python/carbon/files/carbon.initd b/dev-python/carbon/files/carbon.initd new file mode 100644 index 000000000000..a33a70c60f93 --- /dev/null +++ b/dev-python/carbon/files/carbon.initd @@ -0,0 +1,51 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 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" ) + [ -f /etc/carbon/relay-rules.conf ] || eend "Missing relay-rules.conf" + ;; + "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}" +} diff --git a/dev-python/carbon/files/carbon.initd2 b/dev-python/carbon/files/carbon.initd2 new file mode 100644 index 000000000000..ff1509747ef1 --- /dev/null +++ b/dev-python/carbon/files/carbon.initd2 @@ -0,0 +1,53 @@ +#!/sbin/openrc-run +# 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}" +} diff --git a/dev-python/carbon/files/no-data-files.patch b/dev-python/carbon/files/no-data-files.patch new file mode 100644 index 000000000000..7b0c52f3948b --- /dev/null +++ b/dev-python/carbon/files/no-data-files.patch @@ -0,0 +1,26 @@ +Do not install the empty storage dirs and config files to the wrong +location (the ebuild installs them to the right location by hand). + +See Gentoo bug #417221. + +--- setup.py ++++ setup.py +@@ -12,9 +12,6 @@ + setup_kwargs = dict() + + +-storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]), +- ('storage/log',[]), ('storage/rrd',[]) ] +-conf_files = [ ('conf', glob('conf/*.example')) ] + #XXX Need a way to have these work for bdist_rpm but be left alone for everything else + #init_scripts = [ ('/etc/init.d', ['distro/redhat/init.d/carbon-cache', + # 'distro/redhat/init.d/carbon-relay', +@@ -32,7 +29,6 @@ + package_dir={'' : 'lib'}, + scripts=glob('bin/*'), + package_data={ 'carbon' : ['*.xml'] }, +- data_files=storage_dirs + conf_files, # + init_scripts, + install_requires=['twisted', 'txamqp'], + **setup_kwargs + ) + |