diff --git a/DEBIAN/control b/DEBIAN/control index 43edb3a..74262f8 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -3,7 +3,7 @@ Version: 1.0 Section: utils Priority: optional Architecture: all -Depends: logrotate, python3 (>= 3.6), python3-psycopg2, python3-yaml, systemd +Depends: logrotate, python3 (>= 3.6), python3-psycopg2, python3-requests, python3-yaml, systemd Maintainer: James Campbell Homepage: https://www.commandprompt.com Description: A bridge to sit between monitoring tools and PostgreSQL diff --git a/GENTOO/pgmon-1.0.3.ebuild b/GENTOO/pgmon-1.0.3.ebuild index a2f29c2..9d0e6a9 100644 --- a/GENTOO/pgmon-1.0.3.ebuild +++ b/GENTOO/pgmon-1.0.3.ebuild @@ -22,6 +22,7 @@ DEPEND=" ${PYTHON_DEPS} dev-python/psycopg:2 dev-python/pyyaml + dev-python/requests app-admin/logrotate " RDEPEND="${DEPEND}" diff --git a/Makefile b/Makefile index f786444..64e11af 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ SUPPORTED := ubuntu-20.04 \ # These targets are the main ones to use for most things. ## -.PHONY: all clean tgz test query-tests install +.PHONY: all clean tgz test query-tests install-common install-openrc install-systemd # Build all packages @@ -69,12 +69,11 @@ test: query-tests: cd tests ; ./run-tests.sh -# Install the script at the specified base directory -install: +# Install the script at the specified base directory (common components) +install-common: # Set up directories mkdir -p $(DESTDIR)/etc/$(PACKAGE_NAME) mkdir -p ${DESTDIR}/etc/logrotate.d - mkdir -p $(DESTDIR)/lib/systemd/system mkdir -p $(DESTDIR)/usr/local/bin mkdir -p $(DESTDIR)/usr/share/man/man1 @@ -89,12 +88,35 @@ install: # Install sample config cp sample-config/* $(DESTDIR)/etc/$(PACKAGE_NAME)/ - # Install systemd unit files - cp systemd/* $(DESTDIR)/lib/systemd/system/ - # Install logrotate config cp logrotate/${PACKAGE_NAME}.logrotate ${DESTDIR}/etc/logrotate.d/${PACKAGE_NAME} +# Install for systemd +install-systemd: + # Install the common stuff + $(MAKE) install-common + + # Set up directories + mkdir -p $(DESTDIR)/lib/systemd/system + + # Install systemd unit files + cp systemd/* $(DESTDIR)/lib/systemd/system/ + +# Install for open-rc +install-openrc: + # Install the common stuff + $(MAKE) install-common + + # Set up directories + mkdir -p $(DESTDIR)/etc/init.d + mkdir -p $(DESTDIR)/etc/conf.d + + # Install init script + cp openrc/pgmon.initd $(DESTDIR)/init.d/pgmon + + # Install init script config file + cp openrc/pgmon.confd $(DESTDIR)/conf.d/pgmon + # Run all of the install tests .PHONY: install-tests debian-%-install-test rockylinux-%-install-test ubuntu-%-install-test gentoo-install-test @@ -167,7 +189,7 @@ package-image-%: # Debian package creation actually-package-debian-%: - $(MAKE) install DESTDIR=/output/debian-$* + $(MAKE) install-systemd DESTDIR=/output/debian-$* cp -r --preserve=mode DEBIAN /output/debian-$*/ dpkg-deb -Zgzip --build /output/debian-$* "/output/$(PACKAGE_NAME)-$(VERSION)-debian-$*.deb" @@ -182,7 +204,7 @@ actually-package-rockylinux-%: # Ubuntu package creation actually-package-ubuntu-%: - $(MAKE) install DESTDIR=/output/ubuntu-$* + $(MAKE) install-systemd DESTDIR=/output/ubuntu-$* cp -r --preserve=mode DEBIAN /output/ubuntu-$*/ dpkg-deb -Zgzip --build /output/ubuntu-$* "/output/$(PACKAGE_NAME)-$(VERSION)-ubuntu-$*.deb" diff --git a/RPM/pgmon-el7.spec b/RPM/pgmon-el7.spec index 199a57b..cf3b12d 100644 --- a/RPM/pgmon-el7.spec +++ b/RPM/pgmon-el7.spec @@ -7,7 +7,7 @@ License: MIT URL: https://www.commandprompt.com BuildArch: noarch -Requires: logrotate, python, python-psycopg2, PyYAML, systemd +Requires: logrotate, python, python-psycopg2, PyYAML, python-requests, systemd %description A bridge to sit between monitoring tools and PostgreSQL @@ -19,7 +19,7 @@ A bridge to sit between monitoring tools and PostgreSQL # Do nothing since we have nothing to build %install -make -C /src install DESTDIR=%{buildroot} +make -C /src install-systemd DESTDIR=%{buildroot} %files /etc/logrotate.d/pgmon diff --git a/RPM/pgmon.spec b/RPM/pgmon.spec index 6bf1c5f..8a7d5e7 100644 --- a/RPM/pgmon.spec +++ b/RPM/pgmon.spec @@ -7,7 +7,7 @@ License: MIT URL: https://www.commandprompt.com BuildArch: noarch -Requires: logrotate, python3, python3-psycopg2, python3-pyyaml, systemd +Requires: logrotate, python3, python3-psycopg2, python3-pyyaml, python3-requests, systemd %description A bridge to sit between monitoring tools and PostgreSQL @@ -19,7 +19,7 @@ A bridge to sit between monitoring tools and PostgreSQL # Do nothing since we have nothing to build %install -make -C /src install DESTDIR=%{buildroot} +make -C /src install-systemd DESTDIR=%{buildroot} %files /etc/logrotate.d/pgmon diff --git a/tests/Dockerfile b/tests/Dockerfile index 1913313..1c31878 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -2,6 +2,7 @@ FROM alpine:3.21 RUN apk update && \ apk add py3-psycopg2 \ + py3-requests \ py3-yaml \ tini