This patch enables devel/pear to handle the PEAR channels. It also offers the possibility to define a MASTER_SITES in a pear-port. The channel can be defined via the variable CHANNEL within the makefile of the port. It will be added and removed automatically. This patch is required to update the pear-PHPUnit port and for the upcoming PHPUnit3 port. Fix: # Common code for pear- ports. +.if !defined(MASTER_SITES) MASTER_SITES= http://pear.php.net/get/ +.endif +.if defined(CHANNEL) +PKGNAMEPREFIX= ${CHANNEL}_pear- +.else PKGNAMEPREFIX= pear- +.endif EXTRACT_SUFX= .tgz DIST_SUBDIR= PEAR @@ -232,5 +238,10 @@ post-install: @${MKDIR} ${PKGREGDIR} @${INSTALL_DATA} ${WRKDIR}/package.xml ${PKGREGDIR} +.if defined(CHANNEL) + @${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL ${CHANNEL} +.else @${SETENV} PKG_PREFIX=${PREFIX} \ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif \ No newline at end of file PEAR=${PKG_PREFIX}/bin/pear - -${PEAR} uninstall -r -n ${PACKAGE} || true +if [ -n ${CHANNEL} ]; then + PACKAGE=$(echo $PKG_NAME | sed "s/${CHANNEL}_pear-//") + ${PEAR} uninstall -r -n ${CHANNEL}/${PACKAGE} || true + ${PEAR} channel-delete ${CHANNEL} || true +else + PACKAGE=$(echo $PKG_NAME | sed 's/pear-//') + ${PEAR} uninstall -r -n ${PACKAGE} || true +fi \ No newline at end of file [ "x$1" = "x" ] && exit 1 if [ "x$2" = "xPOST-INSTALL" ]; then - ${PEAR} install -r -n -f ${PKGREGDIR}/package.xml + if [ -n $3 ]; then + ${PEAR} channel-discover $3 || true + ${PEAR} install -r -n -f ${PKGREGDIR}/package.xml + else + ${PEAR} install -r -n -f ${PKGREGDIR}/package.xml + fi fi--QVvoNmFFUlGog9Ep1KKyRnolVBJv8GhE9TVKdGdhCgG7fZei Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" diff -Nur /usr/ports/devel/pear/bsd.pear.mk pear/bsd.pear.mk --- /usr/ports/devel/pear/bsd.pear.mk Thu May 4 23:40:59 2006 +++ pear/bsd.pear.mk Thu May 17 14:26:06 2007 @@ -2,8 +2,14 @@
Class Changed From-To: maintainer-update->change-request Fix category (submitter is not maintainer)
Responsible Changed From-To: freebsd-ports-bugs->ale Over to maintainer
Am Donnerstag, 17. Mai 2007 15:10 schrieb FreeBSD-gnats-submit@freebsd.org: > Thank you very much for your problem report. > It has the internal identification `ports/112735'. > The individual assigned to look at your > report is: freebsd-ports-bugs. > Because there were two mistakes, here is a newer version of the patch. Sorry...
>From private conversation, for the record: From: Alex Dupre <ale@FreeBSD.org> Date: Mon, 11 Jun 2007 09:21:35 +0200 I looked at it, but I'm not satisfied with the patch. Apart from Makefile coding I mainly don't like the addition of CHANNEL into PKGNAMEPREFIX. I understand it is an easy way to pass CHANNEL into pkg-install script, but IMO it's not the correct way. If you come up with a cleaner/better solution I will be glad to commit it. From: Gerrit Beine <gerrit.beine@gmx.de> Date: Mon, 11 Jun 2007 11:13:13 +0200 My solution would be to create a separate meta-port for each pear channel using the functionality of devel/pear and make the ports depending on this channel-ports. So, the devel/pear would not be touched in any way. There would be a port devel/pear-channel-phpunit and the devel/pear-phpunit* ports. The only thing is, that the channel would not be removed automatically when the phpunit-port would be uninstalled. But I think this would be ok. -- Pav Lucistnik <pav@oook.cz> <pav@FreeBSD.org> I cannot be responsible for future messages as apparently my cats have learned to type.
Responsible Changed From-To: ale->miwi Assign to the new pear maintainer.
State Changed From-To: open->closed Add to my todo for rewrite the bsd.pear.mk. Thanks for your submission.