From 9b382bedaa395e91720899cca77873d4975abad4 Mon Sep 17 00:00:00 2001 From: James Campbell Date: Fri, 31 Jan 2025 00:18:17 -0500 Subject: [PATCH] Improve Gentoo ebuild --- GENTOO/pgmon-1.0.0.ebuild | 22 +++++++++++++++------- openrc/pgmon.confd | 3 +++ openrc/{pgmon.openrc => pgmon.initd} | 0 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 openrc/pgmon.confd rename openrc/{pgmon.openrc => pgmon.initd} (100%) diff --git a/GENTOO/pgmon-1.0.0.ebuild b/GENTOO/pgmon-1.0.0.ebuild index 0f502d7..860e65f 100644 --- a/GENTOO/pgmon-1.0.0.ebuild +++ b/GENTOO/pgmon-1.0.0.ebuild @@ -14,8 +14,7 @@ LICENSE="BSD" SLOT="0" KEYWORDS="amd64" -EGIT_REPO_URI="git@code2.shh-dot-com.org:james/pgmon.git" -EGIT_COMMIT="v1.0.0" +SRC_URI="https://code2.shh-dot-com.org/james/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" DEPEND=" ${PYTHON_DEPS} @@ -26,23 +25,32 @@ DEPEND=" RDEPEND="${DEPEND}" BDEPEND="" +S="${WORKDIR}/${PN}" + src_install() { default # Install init script - newinitd "${FILESDIR}/pgmon.openrc" pgmon + newinitd "openrc/pgmon.initd" pgmon + newconfd "openrc/pgmon.confd" pgmon + + # Install systemd unit + systemd_dounit "systemd/pgmon.service" # Install script exeinto /usr/bin - newexe "${S}/pgmon.py" pgmon + newexe "pgmon.py" pgmon # Install default config diropts -o root -g root -m 0755 insinto /etc/pgmon - doins "${FILESDIR}/pgmon.yml" - doins "${S}/pgmon-metrics.yml" + doins "sample-config/pgmon.yml" + doins "sample-config/pgmon-metrics.yml" # Install logrotate config insinto /etc/logrotate.d - newins "${FILESDIR}/pgmon.logrotate" pgmon + newins "logrotate/pgmon.logrotate" pgmon + + # Install man page + doman manpages/pgmon.1 } diff --git a/openrc/pgmon.confd b/openrc/pgmon.confd new file mode 100644 index 0000000..4bed9e4 --- /dev/null +++ b/openrc/pgmon.confd @@ -0,0 +1,3 @@ +## Specify a different user to run the daemon +#PGMON_USER=postgres +#PGMON_GROUP=postgres diff --git a/openrc/pgmon.openrc b/openrc/pgmon.initd similarity index 100% rename from openrc/pgmon.openrc rename to openrc/pgmon.initd