- move tests to /usr/share/tests/pear

- move pkgxml to /var/lib/pear
- remove XML_RPC
- refresh installer
This commit is contained in:
remi 2012-08-14 12:05:26 +02:00
parent d0e6eba656
commit fee8e158d5
3 changed files with 56 additions and 31 deletions

View File

@ -43,7 +43,7 @@ for ($i = 0; $i < sizeof($argv); $i++) {
if (preg_match('/package-(.*)\.xml$/', $bn, $matches) || if (preg_match('/package-(.*)\.xml$/', $bn, $matches) ||
preg_match('/([A-Za-z0-9_:]+)-.*\.(tar|tgz)$/', $bn, $matches)) { preg_match('/([A-Za-z0-9_:]+)-.*\.(tar|tgz)$/', $bn, $matches)) {
$install_files[$matches[1]] = $arg; $install_files[$matches[1]] = $arg;
} elseif ($arg == '-a') { } elseif ($arg == '-a' || $arg == '--cache') {
$cache_dir = $argv[$i+1]; $cache_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '--force') { } elseif ($arg == '--force') {
@ -54,30 +54,36 @@ for ($i = 0; $i < sizeof($argv); $i++) {
} elseif ($arg == '-ds') { } elseif ($arg == '-ds') {
$suffix = $argv[$i+1]; $suffix = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-d') { } elseif ($arg == '-d' || $arg == '--dir') {
$with_dir = $argv[$i+1]; $with_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-b') { } elseif ($arg == '-b' || $arg == '--bin') {
$bin_dir = $argv[$i+1]; $bin_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-c') { } elseif ($arg == '-c' || $arg == '--config') {
$cfg_dir = $argv[$i+1]; $cfg_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-w') { } elseif ($arg == '-w' || $arg == '--www') {
$www_dir = $argv[$i+1]; $www_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-p') { } elseif ($arg == '-p' || $arg == '--php') {
$php_bin = $argv[$i+1]; $php_bin = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-o') { } elseif ($arg == '-o' || $arg == '--download') {
$download_dir = $argv[$i+1]; $download_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-t') { } elseif ($arg == '-t' || $arg == '--temp') {
$temp_dir = $argv[$i+1]; $temp_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-D') { } elseif ($arg == '-A' || $arg == '--data') {
$data_dir = $argv[$i+1];
$i++;
} elseif ($arg == '-D' || $arg == '--doc') {
$doc_dir = $argv[$i+1]; $doc_dir = $argv[$i+1];
$i++; $i++;
} elseif ($arg == '-T' || $arg == '--test') {
$test_dir = $argv[$i+1];
$i++;
} elseif ($arg == '--debug') { } elseif ($arg == '--debug') {
$debug = 1; $debug = 1;
} elseif ($arg == '--extremedebug') { } elseif ($arg == '--extremedebug') {
@ -139,6 +145,16 @@ if (!empty($doc_dir)) {
$config->set('doc_dir', $doc_dir, 'default'); $config->set('doc_dir', $doc_dir, 'default');
} }
// Data files
if (!empty($data_dir)) {
$config->set('data_dir', $data_dir, 'default');
}
// Unit tests
if (!empty($test_dir)) {
$config->set('test_dir', $test_dir, 'default');
}
// User supplied a dir prefix // User supplied a dir prefix
if (!empty($with_dir)) { if (!empty($with_dir)) {
$ds = DIRECTORY_SEPARATOR; $ds = DIRECTORY_SEPARATOR;
@ -146,8 +162,12 @@ if (!empty($with_dir)) {
if (empty($doc_dir)) { if (empty($doc_dir)) {
$config->set('doc_dir', $with_dir . $ds . 'doc', 'default'); $config->set('doc_dir', $with_dir . $ds . 'doc', 'default');
} }
$config->set('data_dir', $with_dir . $ds . 'data', 'default'); if (empty($data_dir)) {
$config->set('test_dir', $with_dir . $ds . 'test', 'default'); $config->set('data_dir', $with_dir . $ds . 'data', 'default');
}
if (empty($test_dir)) {
$config->set('test_dir', $with_dir . $ds . 'test', 'default');
}
if (empty($www_dir)) { if (empty($www_dir)) {
$config->set('www_dir', $with_dir . $ds . 'htdocs', 'default'); $config->set('www_dir', $with_dir . $ds . 'htdocs', 'default');
} }

View File

@ -25,8 +25,8 @@
# #
# Define XML directories to store package registration information: # Define XML directories to store package registration information:
# #
%pear_xmldir %{pear_phpdir}/.pkgxml %pear_xmldir %{_localstatedir}/lib/pear/pkgxml
%pecl_xmldir %{pecl_phpdir}/.pkgxml %pecl_xmldir %{_localstatedir}/lib/pear/pkgxml
# #
# Define macros to be used in scriplets for php-pecl-* spec files: # Define macros to be used in scriplets for php-pecl-* spec files:

View File

@ -1,8 +1,5 @@
%global peardir %{_datadir}/pear %global peardir %{_datadir}/pear
# https://pear.php.net/bugs/bug.php?id=19368
# XML_RPC Please Provides LICENSE file
%global xmlrpcver 1.5.5
%global getoptver 1.3.1 %global getoptver 1.3.1
%global arctarver 1.3.10 %global arctarver 1.3.10
# https://pear.php.net/bugs/bug.php?id=19367 # https://pear.php.net/bugs/bug.php?id=19367
@ -17,10 +14,10 @@
Summary: PHP Extension and Application Repository framework Summary: PHP Extension and Application Repository framework
Name: php-pear Name: php-pear
Version: 1.9.4 Version: 1.9.4
Release: 8%{?dist} Release: 9%{?dist}
Epoch: 1 Epoch: 1
# PEAR, Archive_Tar, XML_Util are BSD # PEAR, Archive_Tar, XML_Util are BSD
# XML-RPC, Console_Getopt are PHP # Console_Getopt is PHP
# Structures_Graph is LGPLv2+ # Structures_Graph is LGPLv2+
License: BSD and PHP and LGPLv2+ License: BSD and PHP and LGPLv2+
Group: Development/Languages Group: Development/Languages
@ -30,17 +27,16 @@ Source0: http://download.pear.php.net/package/PEAR-%{version}.tgz
Source1: install-pear.php Source1: install-pear.php
Source2: relocate.php Source2: relocate.php
Source3: strip.php Source3: strip.php
Source4: LICENSE-XML_RPC
Source10: pear.sh Source10: pear.sh
Source11: pecl.sh Source11: pecl.sh
Source12: peardev.sh Source12: peardev.sh
Source13: macros.pear Source13: macros.pear
Source20: http://pear.php.net/get/XML_RPC-%{xmlrpcver}.tgz
Source21: http://pear.php.net/get/Archive_Tar-%{arctarver}.tgz Source21: http://pear.php.net/get/Archive_Tar-%{arctarver}.tgz
Source22: http://pear.php.net/get/Console_Getopt-%{getoptver}.tgz Source22: http://pear.php.net/get/Console_Getopt-%{getoptver}.tgz
Source23: http://pear.php.net/get/Structures_Graph-%{structver}.tgz Source23: http://pear.php.net/get/Structures_Graph-%{structver}.tgz
Source24: http://pear.php.net/get/XML_Util-%{xmlutil}.tgz Source24: http://pear.php.net/get/XML_Util-%{xmlutil}.tgz
# From RHEL: ignore REST cache creation failures as non-root user (#747361) # From RHEL: ignore REST cache creation failures as non-root user (#747361)
# TODO See https://github.com/pear/pear-core/commit/dfef86e05211d2abc7870209d69064d448ef53b3#PEAR/REST.php
Patch0: php-pear-1.9.4-restcache.patch Patch0: php-pear-1.9.4-restcache.patch
BuildArch: noarch BuildArch: noarch
@ -54,7 +50,6 @@ Provides: php-pear(Console_Getopt) = %{getoptver}
Provides: php-pear(Archive_Tar) = %{arctarver} Provides: php-pear(Archive_Tar) = %{arctarver}
Provides: php-pear(PEAR) = %{version} Provides: php-pear(PEAR) = %{version}
Provides: php-pear(Structures_Graph) = %{structver} Provides: php-pear(Structures_Graph) = %{structver}
Provides: php-pear(XML_RPC) = %{xmlrpcver}
Provides: php-pear(XML_Util) = %{xmlutil} Provides: php-pear(XML_Util) = %{xmlutil}
Obsoletes: php-pear-XML-Util < %{xmlutil}-%{release} Obsoletes: php-pear-XML-Util < %{xmlutil}-%{release}
Provides: php-pear-XML-Util = %{xmlutil}-%{release} Provides: php-pear-XML-Util = %{xmlutil}-%{release}
@ -102,7 +97,7 @@ export PHP_PEAR_TEMP_DIR=/var/tmp
install -d $RPM_BUILD_ROOT%{peardir} \ install -d $RPM_BUILD_ROOT%{peardir} \
$RPM_BUILD_ROOT%{_localstatedir}/cache/php-pear \ $RPM_BUILD_ROOT%{_localstatedir}/cache/php-pear \
$RPM_BUILD_ROOT%{_localstatedir}/www/html \ $RPM_BUILD_ROOT%{_localstatedir}/www/html \
$RPM_BUILD_ROOT%{peardir}/.pkgxml \ $RPM_BUILD_ROOT%{_localstatedir}/lib/pear/pkgxml \
$RPM_BUILD_ROOT%{_sysconfdir}/rpm \ $RPM_BUILD_ROOT%{_sysconfdir}/rpm \
$RPM_BUILD_ROOT%{_sysconfdir}/pear $RPM_BUILD_ROOT%{_sysconfdir}/pear
@ -110,12 +105,13 @@ export INSTALL_ROOT=$RPM_BUILD_ROOT
%{_bindir}/php -n -dmemory_limit=32M -dshort_open_tag=0 -dsafe_mode=0 \ %{_bindir}/php -n -dmemory_limit=32M -dshort_open_tag=0 -dsafe_mode=0 \
-derror_reporting=E_ALL -ddetect_unicode=0 \ -derror_reporting=E_ALL -ddetect_unicode=0 \
%{SOURCE1} -d %{peardir} \ %{SOURCE1} --dir %{peardir} \
-c %{_sysconfdir}/pear \ --config %{_sysconfdir}/pear \
-b %{_bindir} \ --bin %{_bindir} \
-w %{_localstatedir}/www/html \ --www %{_localstatedir}/www/html \
-D %{_docdir}/pear \ --doc %{_docdir}/pear \
%{SOURCE0} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24} %{SOURCE20} --test %{_datarootdir}/tests/pear \
%{SOURCE0} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24}
# Replace /usr/bin/* with simple scripts: # Replace /usr/bin/* with simple scripts:
install -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/pear install -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/pear
@ -130,7 +126,6 @@ install -m 755 %{SOURCE12} $RPM_BUILD_ROOT%{_bindir}/peardev
%{_bindir}/php -r "print_r(unserialize(substr(file_get_contents('$RPM_BUILD_ROOT%{_sysconfdir}/pear.conf'),17)));" %{_bindir}/php -r "print_r(unserialize(substr(file_get_contents('$RPM_BUILD_ROOT%{_sysconfdir}/pear.conf'),17)));"
install -m 644 -c %{SOURCE4} LICENSE-XML_RPC
install -m 644 -c %{SOURCE13} \ install -m 644 -c %{SOURCE13} \
$RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.pear $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.pear
@ -146,7 +141,7 @@ popd
rm -rf $RPM_BUILD_ROOT/.depdb* $RPM_BUILD_ROOT/.lock $RPM_BUILD_ROOT/.channels $RPM_BUILD_ROOT/.filemap rm -rf $RPM_BUILD_ROOT/.depdb* $RPM_BUILD_ROOT/.lock $RPM_BUILD_ROOT/.channels $RPM_BUILD_ROOT/.filemap
# Need for re-registrying XML_Util # Need for re-registrying XML_Util
install -m 644 XML_Util.xml $RPM_BUILD_ROOT%{peardir}/.pkgxml/ install -m 644 XML_Util.xml $RPM_BUILD_ROOT%{_localstatedir}/lib/pear/pkgxml
%check %check
@ -183,7 +178,8 @@ rm new-pear.conf
%triggerpostun -- php-pear-XML-Util %triggerpostun -- php-pear-XML-Util
# re-register extension unregistered during postun of obsoleted php-pear-XML-Util # re-register extension unregistered during postun of obsoleted php-pear-XML-Util
%{_bindir}/pear install --nodeps --soft --force --register-only %{pear_xmldir}/XML_Util.xml >/dev/null || : %{_bindir}/pear install --nodeps --soft --force --register-only \
%{_localstatedir}/lib/pear/pkgxml/XML_Util.xml >/dev/null || :
%files %files
@ -198,9 +194,18 @@ rm new-pear.conf
%doc README* LICENSE* %doc README* LICENSE*
%dir %{_docdir}/pear %dir %{_docdir}/pear
%doc %{_docdir}/pear/* %doc %{_docdir}/pear/*
%dir %{_datarootdir}/tests
%{_datarootdir}/tests/pear
%{_localstatedir}/lib/pear
%changelog %changelog
* Mon Aug 13 2012 Remi Collet <remi@fedoraproject.org> 1:1.9.4-9
- move tests to /usr/share/tests/pear
- move pkgxml to /var/lib/pear
- remove XML_RPC
- refresh installer
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.9.4-8 * Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.9.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild