summaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authorfhajny <fhajny>2016-03-11 21:30:55 +0000
committerfhajny <fhajny>2016-03-11 21:30:55 +0000
commitbe16ae9e126be2db26c71d24378411292ebf5898 (patch)
treef378114054b21ec18eb871dbf2c3d3a8d0e153b2 /databases
parent79b9afc4db2aff2c23c8ae49fa03f89a5ab75371 (diff)
downloadpkgsrc-be16ae9e126be2db26c71d24378411292ebf5898.tar.gz
Import pgpool-II 3.5.0 as databases/pgpool2, based on wip/pgpool2.
pgpool-II is a middleware that works between PostgreSQL servers and a PostgreSQL database client. It talks PostgreSQL's backend and frontend protocol, and relays a connection between them.
Diffstat (limited to 'databases')
-rw-r--r--databases/pgpool2/DESCR4
-rw-r--r--databases/pgpool2/Makefile73
-rw-r--r--databases/pgpool2/PLIST40
-rw-r--r--databases/pgpool2/distinfo10
-rw-r--r--databases/pgpool2/files/pgpool2.sh24
-rw-r--r--databases/pgpool2/files/smf/manifest.xml30
-rw-r--r--databases/pgpool2/options.mk30
-rw-r--r--databases/pgpool2/patches/patch-configure15
-rw-r--r--databases/pgpool2/patches/patch-src_include_pool.h15
-rw-r--r--databases/pgpool2/patches/patch-src_sample_pgpool.conf.sample28
-rw-r--r--databases/pgpool2/patches/patch-src_watchdog_wd__escalation.c16
11 files changed, 285 insertions, 0 deletions
diff --git a/databases/pgpool2/DESCR b/databases/pgpool2/DESCR
new file mode 100644
index 00000000000..12c5c080a62
--- /dev/null
+++ b/databases/pgpool2/DESCR
@@ -0,0 +1,4 @@
+pgpool-II is a middleware that works between PostgreSQL
+servers and a PostgreSQL database client. It talks
+PostgreSQL's backend and frontend protocol, and relays
+a connection between them.
diff --git a/databases/pgpool2/Makefile b/databases/pgpool2/Makefile
new file mode 100644
index 00000000000..a8dc9935182
--- /dev/null
+++ b/databases/pgpool2/Makefile
@@ -0,0 +1,73 @@
+# $NetBSD: Makefile,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+#
+
+DISTNAME= pgpool-II-3.5.0
+PKGNAME= postgresql${PGSQL_VERSION}-${DISTNAME:S/pgpool-II/pgpool2/}
+CATEGORIES= databases
+MASTER_SITES= http://www.pgpool.net/mediawiki/images/
+
+MAINTAINER= filip@joyent.com
+HOMEPAGE= http://www.pgpool.net/mediawiki/
+COMMENT= Middleware between PostgreSQL servers and a PostgreSQL database client
+LICENSE= modified-bsd
+
+DEPENDS+= postgresql${PGSQL_VERSION}-server>=0:../../databases/postgresql${PGSQL_VERSION}-server
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake
+
+.include "options.mk"
+.include "../../mk/bsd.prefs.mk"
+
+BUILD_DEFS+= PGPOOL_USER PGPOOL_GROUP PGGROUP PGHOME VARBASE
+
+EGDIR= share/examples/pgpool2
+
+PGPOOL_USER?= pgpool
+PGPOOL_GROUP?= ${PGGROUP}
+PGGROUP?= pgsql
+PGHOME?= ${PREFIX}/${PGGROUP}
+
+PKG_GROUPS= ${PGPOOL_GROUP}
+PKG_USERS= ${PGPOOL_USER}:${PGPOOL_GROUP}
+PKG_GROUPS_VARS+= PGPOOL_GROUP
+PKG_USERS_VARS= PGPOOL_USER
+PKG_HOME.${PGPOOL_USER}= ${PGHOME}
+PKG_SHELL.${PGPOOL_GROUP}= ${SH}
+
+PKG_SYSCONFSUBDIR= pgpool2
+PGPOOL_LOGDIR?= ${VARBASE}/log/pgpool
+PGPOOL_PIDDIR?= ${VARBASE}/run/pgpool
+OWN_DIRS_PERMS+= ${PGPOOL_LOGDIR} ${PGPOOL_USER} ${PGPOOL_GROUP} 0751
+OWN_DIRS_PERMS+= ${PGPOOL_PIDDIR} ${PGPOOL_USER} ${PGPOOL_GROUP} 0751
+
+SUBST_CLASSES+= path
+SUBST_MESSAGE.path= Fixing default paths
+SUBST_STAGE.path= pre-configure
+SUBST_FILES.path= src/sample/pgpool.conf.sample src/include/pool.h
+SUBST_VARS.path= PGPOOL_LOGDIR PGPOOL_PIDDIR
+
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
+
+BUILD_DIRS= . src/sql
+
+INSTALL_MAKE_FLAGS+= sysconfdir=${PREFIX}/${EGDIR}
+
+RCD_SCRIPTS+= pgpool2
+SMF_NAME= pgpool
+FILES_SUBST+= PGPOOL_USER=${PGPOOL_USER}
+FILES_SUBST+= PGPOOL_GROUP=${PGPOOL_GROUP}
+
+CONF_FILES+= ${EGDIR}/pcp.conf.sample ${PKG_SYSCONFDIR}/pcp.conf
+CONF_FILES+= ${EGDIR}/pgpool.conf.sample ${PKG_SYSCONFDIR}/pgpool.conf
+CONF_FILES+= ${EGDIR}/pool_hba.conf.sample ${PKG_SYSCONFDIR}/pool_hba.conf
+CONF_FILES_PERMS+= ${EGDIR}/pool_passwd ${PKG_SYSCONFDIR}/pool_passwd \
+ ${PGPOOL_USER} ${PGGROUP} 0640
+
+post-install:
+ ${TOUCH} ${DESTDIR}${PREFIX}/share/examples/pgpool2/pool_passwd
+
+.include "../../mk/pgsql.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/databases/pgpool2/PLIST b/databases/pgpool2/PLIST
new file mode 100644
index 00000000000..097179b803b
--- /dev/null
+++ b/databases/pgpool2/PLIST
@@ -0,0 +1,40 @@
+@comment $NetBSD: PLIST,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+bin/pcp_attach_node
+bin/pcp_detach_node
+bin/pcp_node_count
+bin/pcp_node_info
+bin/pcp_pool_status
+bin/pcp_proc_count
+bin/pcp_proc_info
+bin/pcp_promote_node
+bin/pcp_recovery_node
+bin/pcp_stop_pgpool
+bin/pcp_watchdog_info
+bin/pg_md5
+bin/pgpool
+include/libpcp_ext.h
+include/pcp.h
+include/pool_process_reporting.h
+include/pool_type.h
+lib/libpcp.la
+lib/postgresql/pgpool-recovery.so
+lib/postgresql/pgpool-regclass.so
+lib/postgresql/pgpool_adm.so
+man/man8/pgpool.8
+share/examples/pgpool2/pcp.conf.sample
+share/examples/pgpool2/pgpool.conf.sample
+share/examples/pgpool2/pgpool.conf.sample-master-slave
+share/examples/pgpool2/pgpool.conf.sample-replication
+share/examples/pgpool2/pgpool.conf.sample-stream
+share/examples/pgpool2/pool_hba.conf.sample
+share/examples/pgpool2/pool_passwd
+share/pgpool2/insert_lock.sql
+share/pgpool2/pgpool.pam
+share/postgresql/extension/pgpool-recovery.sql
+share/postgresql/extension/pgpool-regclass.sql
+share/postgresql/extension/pgpool_adm--1.0.sql
+share/postgresql/extension/pgpool_adm.control
+share/postgresql/extension/pgpool_recovery--1.1.sql
+share/postgresql/extension/pgpool_recovery.control
+share/postgresql/extension/pgpool_regclass--1.0.sql
+share/postgresql/extension/pgpool_regclass.control
diff --git a/databases/pgpool2/distinfo b/databases/pgpool2/distinfo
new file mode 100644
index 00000000000..25a4205c604
--- /dev/null
+++ b/databases/pgpool2/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+
+SHA1 (pgpool-II-3.5.0.tar.gz) = f5041afe078bc8c414e4db8ab0119c4e76aaaaab
+RMD160 (pgpool-II-3.5.0.tar.gz) = 0ed82d605da0fc0ed7ff3f9c45e7731307f53299
+SHA512 (pgpool-II-3.5.0.tar.gz) = da11dd552fdad3d13676681b562972050a71f0cd0240456b76e99b860f94dc733b05f1c12bb3de3bf1d1f3f3762ef8f5533416c8c311639b97ed716e0818a172
+Size (pgpool-II-3.5.0.tar.gz) = 2205490 bytes
+SHA1 (patch-configure) = a220d49eecd5408f576f22226089daa298b27d4c
+SHA1 (patch-src_include_pool.h) = 74409384d735695d44466468833088959753d9d2
+SHA1 (patch-src_sample_pgpool.conf.sample) = db3f6e280d3b02dd6c5abab9aba087ce30acbaa5
+SHA1 (patch-src_watchdog_wd__escalation.c) = 63ac5ea3f8853eb953707e79f351ae1eea3a8b25
diff --git a/databases/pgpool2/files/pgpool2.sh b/databases/pgpool2/files/pgpool2.sh
new file mode 100644
index 00000000000..66f0506ace4
--- /dev/null
+++ b/databases/pgpool2/files/pgpool2.sh
@@ -0,0 +1,24 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: pgpool2.sh,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+#
+# PROVIDE: pgpool2
+# REQUIRE: DAEMON network
+# KEYWORD: shutdown
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="pgpool2"
+rcvar=$name
+command="@PREFIX@/bin/pgpool"
+pgpool_user="@PGPOOL_USER@"
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ echo -n "${name}"
+ @SU@ -m ${pgpool_user} -c "${command}"
+fi
diff --git a/databases/pgpool2/files/smf/manifest.xml b/databases/pgpool2/files/smf/manifest.xml
new file mode 100644
index 00000000000..d694707aad8
--- /dev/null
+++ b/databases/pgpool2/files/smf/manifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="pgpool">
+ <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
+ <create_default_instance enabled="false" />
+ <single_instance />
+ <dependency name="network" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/milestone/network:default" />
+ </dependency>
+ <dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/system/filesystem/local" />
+ </dependency>
+ <method_context>
+ <method_credential user="@PGPOOL_USER@" group="@PGPOOL_GROUP@" />
+ </method_context>
+ <exec_method type="method" name="start" exec="@PREFIX@/bin/pgpool" timeout_seconds="300" />
+ <exec_method type="method" name="stop" exec="@PREFIX@/bin/pgpool stop" timeout_seconds="3600" />
+ <property_group name="startd" type="framework">
+ <propval name="duration" type="astring" value="contract" />
+ <propval name="ignore_error" type="astring" value="core,signal" />
+ </property_group>
+ <property_group name="application" type="application"></property_group>
+ <stability value="Evolving" />
+ <template>
+ <common_name>
+ <loctext xml:lang="C">pgpool-II</loctext>
+ </common_name>
+ </template>
+ </service>
+</service_bundle>
diff --git a/databases/pgpool2/options.mk b/databases/pgpool2/options.mk
new file mode 100644
index 00000000000..23269b54c33
--- /dev/null
+++ b/databases/pgpool2/options.mk
@@ -0,0 +1,30 @@
+# $NetBSD: options.mk,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.postgresql-pgpool
+PKG_SUPPORTED_OPTIONS= memcached pam ssl
+
+.include "../../mk/bsd.options.mk"
+
+###
+### memcached support.
+###
+.if !empty(PKG_OPTIONS:Mmemcached)
+CONFIGURE_ARGS+= --with-memcached=${BUILDLINK_PREFIX.libmemcached}
+.include "../../devel/libmemcached/buildlink3.mk"
+.endif
+
+###
+### pam support.
+###
+.if !empty(PKG_OPTIONS:Mpam)
+CONFIGURE_ARGS+= --with-pam
+.include "../../mk/pam.buildlink3.mk"
+.endif
+
+###
+### OpenSSL support.
+###
+.if !empty(PKG_OPTIONS:Mssl)
+CONFIGURE_ARGS+= --with-openssl
+.include "../../security/openssl/buildlink3.mk"
+.endif
diff --git a/databases/pgpool2/patches/patch-configure b/databases/pgpool2/patches/patch-configure
new file mode 100644
index 00000000000..02b3bc3ba43
--- /dev/null
+++ b/databases/pgpool2/patches/patch-configure
@@ -0,0 +1,15 @@
+$NetBSD: patch-configure,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+
+Pick a better name for the package.
+
+--- configure.orig 2016-02-10 08:53:31.000000000 +0000
++++ configure
+@@ -3979,7 +3979,7 @@ fi
+
+
+ # Define the identity of the package.
+- PACKAGE='pgpool-II'
++ PACKAGE='pgpool2'
+ VERSION='3.5.0'
+
+
diff --git a/databases/pgpool2/patches/patch-src_include_pool.h b/databases/pgpool2/patches/patch-src_include_pool.h
new file mode 100644
index 00000000000..59f1f06c35e
--- /dev/null
+++ b/databases/pgpool2/patches/patch-src_include_pool.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_include_pool.h,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+
+Default pid file location.
+
+--- src/include/pool.h.orig 2016-02-20 00:28:07.000000000 +0200
++++ src/include/pool.h 2016-02-20 00:29:09.000000000 +0200
+@@ -81,7 +81,7 @@
+ #define DEFAULT_WD_IPC_SOCKET_DIR "/tmp"
+
+ /* pid file name */
+-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid"
++#define DEFAULT_PID_FILE_NAME "@PGPOOL_PIDDIR@/pgpool.pid"
+
+ /* status file name */
+ #define STATUS_FILE_NAME "pgpool_status"
diff --git a/databases/pgpool2/patches/patch-src_sample_pgpool.conf.sample b/databases/pgpool2/patches/patch-src_sample_pgpool.conf.sample
new file mode 100644
index 00000000000..ce5101d890a
--- /dev/null
+++ b/databases/pgpool2/patches/patch-src_sample_pgpool.conf.sample
@@ -0,0 +1,28 @@
+$NetBSD: patch-src_sample_pgpool.conf.sample,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+
+Default pid file location.
+
+--- src/sample/pgpool.conf.sample.orig 2015-04-08 07:58:44.000000000 +0000
++++ src/sample/pgpool.conf.sample
+@@ -211,10 +211,10 @@ debug_level = 0
+ # FILE LOCATIONS
+ #------------------------------------------------------------------------------
+
+-pid_file_name = '/var/run/pgpool/pgpool.pid'
++pid_file_name = '@PGPOOL_PIDDIR@/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/var/log/pgpool'
++logdir = '@PGPOOL_LOGDIR@'
+ # Directory of pgPool status file
+ # (change requires restart)
+
+@@ -682,7 +682,7 @@ memqcache_cache_block_size = 1048576
+ # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'.
+ # Defaults to 1MB.
+ # (change requires restart)
+-memqcache_oiddir = '/var/log/pgpool/oiddir'
++memqcache_oiddir = '@PGPOOL_LOGDIR@/oiddir'
+ # Temporary work directory to record table oids
+ # (change requires restart)
+ white_memqcache_table_list = ''
diff --git a/databases/pgpool2/patches/patch-src_watchdog_wd__escalation.c b/databases/pgpool2/patches/patch-src_watchdog_wd__escalation.c
new file mode 100644
index 00000000000..4316fb687d8
--- /dev/null
+++ b/databases/pgpool2/patches/patch-src_watchdog_wd__escalation.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_watchdog_wd__escalation.c,v 1.1 2016/03/11 21:30:55 fhajny Exp $
+
+Add sys/wait.h unconditionally, same as other source files.
+
+--- src/watchdog/wd_escalation.c.orig 2016-02-10 08:53:31.000000000 +0000
++++ src/watchdog/wd_escalation.c
+@@ -27,9 +27,7 @@
+ #include <unistd.h>
+ #include <errno.h>
+
+-#ifdef __FreeBSD__
+ #include <sys/wait.h>
+-#endif
+
+ #include "pool.h"
+ #include "utils/elog.h"