mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-21 00:25:50 +00:00
- Add STAGE support
- Depend on xmlto to generate man pages. Add DOCS option PR: ports/189787 Submitted by: "Mikhail T." <m.tsatsenko@gmail.com> (maintainer)
This commit is contained in:
parent
8dc7ac012f
commit
e90080ca9a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=355161
@ -10,34 +10,32 @@ MASTER_SITES= http://pgfoundry.org/frs/download.php/3393/
|
||||
MAINTAINER= m.tsatsenko@gmail.com
|
||||
COMMENT= Lightweight connection pooler for PostgreSQL
|
||||
|
||||
LICENSE= BSD
|
||||
LICENSE= BSD2CLAUSE
|
||||
|
||||
LIB_DEPENDS= libevent-2.0.so:${PORTSDIR}/devel/libevent2
|
||||
|
||||
OPTIONS_DEFINE= DOCS
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${PORT_OPTIONS:MDOCS}
|
||||
BUILD_DEPENDS+= xmlto:${PORTSDIR}/textproc/xmlto
|
||||
.endif
|
||||
|
||||
PORTSCOUT= site:http://pgfoundry.org/frs/?group_id=1000258
|
||||
|
||||
USERS= pgbouncer
|
||||
GROUPS= pgbouncer
|
||||
|
||||
USE_RC_SUBR= pgbouncer
|
||||
SUB_FILES= pkg-message pkg-install pkg-deinstall
|
||||
|
||||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
|
||||
.if ! defined(NO_INSTALL_MANPAGES)
|
||||
MAN1= pgbouncer.1
|
||||
MAN5= pgbouncer.5
|
||||
.endif
|
||||
USES= gmake
|
||||
|
||||
CONFIGURE_ARGS= --with-libevent=${LOCALBASE} --enable-evdns
|
||||
CONFIGURE_ENV+= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
|
||||
PTHREAD_LIBS=${PTHREAD_LIBS}
|
||||
|
||||
PKGINSTALL= ${WRKDIR}/pkg-install
|
||||
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
|
||||
PGBOUNCER_USER?= pgbouncer
|
||||
PGBOUNCER_GROUP?= pgbouncer
|
||||
|
||||
@ -46,14 +44,12 @@ PGBOUNCER_LOGDIR?= /var/log/pgbouncer
|
||||
|
||||
BUILD_DEPENDS+= ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed
|
||||
|
||||
NO_STAGE= yes
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
SUB_LIST+= PGBOUNCER_USER="${USERS}" \
|
||||
PGBOUNCER_GROUP="${GROUPS}" \
|
||||
PGBOUNCER_LOGDIR="${PGBOUNCER_LOGDIR}" \
|
||||
PGBOUNCER_RUNDIR="${PGBOUNCER_RUNDIR}" \
|
||||
CHMOD="${CHMOD}" CHOWN="${CHOWN}" MKDIR="${MKDIR}" PW="${PW}"
|
||||
PGBOUNCER_RUNDIR="${PGBOUNCER_RUNDIR}"
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e "s|= pgbouncer.log|= ${PGBOUNCER_LOGDIR}/pgbouncer.log|g" \
|
||||
@ -62,20 +58,17 @@ post-patch:
|
||||
@${REINPLACE_CMD} -e "s|sed -n|${LOCALBASE}/bin/gsed -n|g" \
|
||||
${WRKSRC}/lib/find_modules.sh
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/pgbouncer ${PREFIX}/bin/
|
||||
.if ! defined(NO_INSTALL_MANPAGES)
|
||||
${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.1 ${PREFIX}/man/man1/
|
||||
${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.5 ${PREFIX}/man/man5/
|
||||
.if empty(PORT_OPTIONS:MDOCS)
|
||||
${REINPLACE_CMD} -e "s| = doc| = |g" ${WRKSRC}/Makefile
|
||||
.endif
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/pgbouncer.ini ${PREFIX}/etc/pgbouncer.ini.sample
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/userlist.txt ${PREFIX}/etc/pgbouncer.users.sample
|
||||
|
||||
post-install:
|
||||
@if [ ! -f ${PREFIX}/etc/pgbouncer.ini ]; then \
|
||||
${CP} -p ${PREFIX}/etc/pgbouncer.ini.sample ${PREFIX}/etc/pgbouncer.ini ; \
|
||||
fi
|
||||
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/pgbouncer ${STAGEDIR}${PREFIX}/bin/
|
||||
.if ${PORT_OPTIONS:MDOCS}
|
||||
${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.1 ${STAGEDIR}${PREFIX}/man/man1/
|
||||
${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.5 ${STAGEDIR}${PREFIX}/man/man5/
|
||||
.endif
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/pgbouncer.ini ${STAGEDIR}${PREFIX}/etc/pgbouncer.ini.sample
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/userlist.txt ${STAGEDIR}${PREFIX}/etc/pgbouncer.users.sample
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
@ -1,21 +0,0 @@
|
||||
#! /bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
if [ "$2" != "POST-DEINSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pgbouncer_user=%%PGBOUNCER_USER%%
|
||||
pgbouncer_group=%%PGBOUNCER_GROUP%%
|
||||
|
||||
PGBOUNCER_RUNDIR=%%PGBOUNCER_RUNDIR%%
|
||||
PGBOUNCER_LOGDIR=%%PGBOUNCER_LOGDIR%%
|
||||
|
||||
PW="%%PW%%"
|
||||
|
||||
for DIR in ${PGBOUNCER_RUNDIR} ${PGBOUNCER_LOGDIR}; do
|
||||
if test -d "${DIR}"; then
|
||||
echo "==> You should manually remove the directory: ${DIR}"
|
||||
fi
|
||||
done
|
||||
exit 0
|
@ -1,26 +0,0 @@
|
||||
#! /bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
if [ "$2" != "POST-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pgbouncer_user="%%PGBOUNCER_USER%%"
|
||||
pgbouncer_group="%%PGBOUNCER_GROUP%%"
|
||||
|
||||
PGBOUNCER_RUNDIR="%%PGBOUNCER_RUNDIR%%"
|
||||
PGBOUNCER_LOGDIR="%%PGBOUNCER_LOGDIR%%"
|
||||
|
||||
CHMOD="%%CHMOD%%"
|
||||
CHOWN="%%CHOWN%%"
|
||||
MKDIR="%%MKDIR%%"
|
||||
PW=%%PW%%
|
||||
|
||||
for DIR in ${PGBOUNCER_RUNDIR} ${PGBOUNCER_LOGDIR}; do
|
||||
echo "==> Creating directory ${DIR}"
|
||||
${MKDIR} ${DIR}
|
||||
echo "==> Changing ownership of ${DIR}"
|
||||
${CHOWN} -R ${pgbouncer_user}:${pgbouncer_group} ${DIR}
|
||||
echo "==> Changing permissions of ${DIR}"
|
||||
${CHMOD} -R 770 ${DIR}
|
||||
done
|
@ -1,5 +1,11 @@
|
||||
bin/pgbouncer
|
||||
@unexec if cmp -s %D/etc/pgbouncer.ini %D/etc/pgbouncer.ini.sample; then rm -f %D/etc/pgbouncer.ini; fi
|
||||
etc/pgbouncer.ini.sample
|
||||
@exec [ -f %B/pgbouncer.ini ] || cp %B/%f %B/pgbouncer.ini
|
||||
etc/pgbouncer.users.sample
|
||||
man/man1/pgbouncer.1.gz
|
||||
man/man5/pgbouncer.5.gz
|
||||
@sample etc/pgbouncer.ini.sample
|
||||
@sample etc/pgbouncer.users.sample
|
||||
@exec [ -d %%PGBOUNCER_LOGDIR%% ] || mkdir -p %%PGBOUNCER_LOGDIR%%
|
||||
@exec chown %%PGBOUNCER_USER%%:%%PGBOUNCER_GROUP%% %%PGBOUNCER_LOGDIR%%
|
||||
@unexec if [ -z ${UPGRADE_PORT} ] ; then rmdir %%PGBOUNCER_LOGDIR%% 2>/dev/null; fi
|
||||
@exec [ -d %%PGBOUNCER_RUNDIR%% ] || mkdir -p %%PGBOUNCER_RUNDIR%%
|
||||
@exec chown %%PGBOUNCER_USER%%:%%PGBOUNCER_GROUP%% %%PGBOUNCER_RUNDIR%%
|
||||
@unexec if [ -z ${UPGRADE_PORT} ] ; then rmdir %%PGBOUNCER_RUNDIR%% 2>/dev/null; fi
|
||||
|
Loading…
Reference in New Issue
Block a user