auto-import php-pear-1.4.5-1 on branch devel from php-pear-1.4.5-1.src.rpm
This commit is contained in:
parent
c4753c9c15
commit
f2c4aa5593
@ -0,0 +1 @@
|
||||
XML_RPC-1.4.4.tgz
|
3
pear.sh
Normal file
3
pear.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
exec /usr/bin/php -C -d include_path=/usr/share/pear \
|
||||
-d output_buffering=1 /usr/share/pear/pearcmd.php "$@"
|
72
php-pear.spec
Normal file
72
php-pear.spec
Normal file
@ -0,0 +1,72 @@
|
||||
|
||||
%define peardir %{_datadir}/pear
|
||||
|
||||
Summary: PHP Extension and Application Repository framework
|
||||
Name: php-pear
|
||||
Version: 1.4.5
|
||||
Release: 1
|
||||
Epoch: 1
|
||||
License: PHP
|
||||
Group: System
|
||||
URL: http://pear.php.net/package/PEAR
|
||||
Source0: install-pear-nozlib-%{version}.phar
|
||||
Source1: pear.sh
|
||||
Source2: relocate.php
|
||||
Source3: XML_RPC-1.4.4.tgz
|
||||
BuildArchitectures: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
BuildRequires: php >= 5.1.0-1
|
||||
|
||||
%description
|
||||
PEAR is a framework and distribution system for reusable PHP
|
||||
components. This package contains the basic PEAR components.
|
||||
|
||||
%prep
|
||||
%setup -cTn pear-%{version}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
export PHP_PEAR_SYSCONF_DIR=`pwd`
|
||||
|
||||
%{_bindir}/php -n -dshort_open_tag=0 -dsafe_mode=0 \
|
||||
-derror_reporting=E_ALL -ddetect_unicode=0 \
|
||||
%{SOURCE0} -d $RPM_BUILD_ROOT%{peardir}\
|
||||
-b $RPM_BUILD_ROOT%{_bindir} \
|
||||
%{SOURCE3}
|
||||
|
||||
# Replace /usr/bin/pear with something simple:
|
||||
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/pear
|
||||
|
||||
install -d $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
|
||||
# Relocate everything:
|
||||
sed -si "s,$RPM_BUILD_ROOT,,g" \
|
||||
$RPM_BUILD_ROOT%{peardir}/*.php \
|
||||
$RPM_BUILD_ROOT%{peardir}/*/*.php \
|
||||
$RPM_BUILD_ROOT%{peardir}/*/*/*.php
|
||||
|
||||
%{_bindir}/php -n %{SOURCE2} pear.conf $RPM_BUILD_ROOT > $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
|
||||
|
||||
for f in $RPM_BUILD_ROOT%{peardir}/.registry/*.reg; do
|
||||
%{_bindir}/php -n %{SOURCE2} ${f} $RPM_BUILD_ROOT > ${f}.new
|
||||
mv ${f}.new ${f}
|
||||
done
|
||||
|
||||
%check
|
||||
# Check that no buildroot-relative paths are left in the pear.conf
|
||||
grep $RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
rm pear.conf
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{peardir}
|
||||
%{_bindir}/*
|
||||
%config %{_sysconfdir}/pear.conf
|
||||
|
||||
%changelog
|
||||
* Wed Nov 23 2005 Joe Orton <jorton@redhat.com> 1.4.5-1
|
||||
- initial build (Epoch: 1 to allow upgrade from php-pear-5.x)
|
51
relocate.php
Normal file
51
relocate.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?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_value($value) {
|
||||
global $destdir, $destdir_len;
|
||||
|
||||
if (is_string($value)) {
|
||||
if (strncmp($value, $destdir, $destdir_len) == 0) {
|
||||
$value = substr($value, $destdir_len);
|
||||
}
|
||||
} else if (is_array($value)) {
|
||||
$value = relocate_array($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function relocate_array($array) {
|
||||
foreach ($array as $key => $value) {
|
||||
$array[$key] = relocate_value($value);
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
$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