aboutsummaryrefslogtreecommitdiff
path: root/databases/pgbouncer
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2011-01-15 00:06:46 +0000
committerMartin Matuska <mm@FreeBSD.org>2011-01-15 00:06:46 +0000
commitf09b9d995b81a74828a34b4372a9b6c42645db69 (patch)
treeb129175525f50c9ca732305a79334f814d73554d /databases/pgbouncer
parent9774f163deaaa039e465c8a1c28f9e98a2f1cf62 (diff)
downloadports-f09b9d995b81a74828a34b4372a9b6c42645db69.tar.gz
ports-f09b9d995b81a74828a34b4372a9b6c42645db69.zip
Notes
Diffstat (limited to 'databases/pgbouncer')
-rw-r--r--databases/pgbouncer/Makefile9
-rw-r--r--databases/pgbouncer/distinfo5
-rw-r--r--databases/pgbouncer/files/patch-lib-usual-endian.h32
-rw-r--r--databases/pgbouncer/files/pgbouncer.sh.in24
4 files changed, 54 insertions, 16 deletions
diff --git a/databases/pgbouncer/Makefile b/databases/pgbouncer/Makefile
index 720f27149791..e93541923f44 100644
--- a/databases/pgbouncer/Makefile
+++ b/databases/pgbouncer/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= pgbouncer
-PORTVERSION= 1.3.4
+PORTVERSION= 1.4
CATEGORIES= databases
-MASTER_SITES= http://pgfoundry.org/frs/download.php/2797/
+MASTER_SITES= http://pgfoundry.org/frs/download.php/2912/
MAINTAINER= skv@FreeBSD.org
COMMENT= Lightweight connection pooler for PostgreSQL
@@ -40,7 +40,10 @@ PGBOUNCER_GROUP?= pgbouncer
PGBOUNCER_RUNDIR?= /var/run/pgbouncer
PGBOUNCER_LOGDIR?= /var/log/pgbouncer
+BUILD_DEPENDS+= ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed
+
.include <bsd.port.pre.mk>
+
# Parse ${PORTSDIR}/UIDs and GIDs for the defaults
USER!= ${GREP} -E '^${PGBOUNCER_USER}:' ${PORTSDIR}/UIDs | \
${SED} -Ee 's/^([^:]*):([^:]*):([^:]*):([^:]*)::0:0:([^:]*):([^:]*):([^:]*)$$/USER="\1" UID="\3" GECOS="\5" HOME="\6" SHELL="\7"/'
@@ -71,6 +74,8 @@ post-patch:
@${REINPLACE_CMD} -e "s|= pgbouncer.log|= ${PGBOUNCER_LOGDIR}/pgbouncer.log|g" \
-e "s|= pgbouncer.pid|= ${PGBOUNCER_RUNDIR}/pgbouncer.pid|g" \
${WRKSRC}/etc/pgbouncer.ini
+ @${REINPLACE_CMD} -e "s|sed -n|${LOCALBASE}/bin/gsed -n|g" \
+ ${WRKSRC}/lib/find_modules.sh
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/pgbouncer ${PREFIX}/bin/
diff --git a/databases/pgbouncer/distinfo b/databases/pgbouncer/distinfo
index a3fd3eb21350..f9e4d317627e 100644
--- a/databases/pgbouncer/distinfo
+++ b/databases/pgbouncer/distinfo
@@ -1,3 +1,2 @@
-MD5 (pgbouncer-1.3.4.tar.gz) = 38af22d4b3546dc6763d374ec3b40f38
-SHA256 (pgbouncer-1.3.4.tar.gz) = 74eba35f6e088d45a49e4b2226b266d8d5649af498f72f771a22873fa9b16fe7
-SIZE (pgbouncer-1.3.4.tar.gz) = 167957
+SHA256 (pgbouncer-1.4.tar.gz) = e94a8e7edd6de4ae6978e8f485bbc6a610195b56b1f5fe95a49bfd70959628fb
+SIZE (pgbouncer-1.4.tar.gz) = 231691
diff --git a/databases/pgbouncer/files/patch-lib-usual-endian.h b/databases/pgbouncer/files/patch-lib-usual-endian.h
new file mode 100644
index 000000000000..7995a10dab31
--- /dev/null
+++ b/databases/pgbouncer/files/patch-lib-usual-endian.h
@@ -0,0 +1,32 @@
+--- lib/usual/endian.h.orig 2010-12-14 07:35:50.000000000 +0100
++++ lib/usual/endian.h 2011-01-12 16:01:08.148625395 +0100
+@@ -157,6 +157,7 @@
+ /*
+ * Read LE/BE values from memory.
+ */
++#ifndef __FreeBSD__
+
+ #define _DEC(name, typ, decode) \
+ static inline typ name(const void *p) { \
+@@ -173,10 +174,14 @@
+ _DEC(le64dec, uint64_t, le64toh)
+ #undef _DEC
+
++#endif
++
+ /*
+ * Write LE/BE values to memory.
+ */
+
++#ifndef __FreeBSD__
++
+ #define _ENC(name, typ, encode) \
+ static inline void name(void *p, typ val) { \
+ typ tmp = encode(val); \
+@@ -190,4 +195,6 @@
+ _ENC(le64enc, uint64_t, htole64)
+ #undef _ENC
+
++#endif
++
+ #endif /* _USUAL_ENDIAN_H_ */
diff --git a/databases/pgbouncer/files/pgbouncer.sh.in b/databases/pgbouncer/files/pgbouncer.sh.in
index 29c4ecf65ab8..9d4c8f2cffd0 100644
--- a/databases/pgbouncer/files/pgbouncer.sh.in
+++ b/databases/pgbouncer/files/pgbouncer.sh.in
@@ -10,26 +10,28 @@
# Add the following lines to /etc/rc.conf to enable pgbouncer:
#
-# pgbouncer_enable="YES"
-# pgbouncer_flags="<set as needed>"
-#
+# pgbouncer_enable (bool): Set to "YES" to enable pgbouncer
+# Default is "NO".
+# pgbouncer_conf (path): Set full path to configuration file.
+# Default is "%%PREFIX%%/etc/pgbouncer.ini".
+# pgbouncer_flags (string): Additional flags passed to pgbouncer.
+# Default is "".
. /etc/rc.subr
name="pgbouncer"
rcvar=`set_rcvar`
+load_rc_config "$name"
+: ${pgbouncer_enable="NO"}
+: ${pgbouncer_user="pgbouncer"}
+: ${pgbouncer_conf="%%PREFIX%%/etc/$name.ini"}
+
extra_commands="reload"
command="%%PREFIX%%/bin/pgbouncer"
-config_file="%%PREFIX%%/etc/$name.ini"
-command_args="-d ${config_file}"
pidfile="%%PGBOUNCER_RUNDIR%%/$name.pid"
-required_files="${config_file}"
-
-# read configuration and set defaults
-load_rc_config "$name"
-: ${pgbouncer_enable="NO"}
-: ${pgbouncer_user="%%PGBOUNCER_USER%%"}
+required_files="${pgbouncer_conf}"
+command_args="-d ${pgbouncer_conf}"
run_rc_command "$1"