drop relocate stuff
This commit is contained in:
parent
0b5a555e7c
commit
a10ce1f7f2
@ -14,7 +14,7 @@
|
||||
Summary: PHP Extension and Application Repository framework
|
||||
Name: php-pear
|
||||
Version: 1.9.4
|
||||
Release: 11%{?dist}
|
||||
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
|
||||
@ -108,6 +107,7 @@ 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} \
|
||||
--cache %{_localstatedir}/cache/php-pear \
|
||||
--config %{_sysconfdir}/pear \
|
||||
--bin %{_bindir} \
|
||||
--www %{_localstatedir}/www/html \
|
||||
@ -122,10 +122,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)));"
|
||||
|
||||
@ -215,6 +213,9 @@ rm new-pear.conf
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Sep 26 2012 Remi Collet <remi@fedoraproject.org> 1:1.9.4-12
|
||||
- drop relocate stuff, no more needed
|
||||
|
||||
* Sun Aug 19 2012 Remi Collet <remi@fedoraproject.org> 1:1.9.4-11
|
||||
- move data to /usr/share/pear-data
|
||||
- provides all package.xml
|
||||
|
61
relocate.php
61
relocate.php
@ -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)));
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user