summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-admin/diamond
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-admin/diamond')
-rw-r--r--app-admin/diamond/Manifest1
-rw-r--r--app-admin/diamond/diamond-4.0-r1.ebuild77
-rw-r--r--app-admin/diamond/diamond-9999.ebuild67
-rw-r--r--app-admin/diamond/files/diamond-4.0-psutil.patch48
-rw-r--r--app-admin/diamond/files/diamond.confd2
-rwxr-xr-xapp-admin/diamond/files/diamond.initd20
-rw-r--r--app-admin/diamond/metadata.xml22
7 files changed, 237 insertions, 0 deletions
diff --git a/app-admin/diamond/Manifest b/app-admin/diamond/Manifest
new file mode 100644
index 000000000000..de109ba841b4
--- /dev/null
+++ b/app-admin/diamond/Manifest
@@ -0,0 +1 @@
+DIST python-diamond-4.0.tar.gz 491433 SHA256 e84dd3c87b230d524306a07c3fc7c1db1d9796e3748025e8345a4fa18b162256 SHA512 c4a6e63bdc55f9e0ac2fbf3b644be91662635c08ecc864dfaaebf2fe62fb45609c099da63efd93ed498d2dc9e95bbcb64be09f715e21d59b30bce958a96dc56b WHIRLPOOL 2b1f6124001183058cf282d6e9c51bba0878f26308731266f2c31c549bb42db945c579b49b5a34666e0c05ccbda0163135662a11e59a482f8ef031c49c6005ba
diff --git a/app-admin/diamond/diamond-4.0-r1.ebuild b/app-admin/diamond/diamond-4.0-r1.ebuild
new file mode 100644
index 000000000000..a9dbda4d2cff
--- /dev/null
+++ b/app-admin/diamond/diamond-4.0-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/python-diamond/Diamond.git"
+ S=${WORKDIR}/diamond-${PV}
+else
+ SRC_URI="https://github.com/python-diamond/Diamond/archive/v${PV}.tar.gz -> python-diamond-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ S=${WORKDIR}/Diamond-${PV}
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils
+
+DESCRIPTION="Python daemon that collects and publishes system metrics"
+HOMEPAGE="https://github.com/python-diamond/Diamond"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test mongo mysql snmp redis"
+
+RDEPEND="dev-python/configobj
+ dev-python/setproctitle
+ mongo? ( dev-python/pymongo )
+ mysql? ( dev-python/mysql-python )
+ snmp? ( dev-python/pysnmp )
+ redis? ( dev-python/redis-py )
+ !kernel_linux? ( >=dev-python/psutil-3 )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/mock )"
+
+src_prepare() {
+ # adjust for Prefix
+ sed -i \
+ -e '/default="\/etc\/diamond\/diamond.conf"/s:=":="'"${EPREFIX}"':' \
+ bin/diamond* \
+ || die
+
+ # fix necessary to make handlers honour their config, simple sed
+ # doing the same as upstream
+ # https://github.com/python-diamond/Diamond/commit/3cb29eedd117d2e4146823a5c5811d16cc77206a.patch
+ sed -i \
+ -e '/cls_name =/s/\.__class__//' \
+ src/diamond/utils/classes.py \
+ || die
+
+ epatch "${FILESDIR}"/${P}-psutil.patch
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ "${PYTHON}" ./test.py || die "Tests fail with ${PYTHON}"
+}
+
+python_install() {
+ export VIRTUAL_ENV=1
+ distutils-r1_python_install
+ mv "${ED}"/usr/etc "${ED}"/ || die
+ rm "${ED}"/etc/diamond/*.windows # won't need these
+ sed -i \
+ -e '/pid_file =/s:/var/run:/run:' \
+ "${ED}"/etc/diamond/diamond.conf.example || die
+}
+
+src_install() {
+ distutils-r1_src_install
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/log/diamond
+}
diff --git a/app-admin/diamond/diamond-9999.ebuild b/app-admin/diamond/diamond-9999.ebuild
new file mode 100644
index 000000000000..cb7f0784091c
--- /dev/null
+++ b/app-admin/diamond/diamond-9999.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/python-diamond/Diamond.git"
+ S=${WORKDIR}/diamond-${PV}
+else
+ SRC_URI="https://github.com/python-diamond/Diamond/archive/v${PV}.tar.gz -> python-diamond-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ S=${WORKDIR}/Diamond-${PV}
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Python daemon that collects and publishes system metrics"
+HOMEPAGE="https://github.com/python-diamond/Diamond"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="test mongo mysql snmp redis"
+
+RDEPEND="dev-python/configobj
+ dev-python/setproctitle
+ mongo? ( dev-python/pymongo )
+ mysql? ( dev-python/mysql-python )
+ snmp? ( dev-python/pysnmp )
+ redis? ( dev-python/redis-py )
+ !kernel_linux? ( >=dev-python/psutil-3 )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/mock )"
+
+src_prepare() {
+ # adjust for Prefix
+ sed -i \
+ -e '/default="\/etc\/diamond\/diamond.conf"/s:=":="'"${EPREFIX}"':' \
+ bin/diamond* \
+ || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ "${PYTHON}" ./test.py || die "Tests fail with ${PYTHON}"
+}
+
+python_install() {
+ export VIRTUAL_ENV=1
+ distutils-r1_python_install
+ mv "${ED}"/usr/etc "${ED}"/ || die
+ rm "${ED}"/etc/diamond/*.windows # won't need these
+ sed -i \
+ -e '/pid_file =/s:/var/run:/run:' \
+ "${ED}"/etc/diamond/diamond.conf.example || die
+}
+
+src_install() {
+ distutils-r1_src_install
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/log/diamond
+}
diff --git a/app-admin/diamond/files/diamond-4.0-psutil.patch b/app-admin/diamond/files/diamond-4.0-psutil.patch
new file mode 100644
index 000000000000..e5f5d3bfb392
--- /dev/null
+++ b/app-admin/diamond/files/diamond-4.0-psutil.patch
@@ -0,0 +1,48 @@
+From 21ca284ffe6901b06e1136ce57dc07e0effd2a3e Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Mon, 3 Aug 2015 19:40:59 +0200
+Subject: [PATCH 1/2] NetworkCollector: psutil.network_io_counters was renamed
+
+---
+ src/collectors/network/network.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/collectors/network/network.py b/src/collectors/network/network.py
+index d835162..90c2f59 100644
+--- a/src/collectors/network/network.py
++++ b/src/collectors/network/network.py
+@@ -96,7 +96,7 @@ def collect(self):
+ self.log.error('No network metrics retrieved')
+ return None
+
+- network_stats = psutil.network_io_counters(True)
++ network_stats = psutil.net_io_counters(True)
+ for device in network_stats.keys():
+ network_stat = network_stats[device]
+ results[device] = {}
+
+From 314d6057ca95bae6d3e6369556522574eb905c3f Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Mon, 3 Aug 2015 19:41:20 +0200
+Subject: [PATCH 2/2] MemoryCollector: psutil renamed phymem_usage and
+ virtmem_usage
+
+---
+ src/collectors/memory/memory.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/collectors/memory/memory.py b/src/collectors/memory/memory.py
+index 7c9b1fb..9057115 100644
+--- a/src/collectors/memory/memory.py
++++ b/src/collectors/memory/memory.py
+@@ -103,8 +103,8 @@ def collect(self):
+ self.log.error('No memory metrics retrieved')
+ return None
+
+- phymem_usage = psutil.phymem_usage()
+- virtmem_usage = psutil.virtmem_usage()
++ phymem_usage = psutil.virtual_memory()
++ virtmem_usage = psutil.swap_memory()
+ units = 'B'
+
+ for unit in self.config['byte_unit']:
diff --git a/app-admin/diamond/files/diamond.confd b/app-admin/diamond/files/diamond.confd
new file mode 100644
index 000000000000..ad9939223182
--- /dev/null
+++ b/app-admin/diamond/files/diamond.confd
@@ -0,0 +1,2 @@
+# command line options for running diamond
+DIAMOND_OPTS=
diff --git a/app-admin/diamond/files/diamond.initd b/app-admin/diamond/files/diamond.initd
new file mode 100755
index 000000000000..db5d443135b3
--- /dev/null
+++ b/app-admin/diamond/files/diamond.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/diamond --pidfile /run/${SVCNAME}.pid -- -c /etc/diamond/${SVCNAME}.conf ${DIAMOND_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid --name diamond
+ eend $?
+}
diff --git a/app-admin/diamond/metadata.xml b/app-admin/diamond/metadata.xml
new file mode 100644
index 000000000000..395cb3eb4234
--- /dev/null
+++ b/app-admin/diamond/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>grobian@gentoo.org</email>
+ <name>Fabian Groffen</name>
+ </maintainer>
+ <longdescription lang="en">
+ Diamond is a python daemon that collects system metrics and
+ publishes them to Graphite (and others). It is capable of
+ collecting cpu, memory, network, i/o, load and disk metrics.
+ Additionally, it features an API for implementing custom
+ collectors for gathering metrics from almost any source.
+ </longdescription>
+ <use>
+ <flag name="mongo">Enable MongoDB support</flag>
+ <flag name="redis">Enable Redis support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">python-diamond/Diamond</remote-id>
+ </upstream>
+</pkgmetadata>