diff options
Diffstat (limited to 'app-metrics')
-rw-r--r-- | app-metrics/Manifest.gz | bin | 5958 -> 6122 bytes | |||
-rw-r--r-- | app-metrics/portage-exporter/Manifest | 6 | ||||
-rw-r--r-- | app-metrics/portage-exporter/files/portage-exporter.confd | 26 | ||||
-rw-r--r-- | app-metrics/portage-exporter/files/portage-exporter.initd | 49 | ||||
-rw-r--r-- | app-metrics/portage-exporter/metadata.xml | 14 | ||||
-rw-r--r-- | app-metrics/portage-exporter/portage-exporter-0_p20230307.ebuild | 52 |
6 files changed, 147 insertions, 0 deletions
diff --git a/app-metrics/Manifest.gz b/app-metrics/Manifest.gz Binary files differindex 1b7f1a4e8ba1..777f781bbea7 100644 --- a/app-metrics/Manifest.gz +++ b/app-metrics/Manifest.gz diff --git a/app-metrics/portage-exporter/Manifest b/app-metrics/portage-exporter/Manifest new file mode 100644 index 000000000000..7c42b0a60fa6 --- /dev/null +++ b/app-metrics/portage-exporter/Manifest @@ -0,0 +1,6 @@ +AUX portage-exporter.confd 843 BLAKE2B 63c3364213a82c9f242516b6b59ad25bbde5646460385d0f922fc06321c9f4a9c411d92a97f4790625ea7de02c1bf43d4361b4b8941bb29282b9bebe75b47d93 SHA512 3f42f9487bf0467b9f901dcc61abb8402a953c94891dfd0c4f6852c3c8b758501ac395890037f5e1b0d01a61351bd6c3dd06bc31242a65948b6fcd50b3c36554 +AUX portage-exporter.initd 1310 BLAKE2B 75ce7fa197ba339707da9aca0b07ba2e9f5ca7ed9ecb6a1785ee6f6fa26c9e6131126867ff5969f53c151f261666f9979f7e5259b74651a3792a7405f58bc497 SHA512 dd80c23555457851b83489565b0ee7a988ca865a42fb81c8c9eb4a1afd45a4840999aa9a0700b958094371eaac939b0da7585b1e67c84dfb8826d00a282fe281 +DIST portage-exporter-0_p20230307.tar.gz 32044 BLAKE2B 23e590aba88bf071568e9643b22ec51d6fcaff11b5eb5ea1e66d39cf49468238cbb80a44a865ba7bbccb631540e33ab5a417201ec995227e84d122601c868fad SHA512 1e3bd18cf44ad849b0ee0a2dc737f6d334ce9dd29d03f53a05298df2013be8c77a7ed66c3171cc6c765ad21ab7705fd747856d95ef3259cc83fac85544e81781 +DIST portage-exporter-ae39c6be10364896683ab1af0512ee8453bc153e-vendor.tar.xz 784800 BLAKE2B 600f207b15e54ab0f4c27691ce41efcdd3706bfc82c9170da3ebf2eb6283b5595bca08d7eebd3c7b5a6b2c7bcef704e70946e3fab63a537cf03ffa7dbe4a57a0 SHA512 e6e91296e8220d9fb34e0837714108d8806801d6799e49dc27b7dcaf8ddf39a92bff232ec3d616019ef5ae5c437bc81eee719ca658c299a35e8f1b165e38d3eb +EBUILD portage-exporter-0_p20230307.ebuild 1309 BLAKE2B b3b9e880e2ac1552a689536afb3ce267f7de7c756e1ec1aef4ed9b9736345792b216a6b15ccbf48f01f0b70391ef2dada1616e8454e7044fc8a46142a51bfd58 SHA512 ce78218cb3361b5134cd764aac81a970f962ffc640f342664c0ac50f42f23b0dd53544823018a6733572a8a221f029510e601e2a2b84c817c714e44f95a45b78 +MISC metadata.xml 408 BLAKE2B 031b6dd255d44c5f9a9e8059fd83e72b2d8f6d9bc95a1bd09ca2dce89592210a80fe2b62acf480c9ab97496071f523efd4da83e0784a13e76bf673636dc4b9c5 SHA512 cc585397ecaae6fad17547531a01b8316d3501dbcbf25028750d328359a9ac405ca48c94d3187c3c5b4506870211027406c021210038078ea017395b8873d5f3 diff --git a/app-metrics/portage-exporter/files/portage-exporter.confd b/app-metrics/portage-exporter/files/portage-exporter.confd new file mode 100644 index 000000000000..3bd24a22a809 --- /dev/null +++ b/app-metrics/portage-exporter/files/portage-exporter.confd @@ -0,0 +1,26 @@ +# /etc/conf.d/portage-exporter + +# PID file +#EXPORTER_PIDFILE="/run/${RC_SVCNAME}.pid" + +# The termination timeout (start-stop-daemon parameter "retry") ensures +# that the service will be terminated within a given time (60 + 5 seconds +# per default) when you are stopping the service. +#EXPORTER_TERMTIMEOUT="TERM/60/KILL/5" + +# User to run exporter as +#EXPORTER_USER="portage-exporter" + +# User group to run exporter as +#EXPORTER_GROUP="portage-exporter" + +# You can use this configuration option to pass additional options to the +# start-stop-daemon, see start-stop-daemon(8) for more details. +# Per default we wait 1000ms after we have started the service to ensure +# that the daemon is really up and running. +#EXPORTER_SSDARGS="--wait 1000" + +# Exporter flags (passed via env) +#SERVE_ADDRESS=":2112" +#SERVE_PATH=/metrics +VDB_UPDATE_INTERVAL=1800 diff --git a/app-metrics/portage-exporter/files/portage-exporter.initd b/app-metrics/portage-exporter/files/portage-exporter.initd new file mode 100644 index 000000000000..9aa53f509a6e --- /dev/null +++ b/app-metrics/portage-exporter/files/portage-exporter.initd @@ -0,0 +1,49 @@ +#!/sbin/openrc-run +# Copyright 2016-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Prometheus exporter for Portage packages" + +EXPORTER_FLAGS=${EXPORTER_FLAGS:-""} +#EXPORTER_USER=${EXPORTER_USER:-"portage-exporter"} +#EXPORTER_GROUP=${EXPORTER_GROUP:-"portage-exporter"} +EXPORTER_PIDFILE=${EXPORTER_PIDFILE:-"/run/${RC_SVCNAME}.pid"} +EXPORTER_SSDARGS=${EXPORTER_SSDARGS:-"--wait 1000"} +EXPORTER_TERMTIMEOUT=${EXPORTER_TERMTIMEOUT:-"TERM/60/KILL/5"} + +command="/usr/bin/portage-exporter" +command_args="${EXPORTER_FLAGS}" +command_background="true" +start_stop_daemon_args="${EXPORTER_SSDARGS}" +start_stop_daemon_args="${start_stop_daemon_args} ${EXPORTER_USER:+--user }${EXPORTER_USER}" +start_stop_daemon_args="${start_stop_daemon_args} ${EXPORTER_GROUP:+--group }${EXPORTER_GROUP}" + +getconfig() { + local key="$1" + local value_default="$2" + local value= + + if service_started; then + value="$(service_get_value "${key}")" + fi + + if [ -z "${value}" ]; then + # Value not explicitly set + echo "${value_default}" + else + echo "${value}" + fi + + return 0 +} + +pidfile="$(getconfig pidfile ${EXPORTER_PIDFILE})" +retry="$(getconfig retry ${EXPORTER_TERMTIMEOUT})" + +depend() { + after net.lo loopback +} + +start_post() { + service_set_value retry "${EXPORTER_TERMTIMEOUT}" +} diff --git a/app-metrics/portage-exporter/metadata.xml b/app-metrics/portage-exporter/metadata.xml new file mode 100644 index 000000000000..7fe25777ee4c --- /dev/null +++ b/app-metrics/portage-exporter/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>robbat2@gentoo.org</email> + </maintainer> + <maintainer type="person"> + <!-- upstream --> + <email>arthurzam@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="github">projg2/portage-exporter</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-metrics/portage-exporter/portage-exporter-0_p20230307.ebuild b/app-metrics/portage-exporter/portage-exporter-0_p20230307.ebuild new file mode 100644 index 000000000000..539b7fd8c786 --- /dev/null +++ b/app-metrics/portage-exporter/portage-exporter-0_p20230307.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit go-module +# uncomment the first setting of MY_PV for a normal release +# MY_PV="v${PV/_rc/-rc.}" +# set MY_PV to the full commit hash for a snapshot release +MY_PV_HASH=ae39c6be10364896683ab1af0512ee8453bc153e +HOMEPAGE="https://github.com/projg2/portage-exporter" +if [[ -n "${MY_PV_HASH}" ]]; then + MY_PV=${MY_PV_HASH} + EXPORTER_COMMIT=${MY_PV_HASH:0:8} + SRC_URI_UPSTREAM="${HOMEPAGE}/archive/${MY_PV}.tar.gz" +else + MY_PV=${PV} + EXPORTER_COMMIT= + SRC_URI_UPSTREAM="${HOMEPAGE}/archive/refs/tags/v${PV}.tar.gz" +fi +MY_P=${PN}-${MY_PV} +SRC_URI_VENDOR="https://dev.gentoo.org/~robbat2/distfiles/${MY_P}-vendor.tar.xz" +#SRC_URI_VENDOR="https://dev.gentoo.org/~robbat2/distfiles/${MY_P}-go-mod.tar.xz" + +DESCRIPTION="Prometheus exporter for Gentoo Portage" +SRC_URI=" + ${SRC_URI_UPSTREAM} -> ${P}.tar.gz + ${SRC_URI_VENDOR} + " + +LICENSE="Apache-2.0 BSD MIT GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" +BDEPEND="" +DEPEND="" +RDEPEND="" +S="${WORKDIR}/${PN}-${MY_PV}" + +PATCHES=( ) + +src_compile() { + #cd ./cmd/portage-exporter/ + #ego build + ego build -o "${PN}" ./cmd/portage-exporter/ +} + +src_install() { + dobin ${PN} + + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} |