Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2004 21:00:24 +0200
From:      Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/68944: [MAINTAINER] games/pcgen: dynamic plist and various improvements
Message-ID:  <20040713190024.GA92965@arabica.esil.univ-mrs.fr>
In-Reply-To: <200407121210.i6CCAOWp004181@freefall.freebsd.org>
References:  <200407121201.i6CC16MS099330@arabica.esil.univ-mrs.fr> <200407121210.i6CCAOWp004181@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

With the initial patch, there are chances that user data could get added
to the plist while upgrading the port. Use the attached patch instead.
It builds the plist according to files present in ${WRKSRC} rather than
${DATADIR}.


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mypatch.diff"

--- Makefile.orig	Mon Jul 12 13:18:49 2004
+++ Makefile	Tue Jul 13 20:56:24 2004
@@ -15,18 +15,14 @@
 COMMENT=	A Java-based RPG character generator and maintenance program
 
 USE_ZIP=	YES
-EXTRACT_AFTER_ARGS=	-d pcgen
+NO_WRKSUBDIR=	YES
 USE_JAVA=	YES
 JAVA_VERSION=	1.4+
 NO_BUILD=	YES
 
-WRKSRC=		${WRKDIR}/pcgen
 DATADIR=	${JAVASHAREDIR}/${PORTNAME}
-WRKDIRS=	characters data lib outputsheets plugins system
-WRKDOCSDIR=	${WRKSRC}/docs
-WRKSCRIPT=	${WRKSRC}/pcgen.bsd.sh
-PLIST_FILES+=	${DATADIR:S,^${PREFIX}/,,}/filepaths.ini bin/pcgen.sh
-PLIST_DIRS+=	${DATADIR:S,^${PREFIX}/,,}
+DATAFILES=	characters data filepaths.ini lib outputsheets pcgen.jar plugins system
+PLIST_FILES+=	bin/pcgen.sh ${DATADIR:S,^${PREFIX}/,,}/pcgen.sh
 
 .if !defined(NOPORTDOCS)
 PORTDOCS=	acknowledgments faqpages gmgen greetings.html index.html \
@@ -35,35 +31,32 @@
 		pcgen.css systemimages tabpages walkthroughpages
 .endif
 
-pre-extract:
-	@${MKDIR} ${WRKSRC}
-
 post-extract:
 	@${FIND} ${WRKSRC} -name CVS | ${XARGS} -t ${RM} -rf
 
+do-configure:
+	@${ECHO_MSG} "pcgen.filepaths=user" > ${WRKSRC}/filepaths.ini
+	@cd ${WRKSRC} && ${SED} "s|^java|${JAVA}|" pcgen.sh | ${SED} 's|`dirname $$0`|${DATADIR}|' > pcgen.sh.bsd
+
 do-install:
 	@${ECHO_MSG} -n ">> Installing in ${DATADIR}..."
-.for SOMEDIR in ${WRKDIRS}
-	@${ECHO_MSG} -n " ${SOMEDIR}"
-	@cd ${WRKSRC} && ${FIND} ${SOMEDIR} -type d -exec ${MKDIR} ${DATADIR}/{} ";"
-	@cd ${WRKSRC} && ${FIND} ${SOMEDIR} -type f -exec ${INSTALL_DATA} {} ${DATADIR}/{} ";"
-.endfor
-	@${ECHO_MSG} -n " pcgen.jar"
-	@cd ${WRKSRC} && ${INSTALL_DATA} pcgen.jar ${DATADIR}
-	@${ECHO_MSG} -n " pcgen.sh"
-	@cd ${WRKSRC} && ${SED} "s|^java|${JAVA}|" pcgen.sh | ${SED} 's|`dirname $$0`|${DATADIR}|' > ${WRKSCRIPT}
-	@cd ${WRKSRC} && ${INSTALL_SCRIPT} ${WRKSCRIPT} ${DATADIR}/pcgen.sh
+	@cd ${WRKSRC} && ${FIND} ${DATAFILES} -type d -exec ${MKDIR} ${DATADIR}/{} ";"
+	@cd ${WRKSRC} && ${FIND} ${DATAFILES} -type f -exec ${INSTALL_DATA} {} ${DATADIR}/{} ";"
+	@cd ${WRKSRC} && ${INSTALL_SCRIPT} pcgen.sh.bsd ${DATADIR}/pcgen.sh
+	@${ECHO_MSG} " [ DONE ]"
 	@${LN} -fs ${DATADIR}/pcgen.sh ${PREFIX}/bin/pcgen.sh
-	@${ECHO_MSG} " [DONE]"
-	@${ECHO_MSG} -n ">> Configuring..."
-	@${ECHO_MSG} "pcgen.filepaths=user" > ${DATADIR}/filepaths.ini
-	@${ECHO_MSG} " [DONE]"
-
 .if !defined(NOPORTDOCS)
 	@${ECHO_MSG} -n ">> Installing documentation in ${DOCSDIR}..."
-	@cd ${WRKDOCSDIR} && ${FIND} . -type d -exec ${MKDIR} ${DOCSDIR}/{} ";"
-	@cd ${WRKDOCSDIR} && ${FIND} . -type f -exec ${INSTALL_DATA} {} ${DOCSDIR}/{} ";"
-	@${ECHO_MSG} " [DONE]"
+	@cd ${WRKSRC}/docs && ${FIND} . -type d -exec ${MKDIR} ${DOCSDIR}/{} ";"
+	@cd ${WRKSRC}/docs && ${FIND} . -type f -exec ${INSTALL_DATA} {} ${DOCSDIR}/{} ";"
+	@${ECHO_MSG} " [ DONE ]"
 .endif
+
+post-install:
+	@${FIND} -s ${DATAFILES:S,^,${WRKSRC}/,} -not -type d 2>/dev/null | \
+		${SED} -ne 's,^${WRKSRC},${DATADIR:S,^${PREFIX}/,,},p' >> ${TMPPLIST}
+	@${FIND} -s -d ${DATAFILES:S,^,${WRKSRC}/,} -type d 2>/dev/null | \
+		${SED} -ne 's,^${WRKSRC},@dirrm ${DATADIR:S,^${PREFIX}/,,},p' >> ${TMPPLIST}
+	@${ECHO_CMD} '@dirrm ${DATADIR:S,^${PREFIX}/,,}' >> ${TMPPLIST}
 
 .include <bsd.port.mk>

--sm4nu43k4a2Rpi4c--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040713190024.GA92965>