Compare commits
No commits in common. "107d5056d6553f12b82e31a2b4866ec90d336739" and "5ede7dea07688325a4927b63a8284050e79435df" have entirely different histories.
107d5056d6
...
5ede7dea07
@ -1,74 +0,0 @@
|
|||||||
# 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 systemd
|
|
||||||
|
|
||||||
DESCRIPTION="PostgreSQL monitoring bridge"
|
|
||||||
HOMEPAGE="None"
|
|
||||||
|
|
||||||
LICENSE="BSD"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="amd64"
|
|
||||||
|
|
||||||
SRC_URI="https://code2.shh-dot-com.org/james/${PN}/releases/download/v${PV}/${P}.tar.bz2"
|
|
||||||
|
|
||||||
IUSE="-systemd"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
${PYTHON_DEPS}
|
|
||||||
dev-python/psycopg:2
|
|
||||||
dev-python/pyyaml
|
|
||||||
dev-python/requests
|
|
||||||
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
|
|
||||||
}
|
|
||||||
51
Makefile
51
Makefile
@ -3,22 +3,7 @@ PACKAGE_NAME := pgmon
|
|||||||
|
|
||||||
SCRIPT := src/$(PACKAGE_NAME).py
|
SCRIPT := src/$(PACKAGE_NAME).py
|
||||||
|
|
||||||
# Figure out the version components
|
VERSION := $(shell grep -m 1 '^VERSION = ' "$(SCRIPT)" | sed -ne 's/.*"\(.*\)".*/\1/p')
|
||||||
# Note: The release is for RPM packages, where prerelease releases are written as 0.<release>
|
|
||||||
FULL_VERSION := $(shell grep -m 1 '^VERSION = ' "$(SCRIPT)" | sed -ne 's/.*"\(.*\)".*/\1/p')
|
|
||||||
VERSION := $(shell echo $(FULL_VERSION) | sed -n 's/\(.*\)\(-rc.*\|$$\)/\1/p')
|
|
||||||
RELEASE := $(shell echo $(FULL_VERSION) | sed -n 's/.*-rc\([0-9]\+\)$$/\1/p')
|
|
||||||
|
|
||||||
ifeq ($(RELEASE),)
|
|
||||||
RPM_RELEASE := 1
|
|
||||||
RPM_VERSION := $(VERSION)-$(RPM_RELEASE)
|
|
||||||
DEB_VERSION := $(VERSION)
|
|
||||||
else
|
|
||||||
RPM_RELEASE := 0.$(RELEASE)
|
|
||||||
RPM_VERSION := $(VERSION)-$(RPM_RELEASE)
|
|
||||||
DEB_VERSION := $(VERSION)~rc$(RELEASE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Where packages are built
|
# Where packages are built
|
||||||
BUILD_DIR := build
|
BUILD_DIR := build
|
||||||
@ -38,12 +23,8 @@ SUPPORTED := ubuntu-20.04 \
|
|||||||
# These targets are the main ones to use for most things.
|
# These targets are the main ones to use for most things.
|
||||||
##
|
##
|
||||||
|
|
||||||
.PHONY: all clean tgz test query-tests install-common install-openrc install-systemd
|
.PHONY: package-all clean tgz test query-tests install-common install-openrc install-systemd
|
||||||
|
|
||||||
all: package-all
|
|
||||||
|
|
||||||
version:
|
|
||||||
@echo "full version=$(FULL_VERSION) version=$(VERSION) rel=$(RELEASE) rpm=$(RPM_VERSION) deb=$(DEB_VERSION)"
|
|
||||||
|
|
||||||
# Build all packages
|
# Build all packages
|
||||||
.PHONY: package-all
|
.PHONY: package-all
|
||||||
@ -53,7 +34,7 @@ package-all: $(foreach distro_release, $(SUPPORTED), package-$(distro_release))
|
|||||||
.PHONY: package-gentoo
|
.PHONY: package-gentoo
|
||||||
package-gentoo:
|
package-gentoo:
|
||||||
mkdir -p $(BUILD_DIR)/gentoo
|
mkdir -p $(BUILD_DIR)/gentoo
|
||||||
tar --transform "s,^,$(PACKAGE_NAME)-$(FULL_VERSION)/," -acjf $(BUILD_DIR)/gentoo/$(PACKAGE_NAME)-$(FULL_VERSION).tar.bz2 --exclude .gitignore $(shell git ls-tree --full-tree --name-only -r HEAD)
|
tar --transform "s,^,$(PACKAGE_NAME)-$(VERSION)/," -acjf $(BUILD_DIR)/gentoo/$(PACKAGE_NAME)-$(VERSION).tar.bz2 --exclude .gitignore $(shell git ls-tree --full-tree --name-only -r HEAD)
|
||||||
|
|
||||||
|
|
||||||
# Create a deb package
|
# Create a deb package
|
||||||
@ -74,7 +55,7 @@ tgz:
|
|||||||
rm -rf $(BUILD_DIR)/tgz/root
|
rm -rf $(BUILD_DIR)/tgz/root
|
||||||
mkdir -p $(BUILD_DIR)/tgz/root
|
mkdir -p $(BUILD_DIR)/tgz/root
|
||||||
$(MAKE) install-openrc DESTDIR=$(BUILD_DIR)/tgz/root
|
$(MAKE) install-openrc DESTDIR=$(BUILD_DIR)/tgz/root
|
||||||
tar -cz -f $(BUILD_DIR)/tgz/$(PACKAGE_NAME)-$(FULL_VERSION).tgz -C $(BUILD_DIR)/tgz/root .
|
tar -cz -f $(BUILD_DIR)/tgz/$(PACKAGE_NAME)-$(VERSION).tgz -C $(BUILD_DIR)/tgz/root .
|
||||||
|
|
||||||
# Clean up the build directory
|
# Clean up the build directory
|
||||||
clean:
|
clean:
|
||||||
@ -148,28 +129,28 @@ debian-%-install-test:
|
|||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ./$(BUILD_DIR):/output \
|
-v ./$(BUILD_DIR):/output \
|
||||||
debian:$* \
|
debian:$* \
|
||||||
bash -c 'apt-get update && apt-get install -y /output/$(PACKAGE_NAME)-$(DEB_VERSION)-debian-$*.deb'
|
bash -c 'apt-get update && apt-get install -y /output/$(PACKAGE_NAME)-$(VERSION)-debian-$*.deb'
|
||||||
|
|
||||||
# Run a RedHat install test
|
# Run a RedHat install test
|
||||||
rockylinux-%-install-test:
|
rockylinux-%-install-test:
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ./$(BUILD_DIR):/output \
|
-v ./$(BUILD_DIR):/output \
|
||||||
rockylinux:$* \
|
rockylinux:$* \
|
||||||
bash -c 'dnf makecache && dnf install -y /output/$(PACKAGE_NAME)-$(RPM_VERSION).el$*.noarch.rpm'
|
bash -c 'dnf makecache && dnf install -y /output/$(PACKAGE_NAME)-$(VERSION)-1.el$*.noarch.rpm'
|
||||||
|
|
||||||
# Run an Ubuntu install test
|
# Run an Ubuntu install test
|
||||||
ubuntu-%-install-test:
|
ubuntu-%-install-test:
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ./$(BUILD_DIR):/output \
|
-v ./$(BUILD_DIR):/output \
|
||||||
ubuntu:$* \
|
ubuntu:$* \
|
||||||
bash -c 'apt-get update && apt-get install -y /output/$(PACKAGE_NAME)-$(DEB_VERSION)-ubuntu-$*.deb'
|
bash -c 'apt-get update && apt-get install -y /output/$(PACKAGE_NAME)-$(VERSION)-ubuntu-$*.deb'
|
||||||
|
|
||||||
# Run an OracleLinux install test (this is for EL7 since CentOS7 images no longer exist)
|
# Run an OracleLinux install test (this is for EL7 since CentOS7 images no longer exist)
|
||||||
oraclelinux-%-install-test:
|
oraclelinux-%-install-test:
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ./$(BUILD_DIR):/output \
|
-v ./$(BUILD_DIR):/output \
|
||||||
oraclelinux:7 \
|
oraclelinux:7 \
|
||||||
bash -c 'yum makecache && yum install -y /output/$(PACKAGE_NAME)-$(RPM_VERSION).el7.noarch.rpm'
|
bash -c 'yum makecache && yum install -y /output/$(PACKAGE_NAME)-$(VERSION)-1.el7.noarch.rpm'
|
||||||
|
|
||||||
# Run a Gentoo install test
|
# Run a Gentoo install test
|
||||||
gentoo-install-test:
|
gentoo-install-test:
|
||||||
@ -211,28 +192,28 @@ package-image-%:
|
|||||||
actually-package-debian-%:
|
actually-package-debian-%:
|
||||||
$(MAKE) install-systemd DESTDIR=/output/debian-$*
|
$(MAKE) install-systemd DESTDIR=/output/debian-$*
|
||||||
cp -r --preserve=mode DEBIAN /output/debian-$*/
|
cp -r --preserve=mode DEBIAN /output/debian-$*/
|
||||||
dpkg-deb -Zgzip --build /output/debian-$* "/output/$(PACKAGE_NAME)-$(DEB_VERSION)-debian-$*.deb"
|
dpkg-deb -Zgzip --build /output/debian-$* "/output/$(PACKAGE_NAME)-$(VERSION)-debian-$*.deb"
|
||||||
|
|
||||||
# RedHat package creation
|
# RedHat package creation
|
||||||
actually-package-rockylinux-%:
|
actually-package-rockylinux-%:
|
||||||
mkdir -p /output/rockylinux-$*/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
mkdir -p /output/rockylinux-$*/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
sed -e "s/@@VERSION@@/$(VERSION)/g" -e "s/@@RELEASE@@/$(RPM_RELEASE)/g" RPM/$(PACKAGE_NAME).spec > /output/rockylinux-$*/SPECS/$(PACKAGE_NAME).spec
|
sed -e "s/@@VERSION@@/$(VERSION)/g" RPM/$(PACKAGE_NAME).spec > /output/rockylinux-$*/SPECS/$(PACKAGE_NAME).spec
|
||||||
rpmbuild --define '_topdir /output/rockylinux-$*' \
|
rpmbuild --define '_topdir /output/rockylinux-$*' \
|
||||||
--define 'version $(RPM_VERSION)' \
|
--define 'version $(VERSION)' \
|
||||||
-bb /output/rockylinux-$*/SPECS/$(PACKAGE_NAME).spec
|
-bb /output/rockylinux-$*/SPECS/$(PACKAGE_NAME).spec
|
||||||
cp /output/rockylinux-$*/RPMS/noarch/$(PACKAGE_NAME)-$(RPM_VERSION).el$*.noarch.rpm /output/
|
cp /output/rockylinux-$*/RPMS/noarch/$(PACKAGE_NAME)-$(VERSION)-1.el$*.noarch.rpm /output/
|
||||||
|
|
||||||
# Ubuntu package creation
|
# Ubuntu package creation
|
||||||
actually-package-ubuntu-%:
|
actually-package-ubuntu-%:
|
||||||
$(MAKE) install-systemd DESTDIR=/output/ubuntu-$*
|
$(MAKE) install-systemd DESTDIR=/output/ubuntu-$*
|
||||||
cp -r --preserve=mode DEBIAN /output/ubuntu-$*/
|
cp -r --preserve=mode DEBIAN /output/ubuntu-$*/
|
||||||
dpkg-deb -Zgzip --build /output/ubuntu-$* "/output/$(PACKAGE_NAME)-$(DEB_VERSION)-ubuntu-$*.deb"
|
dpkg-deb -Zgzip --build /output/ubuntu-$* "/output/$(PACKAGE_NAME)-$(VERSION)-ubuntu-$*.deb"
|
||||||
|
|
||||||
# OracleLinux package creation
|
# OracleLinux package creation
|
||||||
actually-package-oraclelinux-%:
|
actually-package-oraclelinux-%:
|
||||||
mkdir -p /output/oraclelinux-$*/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
mkdir -p /output/oraclelinux-$*/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
sed -e "s/@@VERSION@@/$(VERSION)/g" -e "s/@@RELEASE@@/$(RPM_RELEASE)/g" RPM/$(PACKAGE_NAME)-el7.spec > /output/oraclelinux-$*/SPECS/$(PACKAGE_NAME).spec
|
sed -e "s/@@VERSION@@/$(VERSION)/g" RPM/$(PACKAGE_NAME)-el7.spec > /output/oraclelinux-$*/SPECS/$(PACKAGE_NAME).spec
|
||||||
rpmbuild --define '_topdir /output/oraclelinux-$*' \
|
rpmbuild --define '_topdir /output/oraclelinux-$*' \
|
||||||
--define 'version $(RPM_VERSION)' \
|
--define 'version $(VERSION)' \
|
||||||
-bb /output/oraclelinux-$*/SPECS/$(PACKAGE_NAME).spec
|
-bb /output/oraclelinux-$*/SPECS/$(PACKAGE_NAME).spec
|
||||||
cp /output/oraclelinux-$*/RPMS/noarch/$(PACKAGE_NAME)-$(RPM_VERSION).el$*.noarch.rpm /output/
|
cp /output/oraclelinux-$*/RPMS/noarch/$(PACKAGE_NAME)-$(VERSION)-1.el$*.noarch.rpm /output/
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Name: pgmon
|
Name: pgmon
|
||||||
Version: @@VERSION@@
|
Version: @@VERSION@@
|
||||||
Release: @@RELEASE@@%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: A bridge to sit between monitoring tools and PostgreSQL
|
Summary: A bridge to sit between monitoring tools and PostgreSQL
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Name: pgmon
|
Name: pgmon
|
||||||
Version: @@VERSION@@
|
Version: @@VERSION@@
|
||||||
Release: @@RELEASE@@%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: A bridge to sit between monitoring tools and PostgreSQL
|
Summary: A bridge to sit between monitoring tools and PostgreSQL
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
|
|||||||
@ -29,7 +29,7 @@ import re
|
|||||||
|
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
VERSION = "1.0.4"
|
VERSION = "1.0.3"
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
config = {}
|
config = {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user