Bug 189787 - [maintainer] [patch] databases/pgbouncer: support stage
Summary: [maintainer] [patch] databases/pgbouncer: support stage
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-13 23:30 UTC by m.tsatsenko
Modified: 2014-06-08 23:54 UTC (History)
0 users

See Also:


Attachments
file.diff (2.16 KB, patch)
2014-05-13 23:30 UTC, m.tsatsenko
no flags Details | Diff
pgbouncer-1.5.4.patch (7.06 KB, patch)
2014-05-22 23:57 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description m.tsatsenko 2014-05-13 23:30:00 UTC
- Add STAGE support
- Depend on xmlto to generate man pages. Add DOCS option

Build log: https://redports.org/~mtsatsenko/20140512100032-55108-205965/pgbouncer-1.5.4_1.log

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer 2014-05-13 23:30:04 UTC
Class Changed
From-To: change-request->maintainer-update

Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer 2014-05-13 23:30:06 UTC
Responsible Changed
From-To: freebsd-ports-bugs->swills

swills@ wants this submitter's PRs (via the GNATS Auto Assign Tool)
Comment 3 Steve Wills freebsd_committer 2014-05-22 23:57:25 UTC
Description:
Additional stage changes were needed, see updated diff for maintainer approval. Thanks!

Responsible committer (m.tsatsenko@gmail.com; swills@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 1.02 (mode: change, diff: SVN)
Comment 4 m.tsatsenko 2014-05-24 20:26:32 UTC
Approved!
Thanks for your work!

-- 
Mikhail
Comment 5 dfilter service freebsd_committer 2014-05-25 13:23:04 UTC
Author: swills
Date: Sun May 25 12:23:00 2014
New Revision: 355161
URL: http://svnweb.freebsd.org/changeset/ports/355161
QAT: https://qat.redports.org/buildarchive/r355161/

Log:
  - 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)

Deleted:
  head/databases/pgbouncer/files/pkg-deinstall.in
  head/databases/pgbouncer/files/pkg-install.in
Modified:
  head/databases/pgbouncer/Makefile
  head/databases/pgbouncer/pkg-plist

Modified: head/databases/pgbouncer/Makefile
==============================================================================
--- head/databases/pgbouncer/Makefile	Sun May 25 12:20:49 2014	(r355160)
+++ head/databases/pgbouncer/Makefile	Sun May 25 12:23:00 2014	(r355161)
@@ -10,34 +10,32 @@ MASTER_SITES=	http://pgfoundry.org/frs/d
 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>

Modified: head/databases/pgbouncer/pkg-plist
==============================================================================
--- head/databases/pgbouncer/pkg-plist	Sun May 25 12:20:49 2014	(r355160)
+++ head/databases/pgbouncer/pkg-plist	Sun May 25 12:23:00 2014	(r355161)
@@ -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
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Steve Wills freebsd_committer 2014-05-25 13:24:41 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 7 m.tsatsenko 2014-06-08 09:40:11 UTC
Looks like there is a typo in following line:
SUB_LIST+=      PGBOUNCER_USER="${USERS}"
Apparently it should be
PLIST_SUB+=      PGBOUNCER_USER="${USERS}"
Comment 8 commit-hook freebsd_committer 2014-06-08 23:54:00 UTC
A commit references this bug:

Author: swills
Date: Sun Jun  8 23:53:00 UTC 2014
New revision: 357079
URL: http://svnweb.freebsd.org/changeset/ports/357079

Log:
  - Fix minor issue from previous commit by changing from SUB_LIST to PLIST_SUB

  PR:		189787
  Reported by:	Mikhail Tatsenko <m.tsatsenko@gmail.com> (maintainer)
  Pointyhat to:	swills

Changes:
  head/databases/pgbouncer/Makefile
Comment 9 Steve Wills freebsd_committer 2014-06-08 23:54:22 UTC
Fixed!