summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-11-09 14:21:32 +0100
committerRemi Collet <fedora@famillecollet.com>2012-11-09 14:21:32 +0100
commitd0c60d2c4178eccaafdf2712791905981e59193a (patch)
tree3be8b1d0f1234727d48f1c40949c9422fecf1025
parentaab1667bfe193a54cea3f42e658399c7c98df66e (diff)
php-pear: drop relocate stuff, no more needed, provides value for %%{pear_metadir}
-rw-r--r--macros.pear1
-rw-r--r--php-pear.spec20
-rw-r--r--relocate.php61
3 files changed, 14 insertions, 68 deletions
diff --git a/macros.pear b/macros.pear
index deabb08..a07a5cc 100644
--- a/macros.pear
+++ b/macros.pear
@@ -13,6 +13,7 @@
%pear_datadir %(%{__pear} config-get data_dir 2> /dev/null || echo undefined)
%pear_cfgdir %(%{__pear} config-get cfg_dir 2> /dev/null || echo undefined)
%pear_wwwdir %(%{__pear} config-get www_dir 2> /dev/null || echo undefined)
+%pear_metadir %{pear_phpdir}
#
# Define PECL directories used in php-pecl-* spec files:
diff --git a/php-pear.spec b/php-pear.spec
index 3c1ad80..63c8248 100644
--- a/php-pear.spec
+++ b/php-pear.spec
@@ -14,7 +14,7 @@
Summary: PHP Extension and Application Repository framework
Name: php-pear
Version: 1.9.4
-Release: 11%{?dist}.1
+Release: 12%{?dist}
Epoch: 1
# PEAR, Archive_Tar, XML_Util are BSD
# Console_Getopt is PHP
@@ -25,7 +25,6 @@ URL: http://pear.php.net/package/PEAR
Source0: http://download.pear.php.net/package/PEAR-%{version}.tgz
# wget https://raw.github.com/pear/pear-core/master/install-pear.php
Source1: install-pear.php
-Source2: relocate.php
Source3: strip.php
Source10: pear.sh
Source11: pecl.sh
@@ -76,6 +75,7 @@ do
[ -f package2.xml ] && mv package2.xml ${file%%-*}.xml \
|| mv package.xml ${file%%-*}.xml
done
+cp %{SOURCE1} .
# apply patches on used PEAR during install
# -- no patch
@@ -108,7 +108,9 @@ export INSTALL_ROOT=$RPM_BUILD_ROOT
%{_bindir}/php -n -dmemory_limit=32M -dshort_open_tag=0 -dsafe_mode=0 \
-derror_reporting=E_ALL -ddetect_unicode=0 \
- %{SOURCE1} --dir %{peardir} \
+ install-pear.php \
+ --dir %{peardir} \
+ --cache %{_localstatedir}/cache/php-pear \
--config %{_sysconfdir}/pear \
--bin %{_bindir} \
--www %{_localstatedir}/www/html \
@@ -123,10 +125,8 @@ install -m 755 %{SOURCE11} $RPM_BUILD_ROOT%{_bindir}/pecl
install -m 755 %{SOURCE12} $RPM_BUILD_ROOT%{_bindir}/peardev
# Sanitize the pear.conf
-%{_bindir}/php -n %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf $RPM_BUILD_ROOT |
- %{_bindir}/php -n %{SOURCE2} php://stdin $PWD > new-pear.conf
-%{_bindir}/php -n %{SOURCE3} new-pear.conf ext_dir |
- %{_bindir}/php -n %{SOURCE3} php://stdin http_proxy > $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
+%{_bindir}/php -n %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf ext_dir >new-pear.conf
+%{_bindir}/php -n %{SOURCE3} new-pear.conf http_proxy > $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
%{_bindir}/php -r "print_r(unserialize(substr(file_get_contents('$RPM_BUILD_ROOT%{_sysconfdir}/pear.conf'),17)));"
@@ -216,6 +216,12 @@ rm new-pear.conf
%changelog
+* Fri Nov 9 2012 Remi Collet <remi@fedoraproject.org> 1:1.9.4-12
+- provides value for %%{pear_metadir}
+
+* Wed Sep 26 2012 Remi Collet <remi@fedoraproject.org> 1:1.9.4-12
+- drop relocate stuff, no more needed
+
* Thu Sep 6 2012 Remi Collet <RPMS@famillecollet.com> 1:1.9.4-11.1
- obsoletes php53* php54* on EL
diff --git a/relocate.php b/relocate.php
deleted file mode 100644
index 8475b33..0000000
--- a/relocate.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-#
-# relocate.php /path/to/file prefix
-#
-# Takes a file as input and a string prefix; reads
-# the file as a serialized data blob and strips PREFIX
-# from the beginning of each string value within the blob.
-# Serializes again and writes output to stdout.
-#
-
-$file = $_SERVER['argv'][1];
-$destdir = $_SERVER['argv'][2];
-
-$destdir_len = strlen($destdir);
-
-function relocate_string($value) {
- global $destdir, $destdir_len;
-
- if (strncmp($value, $destdir, $destdir_len) == 0) {
- $value = substr($value, $destdir_len);
- }
- return $value;
-}
-
-function relocate_value($value) {
- if (is_string($value)) {
- $value = relocate_string($value);
- } else if (is_array($value)) {
- $value = relocate_array($value);
- }
-
- return $value;
-}
-
-function relocate_array($array) {
- $result = array();
-
- foreach ($array as $key => $value) {
- if (is_string($key)) {
- $key = relocate_string($key);
- }
- $result[$key] = relocate_value($value);
- }
-
- return $result;
-}
-
-$input = file_get_contents($file);
-
-# Special case for /etc/pear.conf.
-if (strncmp($input, "#PEAR_Config 0.9\n", 17) == 0) {
- echo substr($input, 0, 17);
- $s = substr($input, 17);
-} else {
- $s = $input;
-}
-
-echo serialize(relocate_value(unserialize($s)));
-
-?> \ No newline at end of file