jtc-overlay/dev-db/pgmon/pgmon-1.0.1.ebuild

67 lines
1.3 KiB
Bash
Raw Normal View History

2025-05-14 04:20:19 +00:00
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{6..13} )
2025-05-14 05:07:00 +00:00
inherit python-r1
2025-05-14 04:20:19 +00:00
DESCRIPTION="PostgreSQL monitoring bridge"
2025-05-14 05:07:00 +00:00
HOMEPAGE="None"
2025-05-14 04:20:19 +00:00
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"
2025-05-14 05:07:00 +00:00
SRC_URI="https://code2.shh-dot-com.org/james/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
2025-05-14 04:20:19 +00:00
DEPEND="
${PYTHON_DEPS}
dev-python/psycopg:2
dev-python/pyyaml
app-admin/logrotate
"
RDEPEND="${DEPEND}"
BDEPEND=""
2025-05-14 05:07:00 +00:00
RESTRICT="fetch"
2025-05-14 04:20:19 +00:00
S="${WORKDIR}/${PN}"
pkg_nofetch() {
einfo "Please download"
2025-05-14 05:07:00 +00:00
einfo " - ${P}.tgz"
2025-05-14 04:20:19 +00:00
einfo "from ${HOMEPAGE} and place it in your DISTDIR directory."
2025-05-14 05:07:00 +00:00
einfo "The file needs to be renamed to ${P}.tar.gz."
einfo "The file should be owned by portage:portage."
2025-05-14 04:20:19 +00:00
}
src_install() {
2025-05-14 05:07:00 +00:00
default
2025-05-14 04:20:19 +00:00
# Install init script
newinitd "openrc/pgmon.initd" pgmon
newconfd "openrc/pgmon.confd" pgmon
# Install systemd unit
2025-05-14 05:07:00 +00:00
systemd_dounit "systemd/pgmon.service"
2025-05-14 04:20:19 +00:00
# Install script
2025-05-14 05:07:00 +00:00
exeinto /usr/bin
newexe "pgmon.py" pgmon
2025-05-14 04:20:19 +00:00
# Install default config
diropts -o root -g root -m 0755
insinto /etc/pgmon
doins "sample-config/pgmon.yml"
doins "sample-config/pgmon-metrics.yml"
# Install logrotate config
insinto /etc/logrotate.d
newins "logrotate/pgmon.logrotate" pgmon
# Install man page
doman manpages/pgmon.1
}