summaryrefslogtreecommitdiff
path: root/databases/pgagroal
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2022-06-26 22:10:28 -0500
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2022-06-26 22:11:32 -0500
commite81ba30a41e2c762617036c91a2da8adc718d811 (patch)
tree20e22dfb18de6f50fccb4349797a4c10bdcbce45 /databases/pgagroal
parentdatabases/postgresql-mysql_fdw: Update version 2.6.0=>2.8.0 (diff)
databases/pgagroal: New Port
pgagroal is a high-performance protocol-native connection pool for PostgreSQL. Which features High performance, Connection pool, Limit connections for users and databases, Prefill support, Remove idle connections, Connection validation, Enable / disable database access, Graceful / fast shutdown, Prometheus support, Grafana 8 dashboard, Remote management, Authentication query support, Failover support, Transport Layer Security (TLS) v1.2+ support, Daemon support, User vault, Lightweight connection pooler for PostgreSQL. WWW: https://agroal.github.io/pgagroal/ Sponsored by: Bounce Experts
Diffstat (limited to 'databases/pgagroal')
-rw-r--r--databases/pgagroal/Makefile49
-rw-r--r--databases/pgagroal/distinfo3
-rw-r--r--databases/pgagroal/files/patch-doc_etc_pgagroal.conf20
-rw-r--r--databases/pgagroal/files/pgagroal.in35
-rw-r--r--databases/pgagroal/pkg-descr10
-rw-r--r--databases/pgagroal/pkg-plist16
6 files changed, 133 insertions, 0 deletions
diff --git a/databases/pgagroal/Makefile b/databases/pgagroal/Makefile
new file mode 100644
index 000000000000..83ecbd8a3dd0
--- /dev/null
+++ b/databases/pgagroal/Makefile
@@ -0,0 +1,49 @@
+PORTNAME= pgagroal
+PORTVERSION= 1.4.2
+CATEGORIES= databases
+MASTER_SITES= https://github.com/agroal/${PORTNAME}/releases/download/${PORTVERSION}/
+
+MAINTAINER= bofh@FreeBSD.org
+COMMENT= High-performance protocol-native connection pool for PostgreSQL
+
+LICENSE= BSD3CLAUSE
+
+BUILD_DEPENDS= rst2man:textproc/py-docutils
+LIB_DEPENDS= libev.so:devel/libev
+
+USES= cmake pathfix ssl
+USE_LDCONFIG= yes
+USE_RC_SUBR= pgagroal
+
+SUB_LIST= PGAGROAL_RUNDIR="${PGAGROAL_RUNDIR}"
+
+USERS= pgagroal
+GROUPS= pgagroal
+
+PLIST_SUB+= PGAGROAL_GROUP="${GROUPS}" \
+ PGAGROAL_LOGDIR="${PGAGROAL_LOGDIR}" \
+ PGAGROAL_RUNDIR="${PGAGROAL_RUNDIR}" \
+ PGAGROAL_USER="${USERS}"
+
+PGAGROAL_GROUP?= pgagroal
+PGAGROAL_USER?= pgagroal
+
+PGAGROAL_RUNDIR?= /var/run/pgagroal
+PGAGROAL_LOGDIR?= /var/log/pgagroal
+
+post-patch:
+ @${MV} ${WRKSRC}/doc/etc/pgagroal.conf \
+ ${WRKSRC}/doc/etc/pgagroal.conf.sample
+ @${MV} ${WRKSRC}/doc/etc/pgagroal_hba.conf \
+ ${WRKSRC}/doc/etc/pgagroal_hba.conf.sample
+ @${REINPLACE_CMD} 's|etc/pgagroal.conf|etc/pgagroal.conf.sample|g; \
+ s|etc/pgagroal_hba.conf|etc/pgagroal_hba.conf.sample|g' \
+ ${WRKSRC}/doc/CMakeLists.txt
+ @${REINPLACE_CMD} 's|pgagraol.%d.pid|pgagroal.pid|g' \
+ ${WRKSRC}/src/libpgagroal/configuration.c
+
+post-install:
+ @${MKDIR} ${STAGEDIR}${PGAGROAL_RUNDIR} \
+ ${STAGEDIR}${PGAGROAL_LOGDIR}
+
+.include <bsd.port.mk>
diff --git a/databases/pgagroal/distinfo b/databases/pgagroal/distinfo
new file mode 100644
index 000000000000..6bf13a32b3b2
--- /dev/null
+++ b/databases/pgagroal/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1656274963
+SHA256 (pgagroal-1.4.2.tar.gz) = 6feb76e59eb4163de423025a6a1fbe34a48fe6880741107ca1f73c617af4da31
+SIZE (pgagroal-1.4.2.tar.gz) = 256332
diff --git a/databases/pgagroal/files/patch-doc_etc_pgagroal.conf b/databases/pgagroal/files/patch-doc_etc_pgagroal.conf
new file mode 100644
index 000000000000..aa2bbe98f625
--- /dev/null
+++ b/databases/pgagroal/files/patch-doc_etc_pgagroal.conf
@@ -0,0 +1,20 @@
+--- doc/etc/pgagroal.conf.orig 2022-05-23 17:17:02 UTC
++++ doc/etc/pgagroal.conf
+@@ -2,14 +2,14 @@ port = 2345
+ host = localhost
+ port = 2345
+
+-log_type = console
++log_type = file
+ log_level = info
+-log_path =
++log_path = /var/log/pgagroal/pgagroal.log
+
+ max_connections = 100
+ idle_timeout = 600
+ validation = off
+-unix_socket_dir = /tmp/
++unix_socket_dir = /var/run/pgagroal/
+
+ [primary]
+ host = localhost
diff --git a/databases/pgagroal/files/pgagroal.in b/databases/pgagroal/files/pgagroal.in
new file mode 100644
index 000000000000..a8feb75819cd
--- /dev/null
+++ b/databases/pgagroal/files/pgagroal.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# PROVIDE: pgagroal
+# REQUIRE: LOGIN
+# BEFORE: securelevel
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable pgagroal:
+#
+# pgagroal_enable (bool): Set to "YES" to enable pgagroal
+# Default is "NO".
+# pgagroal_conf (path): Set full path to configuration file.
+# Default is "%%PREFIX%%/etc/pgagroal.conf".
+# pgagroal_flags (string): Additional flags passed to pgagroal.
+# Default is "".
+
+. /etc/rc.subr
+
+name="pgagroal"
+rcvar=pgagroal_enable
+
+load_rc_config "$name"
+: ${pgagroal_enable="NO"}
+: ${pgagroal_user="pgagroal"}
+: ${pgagroal_conf="%%PREFIX%%/etc/$name/$name.conf"}
+: ${pgagroal_hba_conf="%%PREFIX%%/etc/$name/pgagroal_hba.conf"}
+
+extra_commands="reload"
+
+command="%%PREFIX%%/bin/pgagroal"
+pidfile="%%PGAGROAL_RUNDIR%%/$name.pid"
+required_files="${pgagroal_conf} ${pgagroal_hba_conf}"
+command_args="-d -c ${pgagroal_conf} -a ${pgagroal_hba_conf}"
+
+run_rc_command "$1"
diff --git a/databases/pgagroal/pkg-descr b/databases/pgagroal/pkg-descr
new file mode 100644
index 000000000000..c56a20b983b2
--- /dev/null
+++ b/databases/pgagroal/pkg-descr
@@ -0,0 +1,10 @@
+pgagroal is a high-performance protocol-native connection pool for
+PostgreSQL. Which features High performance, Connection pool, Limit
+connections for users and databases, Prefill support, Remove idle
+connections, Connection validation, Enable / disable database access,
+Graceful / fast shutdown, Prometheus support, Grafana 8 dashboard,
+Remote management, Authentication query support, Failover support,
+Transport Layer Security (TLS) v1.2+ support, Daemon support, User
+vault, Lightweight connection pooler for PostgreSQL.
+
+WWW: https://agroal.github.io/pgagroal/
diff --git a/databases/pgagroal/pkg-plist b/databases/pgagroal/pkg-plist
new file mode 100644
index 000000000000..ce32ef26fe91
--- /dev/null
+++ b/databases/pgagroal/pkg-plist
@@ -0,0 +1,16 @@
+bin/pgagroal
+bin/pgagroal-admin
+bin/pgagroal-cli
+@sample %%ETCDIR%%/pgagroal.conf.sample
+@sample %%ETCDIR%%/pgagroal_hba.conf.sample
+lib/libpgagroal.so
+lib/libpgagroal.so.1
+lib/libpgagroal.so.1.4.2
+share/man/man1/pgagroal-admin.1.gz
+share/man/man1/pgagroal-cli.1.gz
+share/man/man1/pgagroal.1.gz
+share/man/man5/pgagroal.conf.5.gz
+share/man/man5/pgagroal_databases.conf.5.gz
+share/man/man5/pgagroal_hba.conf.5.gz
+@dir(%%PGAGROAL_USER%%,%%PGAGROAL_GROUP%%,) %%PGAGROAL_LOGDIR%%
+@dir(%%PGAGROAL_USER%%,%%PGAGROAL_GROUP%%,) %%PGAGROAL_RUNDIR%%