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

68 lines
1.4 KiB
Bash
Raw Normal View History

2024-06-02 04:14:02 +00:00
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{6..11} )
inherit git-r3 python-r1
DESCRIPTION="PostgreSQL monitoring bridge"
HOMEPAGE="None"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"
2024-06-03 05:18:59 +00:00
EGIT_REPO_URI="https://code2.shh-dot-com.org/james/pgmon.git"
2024-06-02 04:14:02 +00:00
#EGIT_COMMIT=""
2024-06-03 05:13:17 +00:00
IUSE="+agent agent2"
2024-06-02 04:14:02 +00:00
DEPEND="
${PYTHON_DEPS}
dev-python/psycopg:2
2024-06-03 05:13:17 +00:00
acct-user/zabbix
acct-group/zabbix
agent? ( net-analyzer/zabbix[agent] )
agent2? ( net-analyzer/zabbix[agent2] )
app-admin/logrotate
2024-06-02 04:14:02 +00:00
"
RDEPEND="${DEPEND}"
BDEPEND=""
2024-06-03 05:13:17 +00:00
src_install() {
default
# Install init script
2024-06-03 05:23:16 +00:00
newinitd "${FILESDIR}/pgmon.openrc" pgmon
2024-06-03 05:13:17 +00:00
2024-06-06 03:23:34 +00:00
# Install script
newexe "${S}/pgmon.py" pgmon
2024-06-03 05:13:17 +00:00
# Install default config
diropts -o root -g zabbix -m 0755
insinto /etc/pgmon
doins "${FILESDIR}/pgmon.cfg"
doins "${S}/pgmon-metrics.cfg"
# Install Zabbix userparams file
if use agent; then
insinto /etc/zabbix/zabbix_agent.d
newins "${S}/pgmon_userparameter.conf" pgmon.conf
fperms 0644 /etc/zabbix/zabbix_agent.d/pgmon.conf
fowners root:zabbix /etc/zabbix/zabbix_agent.d/pgmon.conf
fi
if use agent2; then
insinto /etc/zabbix/zabbix_agent2.d
newins "${S}/pgmon_userparameter.conf" pgmon.conf
fperms 0644 /etc/zabbix/zabbix_agent2.d/pgmon.conf
fowners root:zabbix /etc/zabbix/zabbix_agent2.d/pgmon.conf
fi
# Install logrotate config
insinto /etc/logrotate.d
newins "${FILESDIR}/pgmon.logrotate" pgmon
}