From 5e99489ea3531c0f9bdce5ccc4cb4eb70ff6509e Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 28 Jan 2026 14:27:49 +0100 Subject: [PATCH] testing/pgqd: new aport --- testing/pgqd/APKBUILD | 73 ++++++++++++++++++++++++++++++++ testing/pgqd/pgqd.confd | 13 ++++++ testing/pgqd/pgqd.ini.dist.patch | 18 ++++++++ testing/pgqd/pgqd.initd | 31 ++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 testing/pgqd/APKBUILD create mode 100644 testing/pgqd/pgqd.confd create mode 100644 testing/pgqd/pgqd.ini.dist.patch create mode 100644 testing/pgqd/pgqd.initd diff --git a/testing/pgqd/APKBUILD b/testing/pgqd/APKBUILD new file mode 100644 index 00000000000..02004471297 --- /dev/null +++ b/testing/pgqd/APKBUILD @@ -0,0 +1,73 @@ +# Contributor: Jakub Jirutka +# Maintainer: Jakub Jirutka +pkgname=pgqd +pkgver=3.5 +pkgrel=0 +pkgdesc="PgQ maintenance daemon" +url="https://github.com/pgq/pgqd" +arch="all" +license="ISC" +makedepends=" + autoconf + automake + cmd:rst2man + libevent-dev + libpq-dev + libtool + " +subpackages=" + $pkgname-doc + $pkgname-openrc + " +_libusual_gitrev=46a78d2616ba2e8b5855a3914d5e9375935cf61b +source="https://github.com/pgq/pgqd/archive/v$pkgver/pgqd-$pkgver.tar.gz + https://github.com/libusual/libusual/archive/$_libusual_gitrev/pgqd-$_libusual_gitrev.tar.gz + pgqd.ini.dist.patch + $pkgname.initd + $pkgname.confd + " +options="!check" # requires running postgresql + +prepare() { + rm -r lib + ln -s ../libusual-$_libusual_gitrev lib + + # pgqd.ini is embedded into the binary, so we copy it and customize + # the copy which we install to /etc. + cp pgqd.ini pgqd.ini.dist + + default_prepare + + ./autogen.sh +} + +build() { + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var + make +} + +check() { + make check +} + +package() { + make DESTDIR="$pkgdir" install + + install -D -m644 pgqd.ini.dist "$pkgdir"/etc/pgqd.ini + install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -D -m644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums=" +7620f2f5ee698e48e935ff1bca7dc46bc73dc6a0dba8c1dc6990d43ff5ead9abd84de547dd3eb452c529c4b909ad7e575ae9d2734fffe6c051e7e76d477e7866 pgqd-3.5.tar.gz +09ecefd3bf51b2cd435d69b2ba194b86bdce7c755bb44cef4e53f6c8ac47fea355a40955c6668fc01f762bc03fdf9f92ed74d683b1b922c9aa3cda36a258c097 pgqd-46a78d2616ba2e8b5855a3914d5e9375935cf61b.tar.gz +54cab746edf28114afedc48f85c728cc8d0c1231effc1af77c50c771a011fe9e6fdd9d648131175d0549b1ad072a88501d2664e21cfb5e5258fd1c7744c5e772 pgqd.ini.dist.patch +5a60f5742659dda2edf993b25f07981277198d173ad8988674346ee34ea6acc805f9b299f6ccba34f11f179dc41301a2147f06d4212b173066b4a7e5bea5dc3c pgqd.initd +57ea6868e589a84a675cdcc38cb639862205d819cfe2900b1c1bfd77b3a0143673bdf53878d13c35ebdfce55c30291adb6384c859fe84dab5ff7a9b4f46764c1 pgqd.confd +" diff --git a/testing/pgqd/pgqd.confd b/testing/pgqd/pgqd.confd new file mode 100644 index 00000000000..6b790dfb2e3 --- /dev/null +++ b/testing/pgqd/pgqd.confd @@ -0,0 +1,13 @@ +# Configuration for /etc/init.d/pgqd + +# Path to the configuration file. +#cfgfile="/etc/pgqd.ini" + +# The user (and group) to run pgqd as. +#command_user="postgres" + +# Additional options to pass to pgqd. +#command_args= + +# Comment out if you want to run pgqd without process supervisor. +supervisor="supervise-daemon" diff --git a/testing/pgqd/pgqd.ini.dist.patch b/testing/pgqd/pgqd.ini.dist.patch new file mode 100644 index 00000000000..8963830e9a3 --- /dev/null +++ b/testing/pgqd/pgqd.ini.dist.patch @@ -0,0 +1,18 @@ +pgqd logs to syslog by default, so logfile is unnecessary. +We don't want pgqd daemonize itself, so pidfile is unnecessary. + +--- a/pgqd.ini.dist ++++ b/pgqd.ini.dist +@@ -1,10 +1,7 @@ + [pgqd] + +-# where to log +-logfile = ~/log/pgqd.log +- +-# pidfile +-pidfile = ~/pid/pgqd.pid ++# file path where to write logs ++#logfile = + + ## optional parameters ## + diff --git a/testing/pgqd/pgqd.initd b/testing/pgqd/pgqd.initd new file mode 100644 index 00000000000..47d16ddbcaf --- /dev/null +++ b/testing/pgqd/pgqd.initd @@ -0,0 +1,31 @@ +#!/sbin/openrc-run + +extra_started_commands="reload" + +description="PgQ maintenance daemon" +description_reload="Reload the configuration" + +: ${command_user:="postgres"} +: ${cfgfile:="/etc/pgqd.ini"} + +command="/usr/bin/pgqd" +command_args="$command_args $cfgfile" +command_background="yes" +pidfile="/run/$RC_SVCNAME.pid" + +depend() { + use logger + after postgresql +} + +reload() { + ebegin "Reloading $RC_SVCNAME configuration" + + if [ "$supervisor" ]; then + $supervisor "$RC_SVCNAME" --signal HUP + else + start-stop-daemon --pidfile "$pidfile" --signal HUP + fi + + eend $? +}