Update to 1.4.1
Changes: http://pgfoundry.org/frs/shownotes.php?release_id=1795 PR: ports/157702 Submitted by: mm
This commit is contained in:
parent
e736e2808f
commit
572af21f20
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=275239
@ -6,9 +6,9 @@
|
||||
#
|
||||
|
||||
PORTNAME= pgbouncer
|
||||
PORTVERSION= 1.4
|
||||
PORTVERSION= 1.4.1
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= http://pgfoundry.org/frs/download.php/2912/
|
||||
MASTER_SITES= http://pgfoundry.org/frs/download.php/2987/
|
||||
|
||||
MAINTAINER= skv@FreeBSD.org
|
||||
COMMENT= Lightweight connection pooler for PostgreSQL
|
||||
@ -17,6 +17,9 @@ LIB_DEPENDS= event-1.4:${PORTSDIR}/devel/libevent
|
||||
|
||||
PORTSCOUT= site:http://pgfoundry.org/frs/?group_id=1000258
|
||||
|
||||
USERS= pgbouncer
|
||||
GROUPS= pgbouncer
|
||||
|
||||
USE_RC_SUBR= pgbouncer.sh
|
||||
SUB_FILES= pkg-message pkg-install pkg-deinstall
|
||||
|
||||
@ -29,6 +32,8 @@ MAN5= pgbouncer.5
|
||||
.endif
|
||||
|
||||
CONFIGURE_ARGS= --with-libevent=${LOCALBASE}
|
||||
CONFIGURE_ENV+= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
|
||||
PTHREAD_LIBS=${PTHREAD_LIBS}
|
||||
|
||||
PKGINSTALL= ${WRKDIR}/pkg-install
|
||||
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
||||
@ -44,28 +49,8 @@ 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"/'
|
||||
GROUP!= ${GREP} -E '^${PGBOUNCER_GROUP}:' ${PORTSDIR}/GIDs | \
|
||||
${SED} -Ee 's/^([^:]*):([^:]*):([^:]*):$$/GROUP="\1" GID="\3"/'
|
||||
|
||||
# Apply the defaults where necessary
|
||||
PGBOUNCER_USER?= ${USER:MUSER*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
PGBOUNCER_UID?= ${USER:MUID*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
PGBOUNCER_GECOS?= ${USER:MGECOS*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
PGBOUNCER_HOME?= ${USER:MHOME*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
PGBOUNCER_SHELL?= ${USER:MSHELL*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
PGBOUNCER_GROUP?= ${GROUP:MGROUP*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
PGBOUNCER_GID?= ${GROUP:MGID*:C/^[^=]*=\"([^\"]*)\"$/\1/}
|
||||
|
||||
SUB_LIST+= PGBOUNCER_USER="${PGBOUNCER_USER}" \
|
||||
PGBOUNCER_UID="${PGBOUNCER_UID}" \
|
||||
PGBOUNCER_GECOS="${PGBOUNCER_GECOS}" \
|
||||
PGBOUNCER_HOME="${PGBOUNCER_HOME}" \
|
||||
PGBOUNCER_SHELL="${PGBOUNCER_SHELL}" \
|
||||
PGBOUNCER_GROUP="${PGBOUNCER_GROUP}" \
|
||||
PGBOUNCER_GID="${PGBOUNCER_GID}" \
|
||||
SUB_LIST+= PGBOUNCER_USER="${USERS}" \
|
||||
PGBOUNCER_GROUP="${GROUPS}" \
|
||||
PGBOUNCER_LOGDIR="${PGBOUNCER_LOGDIR}" \
|
||||
PGBOUNCER_RUNDIR="${PGBOUNCER_RUNDIR}" \
|
||||
CHMOD="${CHMOD}" CHOWN="${CHOWN}" MKDIR="${MKDIR}" PW="${PW}"
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (pgbouncer-1.4.tar.gz) = e94a8e7edd6de4ae6978e8f485bbc6a610195b56b1f5fe95a49bfd70959628fb
|
||||
SIZE (pgbouncer-1.4.tar.gz) = 231691
|
||||
SHA256 (pgbouncer-1.4.1.tar.gz) = 24cd8fdeb6725bec260e5efbd21ba1e0a3f14b741b7003285760d178d6505672
|
||||
SIZE (pgbouncer-1.4.1.tar.gz) = 282728
|
||||
|
@ -1,32 +0,0 @@
|
||||
--- 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_ */
|
@ -13,18 +13,9 @@ PGBOUNCER_LOGDIR=%%PGBOUNCER_LOGDIR%%
|
||||
|
||||
PW="%%PW%%"
|
||||
|
||||
if ${PW} usershow "${pgbouncer_user}" 2>/dev/null 1>&2; then
|
||||
echo "To delete ${pgbouncer_user} user permanently, use the following command:"
|
||||
echo "${PW} userdel \"${pgbouncer_user}\""
|
||||
fi
|
||||
if ${PW} groupshow "${pgbouncer_group}" 2>/dev/null 1>&2; then
|
||||
echo "To delete ${pgbouncer_group} group permanently, use the following command:"
|
||||
echo "${PW} groupdel \"${pgbouncer_group}\""
|
||||
fi
|
||||
for DIR in ${PGBOUNCER_RUNDIR} ${PGBOUNCER_LOGDIR}; do
|
||||
if test -d "${DIR}"; then
|
||||
echo "You may want to remove the no longer required directory:"
|
||||
echo "${DIR}"
|
||||
echo "==> You should manually remove the directory: ${DIR}"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
|
@ -1,17 +1,12 @@
|
||||
#! /bin/sh
|
||||
# $FreeBSD#
|
||||
# $FreeBSD$
|
||||
|
||||
if [ "$2" != "POST-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pgbouncer_user="%%PGBOUNCER_USER%%"
|
||||
pgbouncer_uid="%%PGBOUNCER_UID%%"
|
||||
pgbouncer_group="%%PGBOUNCER_GROUP%%"
|
||||
pgbouncer_gid="%%PGBOUNCER_GID%%"
|
||||
pgbouncer_gecos="%%PGBOUNCER_GECOS%%"
|
||||
pgbouncer_home="%%PGBOUNCER_HOME%%"
|
||||
pgbouncer_shell="%%PGBOUNCER_SHELL%%"
|
||||
|
||||
PGBOUNCER_RUNDIR="%%PGBOUNCER_RUNDIR%%"
|
||||
PGBOUNCER_LOGDIR="%%PGBOUNCER_LOGDIR%%"
|
||||
@ -21,78 +16,11 @@ CHOWN="%%CHOWN%%"
|
||||
MKDIR="%%MKDIR%%"
|
||||
PW=%%PW%%
|
||||
|
||||
create_group() {
|
||||
local group gid
|
||||
|
||||
group=$1
|
||||
gid=$2
|
||||
|
||||
|
||||
if ${PW} group show -n $group >/dev/null 2>&1 ; then
|
||||
echo "===> Using existing group $group"
|
||||
else
|
||||
if ${PW} groupadd -n $group -g $gid ; then
|
||||
echo "===> Created group $group"
|
||||
else
|
||||
cat <<-EOERRORMSG
|
||||
*** Failed to create group $group.
|
||||
|
||||
Please add user $user and group $group
|
||||
manually with the following commands:
|
||||
|
||||
${PW} groupadd -n $group -g $gid
|
||||
${PW} useradd -n $user -u $uid -g $group -c "$gecos" \\
|
||||
-d $home -s $shell -h -
|
||||
|
||||
and retry installing this package.
|
||||
EOERRORMSG
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
create_user() {
|
||||
local user uid group gecos home shell
|
||||
|
||||
user=$1
|
||||
uid=$2
|
||||
group=$3
|
||||
gecos=$4
|
||||
home=$5
|
||||
shell=$6
|
||||
|
||||
if ${PW} user show -n $user >/dev/null 2>&1 ; then
|
||||
echo "===> Using existing user $user"
|
||||
else
|
||||
if ${PW} useradd -n $user -u $uid -g $group -c "$gecos" \
|
||||
-d "$home" -s "$shell" -h - ; then
|
||||
echo "===> Created user $user"
|
||||
else
|
||||
cat <<-EOERRORMSG
|
||||
*** Failed to create user $user.
|
||||
|
||||
Please add user $user manually with the following command:
|
||||
|
||||
${PW} useradd -n $user -u $uid -g $group -c "$gecos" \\
|
||||
-d $home -s $shell -h -
|
||||
|
||||
and retry installing this package.
|
||||
EOERRORMSG
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
create_group $pgbouncer_group $pgbouncer_gid
|
||||
create_user $pgbouncer_user $pgbouncer_uid $pgbouncer_group \
|
||||
"$pgbouncer_gecos" "$pgbouncer_home" "$pgbouncer_shell"
|
||||
for DIR in ${PGBOUNCER_RUNDIR} ${PGBOUNCER_LOGDIR}; do
|
||||
echo "===> Creating directory ${DIR}"
|
||||
echo "==> Creating directory ${DIR}"
|
||||
${MKDIR} ${DIR}
|
||||
echo "===> Changing ownership of ${DIR}"
|
||||
echo "==> Changing ownership of ${DIR}"
|
||||
${CHOWN} -R ${pgbouncer_user}:${pgbouncer_group} ${DIR}
|
||||
echo "===> Changing permissions of ${DIR}"
|
||||
echo "==> Changing permissions of ${DIR}"
|
||||
${CHMOD} -R 770 ${DIR}
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user