diff --git a/Mk/Uses/pear.mk b/Mk/Uses/pear.mk index d18d2b20e9ab..0496dded11b9 100644 --- a/Mk/Uses/pear.mk +++ b/Mk/Uses/pear.mk @@ -1,192 +1,192 @@ # Use the PHP Extension and Application Repository # # Feature: pear # Usage: USES=pear # Valid ARGS: env # # - env : Only provide the environment variables, no fetch/build/install # targets. # # MAINTAINER= ports@FreeBSD.org .if !defined(_INCLUDE_USES_PEAR_MK) _INCLUDE_USES_PEAR_MK= yes _USES_POST+= pear _valid_pear_ARGS= env # Sanity check . for arg in ${pear_ARGS} . if empty(_valid_pear_ARGS:M${arg}) IGNORE= Incorrect 'USES+= pear:${pear_ARGS}' usage: argument [${arg}] is not recognized . endif . endfor -_pear_IGNORE_WITH_PHP= 82 +_pear_IGNORE_WITH_PHP= IGNORE_WITH_PHP?= ${_pear_IGNORE_WITH_PHP} php_ARGS+= flavors .include "${USESDIR}/php.mk" # Mark the port ignored if it wants pear for an unsupported flavor . if ${_pear_IGNORE_WITH_PHP:tw:S/^/php/:M${PHP_FLAVOR}} IGNORE= devel/pear does not support flavor ${PHP_FLAVOR} _pear_INVALID= yes . endif . if !defined(_pear_INVALID) . if empty(pear_ARGS:Menv) MASTER_SITES?= http://pear.php.net/get/ EXTRACT_SUFX?= .tgz DIST_SUBDIR?= PEAR WWW?= https://pear.php.net/package/${PORTNAME}/ . if empty(php_ARGS:Mphpize) NO_BUILD= yes . endif . endif BUILD_DEPENDS+= pear:devel/pear@${PHP_FLAVOR} RUN_DEPENDS+= pear:devel/pear@${PHP_FLAVOR} PEAR_PKGNAMEPREFIX= php${PHP_VER}-pear- . if defined(PEAR_CHANNEL) && ${PEAR_CHANNEL} != "" PEAR_${PEAR_CHANNEL:tu}_PKGNAMEPREFIX= php${PHP_VER}-pear-${PEAR_CHANNEL}- PKGNAMEPREFIX?= ${PEAR_${PEAR_CHANNEL:tu}_PKGNAMEPREFIX} PEARPKGREF= ${PEAR_CHANNEL}/${PORTNAME} PEAR_CHANNEL_VER?= >=0 BUILD_DEPENDS+= ${PEAR_PKGNAMEPREFIX}channel-${PEAR_CHANNEL}${PEAR_CHANNEL_VER}:devel/pear-channel-${PEAR_CHANNEL}@${PHP_FLAVOR} RUN_DEPENDS+= ${PEAR_PKGNAMEPREFIX}channel-${PEAR_CHANNEL}${PEAR_CHANNEL_VER}:devel/pear-channel-${PEAR_CHANNEL}@${PHP_FLAVOR} . else PKGNAMEPREFIX?= ${PEAR_PKGNAMEPREFIX} PEARPKGREF= ${PORTNAME} . endif . if exists(${LOCALBASE}/bin/php-config) PHP_BASE!= ${LOCALBASE}/bin/php-config --prefix . else PHP_BASE= ${LOCALBASE} . endif PEAR= ${LOCALBASE}/bin/pear LPEARDIR= share/pear LPKGREGDIR= ${LPEARDIR}/packages/${PKGNAME} LDATADIR= ${LPEARDIR}/data/${PORTNAME} LDOCSDIR= share/doc/pear/${PORTNAME} LEXAMPLESDIR= share/examples/pear/${PORTNAME} LSQLSDIR= ${LPEARDIR}/sql/${PORTNAME} LSCRIPTSDIR= bin LTESTSDIR= ${LPEARDIR}/tests/${PORTNAME} PEARDIR= ${PHP_BASE}/${LPEARDIR} PKGREGDIR= ${PHP_BASE}/${LPKGREGDIR} DATADIR= ${PHP_BASE}/${LDATADIR} DOCSDIR= ${PHP_BASE}/${LDOCSDIR} EXAMPLESDIR= ${PHP_BASE}/${LEXAMPLESDIR} SQLSDIR= ${PHP_BASE}/${LSQLSDIR} SCRIPTFILESDIR= ${LOCALBASE}/bin TESTSDIR= ${PHP_BASE}/${LTESTSDIR} . if defined(CATEGORY) && !empty(CATEGORY) LINSTDIR= ${LPEARDIR}/${CATEGORY} . else LINSTDIR= ${LPEARDIR} . endif INSTDIR= ${PHP_BASE}/${LINSTDIR} SUB_LIST+= PKG_NAME=${PEARPKGREF} . if empty(pear_ARGS:Menv) . if empty(php_ARGS:Mphpize) && !exists(${.CURDIR}/pkg-plist) PLIST= ${WRKDIR}/PLIST . endif PKGINSTALL?= ${PORTSDIR}/devel/pear/pear-install PKGDEINSTALL?= ${WRKDIR}/pear-deinstall . endif PLIST_SUB+= PEARDIR=${LPEARDIR} PKGREGDIR=${LPKGREGDIR} \ TESTSDIR=${LTESTSDIR} INSTDIR=${LINSTDIR} SQLSDIR=${LSQLSDIR} \ SCRIPTFILESDIR=${LCRIPTSDIR} . endif # !defined(_pear_INVALID) .endif .if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PEAR_POST_MK) && !defined(_pear_INVALID) _INCLUDE_USES_PEAR_POST_MK= yes . if empty(pear_ARGS:Menv) _USES_install+= 250:pear-pre-install pear-pre-install: . if exists(${LOCALBASE}/lib/php.DIST_PHP) \ || exists(${PHP_BASE}/lib/php.DIST_PHP) \ || exists(${LOCALBASE}/.PEAR.pkg) \ || exists(${PHP_BASE}/.PEAR.pkg) @${ECHO_MSG} "" @${ECHO_MSG} " Sorry, the PEAR structure has been modified;" @${ECHO_MSG} " Please deinstall your installed pear- ports." @${ECHO_MSG} "" @${FALSE} . endif (if [ -f ${WRKSRC}/package.xml ] \ && [ ! -f ${WRKDIR}/package.xml ] ; then \ ${CP} -p ${WRKSRC}/package.xml ${WRKDIR} ; \ fi) DIRFILTER= ${SED} -En '\:^.*/[^/]*$$:s:^(.+)/[^/]*$$:\1:p' \ | ( while read r; do \ C=1; \ while [ $$C = 1 ]; do \ echo $$r; \ if echo $$r | ${GREP} '/' > /dev/null; then \ r=`${DIRNAME} $$r`; \ else \ C=0; \ fi; \ done; \ done \ ) | ${SORT} -ur . if empty(php_ARGS:Mphpize) _USES_install+= 260:do-autogenerate-plist do-autogenerate-plist: @${ECHO_MSG} "===> Generating packing list with pear" @${LN} -sf ${WRKDIR}/package.xml ${WRKSRC}/package.xml @cd ${WRKSRC} && ${PEAR} install -n -f -P ${WRKDIR}/inst package.xml > /dev/null 2> /dev/null . for R in .channels .depdb .depdblock .filemap .lock .registry @${RM} -r ${WRKDIR}/inst/${PREFIX}/${LPEARDIR}/${R} @${RM} -r ${WRKDIR}/inst/${R} . endfor @FILES=`cd ${WRKDIR}/inst && ${FIND} . -type f | ${CUT} -c 2- | \ ${GREP} -v -E "^${PREFIX}/"` || exit 0; \ ${ECHO_CMD} $${FILES}; if ${TEST} -n "$${FILES}"; then \ ${ECHO_CMD} "Cannot generate packing list: package files outside PREFIX"; \ exit 1; fi; @${ECHO_CMD} "${LPKGREGDIR}/package.xml" > ${PLIST} # pkg_install needs to escape $ in directory name while pkg does not @cd ${WRKDIR}/inst/${PREFIX} && ${FIND} . -type f | ${SORT} \ | ${CUT} -c 3- >> ${PLIST} do-install: @cd ${WRKSRC} && ${PEAR} install -n -f -P ${STAGEDIR} package.xml # Clean up orphans re-generated by pear-install . for R in .channels .depdb .depdblock .filemap .lock .registry @${RM} -r ${STAGEDIR}${PREFIX}/${LPEARDIR}/${R} @${RM} -r ${STAGEDIR}/${R} . endfor . endif _USES_install+= 270:do-generate-deinstall-script do-generate-deinstall-script: @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${PORTSDIR}/devel/pear/pear-deinstall.in > ${WRKDIR}/pear-deinstall _USES_install+= 550:pear-post-install pear-post-install: @${MKDIR} ${STAGEDIR}${PKGREGDIR} @${INSTALL_DATA} ${WRKDIR}/package.xml ${STAGEDIR}${PKGREGDIR} show-depends: patch @${PEAR} package-dependencies ${WRKDIR}/package.xml . endif .endif diff --git a/devel/pear/Makefile b/devel/pear/Makefile index ae76c3fc19cd..77eb05998219 100644 --- a/devel/pear/Makefile +++ b/devel/pear/Makefile @@ -1,50 +1,46 @@ PORTNAME= pear -PORTVERSION= 1.10.12 -PORTREVISION= 0 +PORTVERSION= 1.10.13 CATEGORIES= devel MASTER_SITES= http://build.dimapanov.com/~fluffy/distfiles/ \ LOCAL/fluffy \ LOCAL/joneum PKGNAMEPREFIX= ${PHP_PKGNAMEPREFIX} MAINTAINER= fluffy@FreeBSD.org COMMENT= PEAR framework for PHP WWW= https://pear.php.net/ LICENSE= PHP301 USES= cpe php:cli,flavors tar:xz CPE_VENDOR= php NO_BUILD= yes NO_ARCH= yes USE_PHP= pcre:build xml:build zlib:build -IGNORE_WITH_PHP=82 PEARDIR= ${PREFIX}/share/pear OPTIONS_DEFINE= DOCS post-patch: @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" \ -e "s|%%BUNDLEDIR%%|${WRKSRC}/go-pear-bundle|" \ -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 && ${MKDIR} tmp && ${TAR} -C tmp -xzf PEAR-${PORTVERSION}.tgz @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 - @cd ${WRKSRC}/go-pear-bundle/tmp && ${TAR} -cf ../PEAR-${PORTVERSION}.tar PEAR-${PORTVERSION} package.xml + @cd ${WRKSRC}/go-pear-bundle/tmp && ${TAR} -czf ../PEAR-${PORTVERSION}.tgz PEAR-${PORTVERSION} package.xml do-install: @cd ${WRKSRC} && ${SETENV} DESTDIR=${STAGEDIR} ${LOCALBASE}/bin/php -q ./go-pear - @${SED} -i "" "s| diff --git a/devel/pear/distinfo b/devel/pear/distinfo index 75fdbacd64eb..a913c464be17 100644 --- a/devel/pear/distinfo +++ b/devel/pear/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1604325145 -SHA256 (pear-1.10.12.tar.xz) = 99b08268edf40df39455e10ec2a747e7eeb1a341163ecdfe5bd46122cd125fed -SIZE (pear-1.10.12.tar.xz) = 307068 +TIMESTAMP = 1663752211 +SHA256 (pear-1.10.13.tar.xz) = 32932cb1fcd5dbc70fc1f1158b35fb637f5f47552ee2ec24135ac20fd59c6524 +SIZE (pear-1.10.13.tar.xz) = 419999 diff --git a/devel/pear/files/patch-go-pear b/devel/pear/files/patch-go-pear index 9f28e947b1a5..ecf14e03f744 100644 --- a/devel/pear/files/patch-go-pear +++ b/devel/pear/files/patch-go-pear @@ -1,264 +1,275 @@ ---- go-pear.orig 2017-08-03 16:38:00 UTC +--- go-pear.orig 2022-09-21 07:50:47 UTC +++ go-pear -@@ -57,6 +57,8 @@ define('GO_PEAR_VER', '1.1.2'); - - define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript')); +@@ -47,6 +47,8 @@ if (!$safe_mode) { + ob_implicit_flush(true); + define('WEBINSTALLER', ($sapi_name != 'cli' && !(substr($sapi_name,0,3)=='cgi' && !isset($_SERVER['GATEWAY_INTERFACE'])))); +$destdir = getenv('DESTDIR'); + - /* - * See bug #23069 - */ -@@ -116,7 +118,7 @@ $bootstrap_pkgs = array( // uses URL like http://pear. + ini_set('track_errors', true); + ini_set('html_errors', WEBINSTALLER); + ini_set('magic_quotes_runtime', false); +@@ -88,6 +90,7 @@ if (WEBINSTALLER && isset($_GET['action']) && $_GET['a + + // Check if PHP version is sufficient + $phpVersion = phpversion(); ++/* + if (function_exists("version_compare") && version_compare($phpVersion, "4.4",'<')) { + die("Sorry! Your PHP version is too old. PEAR and this script requires at + least PHP 4.4.0 for stable operation. +@@ -109,11 +112,10 @@ version of go-pear, more suited to your PHP version. + Thank you for your coopertion and sorry for the inconvenience! + "); + } +- ++*/ + $gopear_bundle_dir = dirname(__FILE__).'/go-pear-bundle'; + + $bootstrap_files = array( +- 'PEAR5.php' => 'https://raw.github.com/pear/pear-core/master/PEAR5.php', + 'PEAR.php' => 'https://raw.github.com/pear/pear-core/master/PEAR.php', + 'Archive/Tar.php' => 'https://raw.github.com/pear/Archive_Tar/master/Archive/Tar.php', + 'Console/Getopt.php' => 'https://raw.github.com/pear/Console_Getopt/trunk/Console/Getopt.php', +@@ -125,7 +127,7 @@ $bootstrap_pkgs = array( // uses URL like http://pear. ); $installer_packages = array( - 'PEAR', + 'PEAR-stable', 'Structures_Graph-stable', 'Archive_Tar-stable', 'Console_Getopt-stable', -@@ -250,7 +252,7 @@ if (WEBINSTALLER) { +@@ -259,7 +261,7 @@ if (WEBINSTALLER) { } - // Anything past this step has something to do with the installation + // Anything past this step has something to do with the installation } - +/* if (!WEBINSTALLER) { $tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r'); -@@ -294,7 +296,7 @@ If you wish to abort, press Control-C now, or press En +@@ -303,7 +305,7 @@ If you wish to abort, press Control-C now, or press En $http_proxy = $tmp; } } - +*/ $origpwd = getcwd(); $config_vars = array_keys($config_desc); -@@ -345,7 +347,7 @@ we strongly recommand to use it. +@@ -354,7 +356,7 @@ we strongly recommand to use it. break; } } - +/* while (!WEBINSTALLER) { print " Below is a suggested file layout for your new PEAR installation. To -@@ -428,7 +430,7 @@ If you have a CLI (or CGI) php.exe available, we stron +@@ -437,7 +439,7 @@ If you have a CLI (or CGI) php.exe available, we stron } } } - +*/ #### # Installation stuff #### -@@ -488,7 +490,7 @@ full write access to this directory and the install di +@@ -497,7 +499,7 @@ full write access to this directory and the install di continue; } - $dir = $$var; + $dir = ($destdir ? $destdir : '').$$var; if (!@is_dir($dir)) { if (!mkdir_p($dir)) { if (!WEBINSTALLER) { -@@ -561,7 +563,7 @@ if (WEBINSTALLER) { +@@ -570,7 +572,7 @@ if (WEBINSTALLER) { ob_start(); } } - +/* if (!WEBINSTALLER) { $msg = "The following PEAR packages are bundled with PHP: " . implode(', ', array_keys($pfc_packages)); -@@ -571,17 +573,19 @@ if (!WEBINSTALLER) { +@@ -580,17 +582,17 @@ if (!WEBINSTALLER) { $install_optional_packages = array(); print "\n"; } - +*/ #### # Download #### -+dl('xml.so'); -+ if (function_exists('set_include_path')) { - set_include_path($ptmp); + set_include_path($ptmp . PATH_SEPARATOR . "%%BUNDLEDIR%%"); } else { - ini_set('include_path', $ptmp); + ini_set('include_path', $ptmp . PATH_SEPARATOR . "%%BUNDLEDIR%%"); } - +/* if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error. if (WINDOWS) { @dl('php_zlib.dll'); -@@ -606,18 +610,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). +@@ -615,18 +617,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). if (!$have_gzip) { print "Downloading uncompressed packages\n"; }; - +*/ if ($install_pfc) { $to_install = array_merge($installer_packages, array_keys($pfc_packages)); } else { $to_install = $installer_packages; - +/* // webinstaller allows to choose pfc packages individually foreach ($pfc_packages as $pkg => $desc) { if (in_array($pkg, $install_optional_packages)) { array_push($to_install, $pkg); } } +*/ } // gopear_bundle usage -@@ -645,19 +650,21 @@ displayHTMLProgress($progress = 5); +@@ -654,19 +657,20 @@ displayHTMLProgress($progress = 5); // Bootstrap needed ? $nobootstrap = false; +/* if (is_dir($php_dir)) { $nobootstrap = true; foreach ($bootstrap_files as $file => $url) { $nobootstrap &= is_file($php_dir.'/'.$file); } } +- +*/ - if ($nobootstrap) { print('Using previously install ... '); if (function_exists('set_include_path')) { - set_include_path($php_dir); + set_include_path($php_dir . PATH_SEPARATOR . "%%BUNDLEDIR%%"); } else { - ini_set('include_path', $php_dir); + ini_set('include_path', $php_dir . PATH_SEPARATOR . "%%BUNDLEDIR%%"); } include_once 'PEAR.php'; print "ok\n"; -@@ -691,6 +698,7 @@ displayHTMLProgress($progress = 20); +@@ -700,6 +704,7 @@ displayHTMLProgress($progress = 20); // Extract needed ? $noextract = false; +/* if (is_dir($php_dir)) { $noextract = @include_once 'PEAR/Registry.php'; - -@@ -701,6 +709,7 @@ if (is_dir($php_dir)) { + +@@ -710,7 +715,7 @@ if (is_dir($php_dir)) { } } } +- +*/ - if ($noextract) { print('Using previously installed installer ... '); -@@ -722,7 +731,7 @@ if ($noextract) { - displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs))); - - $fullpkg = substr($tarball, 0, strrpos($tarball, '.')); -- $tar = &new Archive_Tar($tarball, $have_gzip); -+ $tar = new Archive_Tar($tarball, $have_gzip); - if (!$tar->extractModify($ptmp, $fullpkg)) { - bail("Extraction for $fullpkg failed!\n"); - } -@@ -747,13 +756,8 @@ include_once "PEAR/Config.php"; + print "ok\n"; +@@ -756,13 +761,8 @@ include_once "PEAR/Config.php"; 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(($destdir ? $destdir : '').$prefix."/etc/pear.conf.sample", ''); - $config->set('preferred_state', 'stable'); foreach ($config_vars as $var) { if (isset($$var) && $$var != '') { -@@ -765,7 +769,7 @@ $config->set('temp_dir', $temp_dir); +@@ -774,7 +774,7 @@ $config->set('temp_dir', $temp_dir); $config->set('http_proxy', $http_proxy); $config->store(); -$registry = new PEAR_Registry($php_dir); +$registry = new PEAR_Registry(($destdir ? $destdir : '').$php_dir); PEAR_Command::setFrontendType('CLI'); PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently -@@ -787,6 +791,11 @@ foreach ($to_install as $pkg) { +@@ -796,6 +796,11 @@ foreach ($to_install as $pkg) { } else { $options = array('onlyreqdeps' => true); } + if ($destdir) { + $options['packagingroot'] = $destdir; + $options['force'] = true; + $options['nodeps'] = true; + } if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) { print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n"); displayHTMLProgress($progress += round(50 / count($to_install))); -@@ -821,7 +830,7 @@ displayHTMLProgress($progress = 99); +@@ -830,7 +835,7 @@ displayHTMLProgress($progress = 99); // Base installation finished - +/* ini_restore("include_path"); if (!WEBINSTALLER) { -@@ -980,6 +989,7 @@ if ( WINDOWS ) { +@@ -993,6 +998,7 @@ if ( WINDOWS ) { if (WINDOWS && !WEBINSTALLER) { win32CreateRegEnv(); } +*/ // Set of functions following /** * Parse the given dirname -@@ -1134,7 +1144,7 @@ function which($program, $dont_search_in = false) +@@ -1179,7 +1185,7 @@ function which($program, $dont_search_in = false) if (!strlen($dir)) { continue; } - if ($dir{strlen($dir) - 1} != '\\') { + if ($dir[strlen($dir) - 1] != '\\') { $dir .= '\\'; } $tmp = $dir . $program; -@@ -1418,19 +1428,17 @@ function detect_install_dirs($_prefix = null) { +@@ -1463,19 +1469,17 @@ function detect_install_dirs($_prefix = null) { } } else { if ($_prefix === null) { - #$prefix = dirname(PHP_BINDIR); - $prefix = dirname(__FILE__); -+ $prefix = '%%PREFIX%%'; ++ $prefix = '%%PREFIX%%'; } else { $prefix = $_prefix; } $bin_dir = '$prefix/bin'; - #$php_dir = '$prefix/share/pear'; - $php_dir = '$prefix/PEAR'; - $doc_dir = '$php_dir/docs'; + $php_dir = '$prefix/share/pear'; + $doc_dir = '$prefix/share/doc/pear'; $data_dir = '$php_dir/data'; $test_dir = '$php_dir/tests'; - $temp_dir = '$prefix/temp'; - -+ $temp_dir = '%%TMPDIR%%'; ++ $temp_dir = '%%TMPDIR%%'; +/* // 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 +1450,7 @@ function detect_install_dirs($_prefix = null) { +@@ -1487,6 +1491,7 @@ function detect_install_dirs($_prefix = null) { } elseif (@is_dir("$prefix/share/php/.registry")) { $php_dir = '$prefix/share/php'; } +*/ } }