From feb0daf81d888e9160f9f94502de09b66f2a63fd Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 21 Jun 2020 17:50:24 +0100 Subject: gentoo resync : 21.06.2020 --- app-admin/diamond/Manifest | 4 +- app-admin/diamond/diamond-4.0.515.20200620.ebuild | 84 +++++++++++++++++++++++ app-admin/diamond/files/diamond.initd | 6 +- 3 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 app-admin/diamond/diamond-4.0.515.20200620.ebuild (limited to 'app-admin/diamond') diff --git a/app-admin/diamond/Manifest b/app-admin/diamond/Manifest index e94558518836..1461074ab927 100644 --- a/app-admin/diamond/Manifest +++ b/app-admin/diamond/Manifest @@ -1,5 +1,7 @@ AUX diamond.confd 57 BLAKE2B 8a5e3f478d3eb948e262239a9a83026e067ed67f2a4878075c8ddb7d8d356a2482da0642e673b8b3f658de6c6f30a30c830bc68af3fe2d750b998dc896525942 SHA512 51b037902394b22f957a15ad1479ebdae5ac29384f2b7a5053ea8200bad05dc9c9060cc5c6c1a931e341e99b95327e55b06aaa9a828950533265f9c96a8dff55 -AUX diamond.initd 447 BLAKE2B 76354f66282325005f193d4ad51f3deb0358604a681cfe54a596037608bd794c3fd68a78a03659295ce2021b70809edc01340f5ee39348e35275cae0b00a5042 SHA512 004b305ba945fa313da4cd51226050cec955886405026baacb15f7ab586b7ba650492b0e2cd9621b3854ec83ee6192a7b86ad4fd8239008df3c6c8bb5c8c84f3 +AUX diamond.initd 598 BLAKE2B fc754ce2a756dfe65222f4484e8c1e49c5c8392590809e3bd3384522dc83715a95b8d76d8ec28738cae050553af636f49cf54acb180485e4fad1a7484a5da000 SHA512 cb06aeb1bf0374e9e79b46b4ace6213978c8e49939aa989dbaa50069bab7c5069eb5c1d2f663515b9904f9465ad4ddbca43d3f29e762691d666c6cca70161e50 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 EBUILD diamond-4.0.515.20170311.ebuild 2930 BLAKE2B 367260bba34e5ce64c5b1070ad2daa3c9a21fa76286a4d62b7452475f7f899f3b41efd101187439767ee9782c9b679a3263141a07681ed4c857b589204623a8e SHA512 07e79c270f6c987dda3d2bb4e98ad848b46b43964118fdb6878a278f0ca6bf43a21b965ad59f2032004a16bfcca1da7f23ebf91354f552915d4565e6f4989e3b +EBUILD diamond-4.0.515.20200620.ebuild 2395 BLAKE2B a6424ab9ac1ff2f1cd8a4c69beabbb8534d0a3ccdbc44fb9f822cb36b7af12bb6406af382d7e4eea6fae794785674dc39cfe6a12e8578f1562b7c035b5e0c20c SHA512 576d410ed4475bda3ae2dbeaa529283e08780124d5e040856418bbba8d202f23d38a1691bb22a0c5b208720e30d1736dc669459a58eb483f926b19182889232e MISC metadata.xml 802 BLAKE2B d013e1b87c2f1d5f0f628766ed754a4ac50e9c9e710b7b2542081cd06988f7f577513a53165c54ff4d1d1de3bba92ec2089eaa15d16cbe946f7489d0345aeaaa SHA512 c455baa068661000d395e15f6952b3106cb3633f1a95395745c6a0d7cc5dbfb193d018af1341f27b250226bdc109e961bda4a612115d5805958f8e500108239a 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 000000000000..938b0d14ce90 --- /dev/null +++ b/app-admin/diamond/diamond-4.0.515.20200620.ebuild @@ -0,0 +1,84 @@ +# 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 ~arm ~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 + # since python3.8 installation goes straight into /etc + [[ -d ${ED}/etc ]] && [[ -d ${ED}/usr/etc ]] && rm -Rf "${ED}"/usr/etc + if [[ -d ${ED}/usr/etc ]] ; then + mv "${ED}"/usr/etc "${ED}"/ || die + fi + 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 168b175a788c..a2383fd31875 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 $? } -- cgit v1.2.3