Bug 112735 - devel/pear - Enabling bsd.pear.mk to handle channels
Summary: devel/pear - Enabling bsd.pear.mk to handle channels
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: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-17 14:10 UTC by Gerrit Beine
Modified: 2007-08-05 23:51 UTC (History)
0 users

See Also:


Attachments
file.diff (331 bytes, patch)
2007-05-17 14:10 UTC, Gerrit Beine
no flags Details | Diff
file.diff (192 bytes, patch)
2007-05-17 14:10 UTC, Gerrit Beine
no flags Details | Diff
pear.patch (1.99 KB, patch)
2007-05-17 19:12 UTC, Gerrit Beine
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerrit Beine 2007-05-17 14:10:03 UTC
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 @@
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-05-17 14:27:55 UTC
Class Changed
From-To: maintainer-update->change-request

Fix category (submitter is not maintainer)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2007-05-17 14:28:02 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer
Comment 3 Gerrit Beine 2007-05-17 19:12:17 UTC
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...
Comment 4 Pav Lucistnik freebsd_committer freebsd_triage 2007-06-15 14:07:17 UTC
>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.
Comment 5 Alex Dupre freebsd_committer freebsd_triage 2007-07-02 13:53:39 UTC
Responsible Changed
From-To: ale->miwi

Assign to the new pear maintainer.
Comment 6 Martin Wilke freebsd_committer freebsd_triage 2007-08-05 23:51:23 UTC
State Changed
From-To: open->closed

Add to my todo for rewrite the bsd.pear.mk. Thanks for your submission.