summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-06-20 12:18:38 +0200
committerFabian Groffen <grobian@gentoo.org>2020-06-20 12:18:50 +0200
commitc23bbb8110ac12e0ba8427a16b548894d33f20ae (patch)
tree3497723a6f8e002a3927de8e392eb00a95ad04aa /app-admin
parentnet-libs/czmq: x86 stable (bug #728692) (diff)
downloadgentoo-c23bbb8110ac12e0ba8427a16b548894d33f20ae.tar.gz
gentoo-c23bbb8110ac12e0ba8427a16b548894d33f20ae.tar.bz2
gentoo-c23bbb8110ac12e0ba8427a16b548894d33f20ae.zip
app-admin/diamond-4.0.515.20200620: version bump
Closes: https://bugs.gentoo.org/710192 Closes: https://bugs.gentoo.org/727336 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/diamond/Manifest1
-rw-r--r--app-admin/diamond/diamond-4.0.515.20200620.ebuild80
-rw-r--r--app-admin/diamond/files/diamond.initd6
3 files changed, 85 insertions, 2 deletions
diff --git a/app-admin/diamond/Manifest b/app-admin/diamond/Manifest
index a9335d45de4..1a7c1f5d2b7 100644
--- a/app-admin/diamond/Manifest
+++ b/app-admin/diamond/Manifest
@@ -1 +1,2 @@
DIST python-diamond-4.0.515.20170311.tar.gz 671963 BLAKE2B 9449f2d27b48c0e24727eb2c415a5095b20199d9315ef69df92a4aa6f8f3397743f3dc6cf2d8d91f79eca309926731b6b42da170a02987a20aeccd1e0980f4ac SHA512 d18a80540018975455b839a78fd55d13d167726b92914e3dc2de1c6f27f47319962361e05961c55047ba185e11ebf57831f3ab5cff9158a50d30a2ca635d53bd
+DIST python-diamond-4.0.515.20200620.tar.gz 674623 BLAKE2B eaf290a18a79115fdc013addff5b9d5a5c5b5ce06989c7e3cb8ac5dd988f47878a893ae37a96d1f020dac1aff00ebe191bf27c3d19ac5625afd56cf79451a141 SHA512 5e43aa1bb7acbeaa80db2bbc8e956042104fa9364893b5149bcfa7bff3e00b3667a112243e7a1fad85c1fb1b0c2e2727d0f73fb6851c1959ac95c1854b0c0f76
diff --git a/app-admin/diamond/diamond-4.0.515.20200620.ebuild b/app-admin/diamond/diamond-4.0.515.20200620.ebuild
new file mode 100644
index 00000000000..919e6495593
--- /dev/null
+++ b/app-admin/diamond/diamond-4.0.515.20200620.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/grobian/Diamond.git"
+ EGIT_BRANCH="python3"
+ S=${WORKDIR}/diamond-${PV}
+else
+ GHASH=8d8a2e49d80d44968a34d43e36c1d864695a29c1 # from python3 branch
+ SRC_URI="https://github.com/grobian/Diamond/archive/${GHASH}.tar.gz -> python-diamond-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ S=${WORKDIR}/Diamond-${GHASH}
+fi
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1 prefix
+
+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"
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-python/configobj
+ dev-python/setproctitle
+ mongo? ( dev-python/pymongo )
+ mysql? ( dev-python/mysqlclient )
+ snmp? ( dev-python/pysnmp )
+ redis? ( dev-python/redis-py )
+ !kernel_linux? ( >=dev-python/psutil-3 )
+ kernel_linux? ( sys-process/psmisc )"
+DEPEND="${RDEPEND}
+ test? ( dev-python/mock )"
+
+src_prepare() {
+ # adjust for Prefix
+ hprefixify bin/diamond*
+
+ # fix the version (not set in GitHub archive)
+ sed -i -e "s/__VERSIONTOKENHERE__/${PV}/" src/diamond/version.py.tmpl || die
+ echo "${PV}" > version.txt || die
+ # fix symlink out of place
+ rm README.md || die
+ cp docs/index.md README.md || die
+
+ # this module isn't Python3 yet (lambda), if you use this and have a
+ # fix, let me know
+ rm src/diamond/handler/rrdtool.py || 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
+ python_optimize
+ 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
+ hprefixify "${ED}"/etc/diamond/diamond.conf.example
+}
+
+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.initd b/app-admin/diamond/files/diamond.initd
index 168b175a788..a2383fd3187 100644
--- a/app-admin/diamond/files/diamond.initd
+++ b/app-admin/diamond/files/diamond.initd
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
depend() {
@@ -14,6 +14,8 @@ start() {
stop() {
ebegin "Stopping ${SVCNAME}"
- start-stop-daemon --stop -R 80 --pidfile /run/${SVCNAME}.pid
+ #start-stop-daemon --stop -R 80 --pidfile /run/${SVCNAME}.pid
+ # diamond doesn't kill its children, so work around that for now
+ pstree -Tp `cat /run/${SVCNAME}.pid` | grep -o '([0-9]\+)' | tr '()' ' ' | xargs kill
eend $?
}