Set cfg_dir to be %{_sysconfdir}/pear (and own it) Update install-pear.php

script Add %%pear_cfgdir and %%pear_wwwdir macros
This commit is contained in:
Tim Jackson 2008-03-11 22:16:25 +00:00
parent 115cca0985
commit 2853f62f18
3 changed files with 28 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<?php
/* $Id: install-pear.php,v 1.29 2007/05/31 03:51:08 cellog Exp $ */
/* $Id: install-pear.php,v 1.31 2008/03/11 22:04:32 timj Exp $ */
error_reporting(E_ALL);
$pear_dir = dirname(__FILE__);
@ -46,6 +46,9 @@ for ($i = 0; $i < sizeof($argv); $i++) {
} elseif ($arg == '-b') {
$bin_dir = $argv[$i+1];
$i++;
} elseif ($arg == '-c') {
$cfg_dir = $argv[$i+1];
$i++;
} elseif ($arg == '-p') {
$php_bin = $argv[$i+1];
$i++;
@ -58,6 +61,11 @@ for ($i = 0; $i < sizeof($argv); $i++) {
$config = PEAR_Config::singleton();
if (PEAR::isError($config)) {
$locs = PEAR_Config::getDefaultConfigFiles();
die("ERROR: One of $locs[user] or $locs[system] is corrupt, please remove them and try again");
}
// make sure we use only default values
$config_layers = $config->getLayers();
foreach ($config_layers as $layer) {
@ -74,6 +82,12 @@ if ($debug) {
if (!empty($bin_dir)) {
$config->set('bin_dir', $bin_dir, 'default');
}
// Config files
if (!empty($cfg_dir)) {
$config->set('cfg_dir', $cfg_dir, 'default');
}
// User supplied a dir prefix
if (!empty($with_dir)) {
$ds = DIRECTORY_SEPARATOR;

View File

@ -11,6 +11,8 @@
%pear_docdir %(%{__pear} config-get doc_dir 2> /dev/null || echo undefined)
%pear_testdir %(%{__pear} config-get test_dir 2> /dev/null || echo undefined)
%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)
#
# Define PECL directories used in php-pecl-* spec files:

View File

@ -9,13 +9,13 @@
Summary: PHP Extension and Application Repository framework
Name: php-pear
Version: 1.7.1
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 1
License: PHP
Group: Development/Languages
URL: http://pear.php.net/package/PEAR
Source0: http://download.pear.php.net/package/PEAR-%{version}.tgz
# wget http://cvs.php.net/viewvc.cgi/pear-core/install-pear.php?revision=1.30 -O install-pear.php
# wget http://cvs.php.net/viewvc.cgi/pear-core/install-pear.php?revision=1.31 -O install-pear.php
Source1: install-pear.php
Source2: relocate.php
Source3: strip.php
@ -75,13 +75,15 @@ export PHP_PEAR_TEMP_DIR=/var/tmp
install -d $RPM_BUILD_ROOT%{peardir} \
$RPM_BUILD_ROOT%{_localstatedir}/cache/php-pear \
$RPM_BUILD_ROOT%{peardir}/.pkgxml \
$RPM_BUILD_ROOT%{_sysconfdir}/rpm
$RPM_BUILD_ROOT%{_sysconfdir}/rpm \
$RPM_BUILD_ROOT%{_sysconfdir}/pear
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} -d %{peardir} \
-c %{_sysconfdir}/pear \
-b %{_bindir} \
%{SOURCE0} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE20}
@ -130,9 +132,15 @@ rm new-pear.conf
%config(noreplace) %{_sysconfdir}/pear.conf
%config %{_sysconfdir}/rpm/macros.pear
%dir %{_localstatedir}/cache/php-pear
%dir %{_sysconfdir}/pear
%doc LICENSE README
%changelog
* Tue Mar 11 2008 Tim Jackson <rpm@timj.co.uk> 1:1.7.1-2
- Set cfg_dir to be %{_sysconfdir}/pear (and own it)
- Update install-pear.php script
- Add %%pear_cfgdir and %%pear_wwwdir macros
* Sun Feb 3 2008 Remi Collet <Fedora@FamilleCollet.com> 1:1.7.1-1
- update to 1.7.1