Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jun 2022 03:11:43 GMT
From:      Muhammad Moinur Rahman <bofh@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: e81ba30a41e2 - main - databases/pgagroal: New Port
Message-ID:  <202206270311.25R3BhG6083212@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e81ba30a41e2c762617036c91a2da8adc718d811

commit e81ba30a41e2c762617036c91a2da8adc718d811
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2022-06-27 03:10:28 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2022-06-27 03:11:32 +0000

    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
---
 GIDs                                               |  1 +
 UIDs                                               |  1 +
 databases/Makefile                                 |  1 +
 databases/pgagroal/Makefile                        | 49 ++++++++++++++++++++++
 databases/pgagroal/distinfo                        |  3 ++
 .../pgagroal/files/patch-doc_etc_pgagroal.conf     | 20 +++++++++
 databases/pgagroal/files/pgagroal.in               | 35 ++++++++++++++++
 databases/pgagroal/pkg-descr                       | 10 +++++
 databases/pgagroal/pkg-plist                       | 16 +++++++
 9 files changed, 136 insertions(+)

diff --git a/GIDs b/GIDs
index 171823bb501f..7440c023f528 100644
--- a/GIDs
+++ b/GIDs
@@ -887,6 +887,7 @@ teamspeak:*:942:
 dnetfold:*:943:
 bbs:*:944:
 dbxml:*:945:
+pgagroal:*:946:
 gnokii:*:947:
 dnrd:*:948:
 _lldpd:*:949:
diff --git a/UIDs b/UIDs
index 6cf2fbe047a6..57906f7725ff 100644
--- a/UIDs
+++ b/UIDs
@@ -892,6 +892,7 @@ teamspeak:*:942:942::0:0:TeamSpeak user:/nonexistent:/usr/sbin/nologin
 dnetfold:*:943:943::0:0:& user:/nonexistent:/usr/sbin/nologin
 bbs:*:944:944::0:0:& user:/nonexistent:/usr/sbin/nologin
 dbxml:*:945:945::0:0:& user:/nonexistent:/usr/sbin/nologin
+pgagroal:*:946:946::0:0:Pgagroal user:/nonexistent:/usr/sbin/nologin
 mapred:*:947:955::0:0:Hadoop MapReduce user:/nonexistent:/usr/sbin/nologin
 dnrd:*:948:948::0:0:& user:/nonexistent:/usr/sbin/nologin
 _lldpd:*:949:949::0:0:lldpd user:/nonexistent:/usr/sbin/nologin
diff --git a/databases/Makefile b/databases/Makefile
index cf09aeff5f1e..d6c0942b3742 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -581,6 +581,7 @@
     SUBDIR += pg_tileserv
     SUBDIR += pgaccess
     SUBDIR += pgadmin3
+    SUBDIR += pgagroal
     SUBDIR += pgbackrest
     SUBDIR += pgbadger
     SUBDIR += pgbarman
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%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206270311.25R3BhG6083212>