aboutsummaryrefslogtreecommitdiff
path: root/devel/pear
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2011-11-15 10:25:13 +0000
committerMartin Matuska <mm@FreeBSD.org>2011-11-15 10:25:13 +0000
commitcf6826922c0260acdd566ed0132da742a9f4fa99 (patch)
treedae24a4c5a059d12ad355a80ba138e41d6f7394c /devel/pear
parent21a9a3af8aac035d639f22e20609cce40f85280c (diff)
downloadports-cf6826922c0260acdd566ed0132da742a9f4fa99.tar.gz
ports-cf6826922c0260acdd566ed0132da742a9f4fa99.zip
Notes
Diffstat (limited to 'devel/pear')
-rw-r--r--devel/pear/Makefile13
-rw-r--r--devel/pear/files/extra-patch-PEAR-Config.php38
-rw-r--r--devel/pear/files/patch-go-pear31
-rw-r--r--devel/pear/pkg-plist4
4 files changed, 71 insertions, 15 deletions
diff --git a/devel/pear/Makefile b/devel/pear/Makefile
index 8f2a6dc8c288..f196eab78ff1 100644
--- a/devel/pear/Makefile
+++ b/devel/pear/Makefile
@@ -7,6 +7,7 @@
PORTNAME= pear
PORTVERSION= 1.9.4
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://bsdcrew.de/distfiles/
@@ -24,12 +25,22 @@ PEARDIR= ${PREFIX}/share/pear
post-patch:
@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" \
-e "s|%%BUNDLEDIR%%|${WRKSRC}/go-pear-bundle|" \
- -e "s|%%TMPDIR%%|${TMPDIR}/go-pear|" \
+ -e "s|%%TMPDIR%%|/tmp/pear|" \
${WRKSRC}/go-pear
+ @cd ${WRKSRC}/go-pear-bundle && ${MKDIR} tmp && ${TAR} -C tmp -xf PEAR-${PORTVERSION}.tar
+ @cd ${WRKSRC}/go-pear-bundle/tmp/PEAR-${PORTVERSION} && ${PATCH} -s -p0 < ${FILESDIR}/extra-patch-PEAR-Config.php
+ @rm ${WRKSRC}/go-pear-bundle/tmp/PEAR-${PORTVERSION}/PEAR/Config.php.orig
+ @${MD5} -q ${WRKSRC}/go-pear-bundle/tmp/PEAR-${PORTVERSION}/PEAR/Config.php > ${WRKSRC}/Config.php.md5
+ @${REINPLACE_CMD} -E -e "s|(file md5sum=\").*(\" name=\"PEAR/Config.php\" role=\"php\")|\1`${CAT} ${WRKSRC}/Config.php.md5`\2|g" \
+ ${WRKSRC}/go-pear-bundle/tmp/package2.xml ${WRKSRC}/go-pear-bundle/package2.xml
+ @cd ${WRKSRC}/go-pear-bundle/tmp && ${TAR} -cf ../PEAR-${PORTVERSION}.tar package2.xml PEAR-${PORTVERSION} package.xml
do-install:
@cd ${WRKSRC} && ${LOCALBASE}/bin/php -q ./go-pear
@${SED} -i "" "s|<?php|<?php dl('pcre.so'); dl('xml.so');|" \
${PEARDIR}/peclcmd.php
+post-install:
+ @${CP} -n ${PREFIX}/etc/pear.conf.sample ${PREFIX}/etc/pear.conf
+
.include <bsd.port.mk>
diff --git a/devel/pear/files/extra-patch-PEAR-Config.php b/devel/pear/files/extra-patch-PEAR-Config.php
new file mode 100644
index 000000000000..a99f69e4d74c
--- /dev/null
+++ b/devel/pear/files/extra-patch-PEAR-Config.php
@@ -0,0 +1,38 @@
+--- PEAR/Config.php.orig 2011-11-15 10:23:32.384650640 +0100
++++ PEAR/Config.php 2011-11-15 10:23:35.145650207 +0100
+@@ -29,7 +29,7 @@
+ */
+ $GLOBALS['_PEAR_Config_instance'] = null;
+ if (!defined('PEAR_INSTALL_DIR') || !PEAR_INSTALL_DIR) {
+- $PEAR_INSTALL_DIR = PHP_LIBDIR . DIRECTORY_SEPARATOR . 'pear';
++ $PEAR_INSTALL_DIR = PHP_PREFIX . DIRECTORY_SEPARATOR . 'share' . DIRECTORY_SEPARATOR . 'pear';
+ } else {
+ $PEAR_INSTALL_DIR = PEAR_INSTALL_DIR;
+ }
+@@ -108,7 +108,7 @@
+ define('PEAR_CONFIG_DEFAULT_DOC_DIR', getenv('PHP_PEAR_DOC_DIR'));
+ } else {
+ define('PEAR_CONFIG_DEFAULT_DOC_DIR',
+- $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'docs');
++ PHP_PREFIX.DIRECTORY_SEPARATOR.'share'.DIRECTORY_SEPARATOR.'doc'.DIRECTORY_SEPARATOR.'pear');
+ }
+
+ // Default for bin_dir
+@@ -131,7 +131,7 @@
+ define('PEAR_CONFIG_DEFAULT_CFG_DIR', getenv('PHP_PEAR_CFG_DIR'));
+ } else {
+ define('PEAR_CONFIG_DEFAULT_CFG_DIR',
+- $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'cfg');
++ PHP_PREFIX.DIRECTORY_SEPARATOR.'etc'.DIRECTORY_SEPARATOR.'pear');
+ }
+
+ // Default for www_dir
+@@ -139,7 +139,7 @@
+ define('PEAR_CONFIG_DEFAULT_WWW_DIR', getenv('PHP_PEAR_WWW_DIR'));
+ } else {
+ define('PEAR_CONFIG_DEFAULT_WWW_DIR',
+- $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'www');
++ PHP_PREFIX.DIRECTORY_SEPARATOR.'www');
+ }
+
+ // Default for test_dir
diff --git a/devel/pear/files/patch-go-pear b/devel/pear/files/patch-go-pear
index 3e33a11a2e8c..2374134075e0 100644
--- a/devel/pear/files/patch-go-pear
+++ b/devel/pear/files/patch-go-pear
@@ -1,5 +1,5 @@
---- go-pear.orig 2010-08-05 23:26:55.000000000 +0200
-+++ go-pear 2010-08-13 15:05:29.753811744 +0200
+--- go-pear.orig 2011-11-06 20:54:16.000000000 +0100
++++ go-pear 2011-11-15 08:46:12.988647172 +0100
@@ -116,7 +116,7 @@
);
@@ -110,16 +110,21 @@
}
include_once 'PEAR.php';
print "ok\n";
-@@ -750,7 +751,7 @@
- if (WEBINSTALLER || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local') {
- $config = &PEAR_Config::singleton($prefix."/pear.conf", '');
- } else {
-- $config = &PEAR_Config::singleton();
-+ $config = &PEAR_Config::singleton($prefix."/etc/pear.conf", '');
- }
+@@ -747,12 +748,7 @@
+ include_once "PEAR/Command.php";
+ include_once "PEAR/Registry.php";
+-if (WEBINSTALLER || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local') {
+- $config = &PEAR_Config::singleton($prefix."/pear.conf", '');
+-} else {
+- $config = &PEAR_Config::singleton();
+-}
+-
++$config = &PEAR_Config::singleton($prefix."/etc/pear.conf.sample", '');
-@@ -821,7 +822,7 @@
+ $config->set('preferred_state', 'stable');
+ foreach ($config_vars as $var) {
+@@ -821,7 +817,7 @@
// Base installation finished
@@ -128,7 +133,7 @@
ini_restore("include_path");
if (!WEBINSTALLER) {
-@@ -980,6 +981,7 @@
+@@ -980,6 +976,7 @@
if (WINDOWS && !WEBINSTALLER) {
win32CreateRegEnv();
}
@@ -136,7 +141,7 @@
// Set of functions following
/**
* Parse the given dirname
-@@ -1418,19 +1420,17 @@
+@@ -1418,19 +1415,17 @@
}
} else {
if ($_prefix === null) {
@@ -161,7 +166,7 @@
// check if the user has installed PHP with PHP or GNU layout
if (@is_dir("$prefix/lib/php/.registry")) {
$php_dir = '$prefix/lib/php';
-@@ -1442,6 +1442,7 @@
+@@ -1442,6 +1437,7 @@
} elseif (@is_dir("$prefix/share/php/.registry")) {
$php_dir = '$prefix/share/php';
}
diff --git a/devel/pear/pkg-plist b/devel/pear/pkg-plist
index 2d493a9b2bbd..c61db06413e4 100644
--- a/devel/pear/pkg-plist
+++ b/devel/pear/pkg-plist
@@ -1,7 +1,9 @@
bin/pear
bin/peardev
bin/pecl
-etc/pear.conf
+@unexec if cmp -s %D/etc/pear.conf %D/etc/pear.conf.sample; then rm -f %D/etc/pear.conf; fi
+etc/pear.conf.sample
+@exec [ -f %B/pear.conf ] || cp %B/%f %B/pear.conf
%%DOCSDIR%%/Archive_Tar/docs/Archive_Tar.txt
%%DOCSDIR%%/PEAR/INSTALL
%%DOCSDIR%%/PEAR/LICENSE