1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-31 05:41:08 +00:00

Respect user modifications in ${PREFIX}/etc/pear.conf

Change default directory paths in PEAR/Config.php
Bump PORTREVISION

Feature safe:	yes
Approved by:	miwi (maintainer, private chat)
This commit is contained in:
Martin Matuska 2011-11-15 10:25:13 +00:00
parent 21a9a3af8a
commit cf6826922c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=285844
4 changed files with 71 additions and 15 deletions

View File

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

View File

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

View File

@ -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 {
@@ -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", '');
}
-}
-
+$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';
}

View File

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