1 # Created by: Sergey Skvortsov <skv@protey.ru>
8 MASTER_SITES= https://pgbouncer.github.io/downloads/files/${PORTVERSION}/ \
9 http://pgbouncer.github.io/downloads/files/${PORTVERSION}/
11 MAINTAINER= m.tsatsenko@gmail.com
12 COMMENT= Lightweight connection pooler for PostgreSQL
16 LIB_DEPENDS= libevent.so:devel/libevent
17 BUILD_DEPENDS+= ${LOCALBASE}/bin/gsed:textproc/gsed
19 USES= gmake ssl pkgconfig
21 PORTSCOUT= site:https://pgbouncer.github.io/downloads/
26 USE_RC_SUBR= pgbouncer
30 CARES_LIB_DEPENDS= libcares.so:dns/c-ares
31 CARES_CONFIGURE_WITH= cares
33 CONFIGURE_ARGS= --with-libevent=${LOCALBASE} --enable-evdns
34 CONFIGURE_ENV+= PTHREAD_LIBS="-lpthread"
36 PGBOUNCER_USER?= pgbouncer
37 PGBOUNCER_GROUP?= pgbouncer
39 PGBOUNCER_RUNDIR?= /var/run/pgbouncer
40 PGBOUNCER_LOGDIR?= /var/log/pgbouncer
42 PLIST_SUB+= PGBOUNCER_USER="${USERS}" \
43 PGBOUNCER_GROUP="${GROUPS}" \
44 PGBOUNCER_LOGDIR="${PGBOUNCER_LOGDIR}" \
45 PGBOUNCER_RUNDIR="${PGBOUNCER_RUNDIR}"
46 SUB_LIST+= PGBOUNCER_RUNDIR="${PGBOUNCER_RUNDIR}"
49 @${REINPLACE_CMD} -e "s|= pgbouncer.log|= ${PGBOUNCER_LOGDIR}/pgbouncer.log|g" \
50 -e "s|= pgbouncer.pid|= ${PGBOUNCER_RUNDIR}/pgbouncer.pid|g" \
51 ${WRKSRC}/etc/pgbouncer.ini
52 @${REINPLACE_CMD} -e "s|sed -n|${LOCALBASE}/bin/gsed -n|g" \
53 ${WRKSRC}/lib/find_modules.sh
56 ${INSTALL_PROGRAM} ${WRKSRC}/pgbouncer ${STAGEDIR}${PREFIX}/bin/
57 ${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.1 ${STAGEDIR}${PREFIX}/man/man1/
58 ${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.5 ${STAGEDIR}${PREFIX}/man/man5/
59 ${INSTALL_DATA} ${WRKSRC}/etc/pgbouncer.ini \
60 ${STAGEDIR}${PREFIX}/etc/pgbouncer.ini.sample
61 ${INSTALL_DATA} ${WRKSRC}/etc/userlist.txt \
62 ${STAGEDIR}${PREFIX}/etc/pgbouncer.users.sample
63 @${MKDIR} ${STAGEDIR}${PGBOUNCER_RUNDIR} \
64 ${STAGEDIR}${PGBOUNCER_LOGDIR}
66 .include <bsd.port.mk>