ports/112735: Enabling bsd.pear.mk to handle channels

Gerrit Beine gerrit.beine at gmx.de
Thu May 17 13:10:12 UTC 2007


>Number:         112735
>Category:       ports
>Synopsis:       Enabling bsd.pear.mk to handle channels
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 17 13:10:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Gerrit Beine
>Release:        FreeBSD 6.1-RELEASE
>Organization:
>Environment:
FreeBSD fbsd61.localdomain 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:32:43 UTC 2006     root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
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.
>How-To-Repeat:

>Fix:
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 @@

 # 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
diff -Nur /usr/ports/devel/pear/pear-deinstall pear/pear-deinstall
--- /usr/ports/devel/pear/pear-deinstall	Fri Dec  9 19:58:03 2005
+++ pear/pear-deinstall	Thu May 17 14:22:57 2007
@@ -8,8 +8,14 @@
     exit
 fi
 PKG_NAME=${1%%-[0-9._]*}
-PACKAGE=$(echo $PKG_NAME | sed 's/pear-//')
+CHANNEL=$(echo $PKG_NAME | sed 's/_pear-.*//')

 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
diff -Nur /usr/ports/devel/pear/pear-install pear/pear-install
--- /usr/ports/devel/pear/pear-install	Fri Dec  9 19:58:03 2005
+++ pear/pear-install	Thu May 17 13:54:39 2007
@@ -10,5 +10,10 @@

 [ "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

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list