- use BuildArch not BuildArchitectures (#226925)

- fix to use preferred BuildRoot (#226925)
- strip more buildroot-relative paths from *.reg
This commit is contained in:
jorton 2007-02-05 12:33:03 +00:00
parent 7550ac12ee
commit cbe20f748b
2 changed files with 26 additions and 10 deletions

View File

@ -6,7 +6,7 @@
Summary: PHP Extension and Application Repository framework Summary: PHP Extension and Application Repository framework
Name: php-pear Name: php-pear
Version: 1.4.11 Version: 1.4.11
Release: 2 Release: 3
Epoch: 1 Epoch: 1
License: The PHP License v3.0 License: The PHP License v3.0
Group: System Group: System
@ -22,8 +22,8 @@ Source13: macros.pear
Source20: http://pear.php.net/get/XML_RPC-%{xmlrpcver}.tgz Source20: http://pear.php.net/get/XML_RPC-%{xmlrpcver}.tgz
Patch0: php-pear-1.4.8-template.patch Patch0: php-pear-1.4.8-template.patch
Patch1: php-pear-1.4.8-package.patch Patch1: php-pear-1.4.8-package.patch
BuildArchitectures: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php >= 5.1.0-1 BuildRequires: php >= 5.1.0-1
Provides: php-pear(Archive_Tar) = 1.3.1 Provides: php-pear(Archive_Tar) = 1.3.1
Provides: php-pear(Console_Getopt) = 1.2 Provides: php-pear(Console_Getopt) = 1.2
@ -93,10 +93,13 @@ install -m 644 -c $RPM_SOURCE_DIR/macros.pear \
$RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.pear $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.pear
%check %check
# Check that no buildroot-relative or arch-specific paths are left in the pear.conf # Check that no bogus paths are left in the configuration, or in
# the generated registry files.
grep $RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1 grep $RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
grep %{_libdir} $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1 grep %{_libdir} $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
grep '"/tmp"' $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1 grep '"/tmp"' $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
grep /usr/local $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
grep -rl $RPM_BUILD_ROOT $RPM_BUILD_ROOT && exit 1
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -112,6 +115,11 @@ rm pear.conf
%doc LICENSE %doc LICENSE
%changelog %changelog
* Mon Feb 5 2007 Joe Orton <jorton@redhat.com> 1:1.4.11-3
- use BuildArch not BuildArchitectures (#226925)
- fix to use preferred BuildRoot (#226925)
- strip more buildroot-relative paths from *.reg
* Thu Jan 4 2007 Joe Orton <jorton@redhat.com> 1:1.4.11-2 * Thu Jan 4 2007 Joe Orton <jorton@redhat.com> 1:1.4.11-2
- update to 1.4.11 - update to 1.4.11

View File

@ -14,13 +14,18 @@ $destdir = $_SERVER['argv'][2];
$destdir_len = strlen($destdir); $destdir_len = strlen($destdir);
function relocate_value($value) { function relocate_string($value) {
global $destdir, $destdir_len; global $destdir, $destdir_len;
if (is_string($value)) {
if (strncmp($value, $destdir, $destdir_len) == 0) { if (strncmp($value, $destdir, $destdir_len) == 0) {
$value = substr($value, $destdir_len); $value = substr($value, $destdir_len);
} }
return $value;
}
function relocate_value($value) {
if (is_string($value)) {
$value = relocate_string($value);
} else if (is_array($value)) { } else if (is_array($value)) {
$value = relocate_array($value); $value = relocate_array($value);
} }
@ -29,11 +34,14 @@ function relocate_value($value) {
} }
function relocate_array($array) { function relocate_array($array) {
$result = array();
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
$array[$key] = relocate_value($value); $key = relocate_string($key);
$result[$key] = relocate_value($value);
} }
return $array; return $result;
} }
$input = file_get_contents($file); $input = file_get_contents($file);