From 1d642d41b2aebd1ce99386bde2f62e6725112b64 Mon Sep 17 00:00:00 2001 From: James Campbell Date: Sun, 1 Jun 2025 00:23:26 -0400 Subject: [PATCH] Bump version to 1.0.2 * Modify Makefile to extract the version from the mainscript * Bump version to 1.0.2 --- GENTOO/pgmon-1.0.2.ebuild | 73 +++++++++++++++++++++++++++++++++++++++ Makefile | 3 +- src/pgmon.py | 2 +- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 GENTOO/pgmon-1.0.2.ebuild diff --git a/GENTOO/pgmon-1.0.2.ebuild b/GENTOO/pgmon-1.0.2.ebuild new file mode 100644 index 0000000..9c52b5a --- /dev/null +++ b/GENTOO/pgmon-1.0.2.ebuild @@ -0,0 +1,73 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{6..13} ) + +inherit python-r1 + +DESCRIPTION="PostgreSQL monitoring bridge" +HOMEPAGE="None" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64" + +SRC_URI="https://code2.shh-dot-com.org/james/${PN}/archive/v${PV}.tar.bz2 -> ${P}.tar.bz2" + +IUSE="-systemd" + +DEPEND=" + ${PYTHON_DEPS} + dev-python/psycopg:2 + dev-python/pyyaml + app-admin/logrotate + " +RDEPEND="${DEPEND}" +BDEPEND="" + +RESTRICT="fetch" + +#S="${WORKDIR}/${PN}" + +pkg_nofetch() { + einfo "Please download" + einfo " - ${P}.tar.bz2" + einfo "from ${HOMEPAGE} and place it in your DISTDIR directory." + einfo "The file should be owned by portage:portage." +} + +src_compile() { + true +} + +src_install() { + # Install init script + if ! use systemd ; then + newinitd "openrc/pgmon.initd" pgmon + newconfd "openrc/pgmon.confd" pgmon + fi + + # Install systemd unit + if use systemd ; then + systemd_dounit "systemd/pgmon.service" + fi + + # Install script + exeinto /usr/bin + newexe "src/pgmon.py" pgmon + + # 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 +} diff --git a/Makefile b/Makefile index 7606715..1c3de00 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ # Package details PACKAGE_NAME := pgmon -VERSION := 1.0.1 SCRIPT := src/$(PACKAGE_NAME).py +VERSION := $(shell grep -m 1 '^VERSION = ' "$(SCRIPT)" | sed -ne 's/.*"\(.*\)".*/\1/p') + # Where packages are built BUILD_DIR := build diff --git a/src/pgmon.py b/src/pgmon.py index f9c906c..6178827 100755 --- a/src/pgmon.py +++ b/src/pgmon.py @@ -24,7 +24,7 @@ from http.server import BaseHTTPRequestHandler, HTTPServer from http.server import ThreadingHTTPServer from urllib.parse import urlparse, parse_qs -VERSION = "1.0.1" +VERSION = "1.0.2" # Configuration config = {}