diff options
| author | Tomas V.V.Cox <cox@php.net> | 2003-06-15 16:29:10 +0000 |
|---|---|---|
| committer | Tomas V.V.Cox <cox@php.net> | 2003-06-15 16:29:10 +0000 |
| commit | 47aa7a9b3600ad9d907fa8631f316d9d9e867390 (patch) | |
| tree | a96dc1021c26333fec5add228e8cf45655208eaa /pear/PEAR/Command | |
| parent | 900263aaa99b5160c2896caf065e99a836d3f9d5 (diff) | |
| download | php-git-47aa7a9b3600ad9d907fa8631f316d9d9e867390.tar.gz | |
Fix makerpm (again)
Build an independant filelist tree
(this command still needs some work)
Diffstat (limited to 'pear/PEAR/Command')
| -rw-r--r-- | pear/PEAR/Command/Package.php | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/pear/PEAR/Command/Package.php b/pear/PEAR/Command/Package.php index 372a171306..94d8ee7ac5 100644 --- a/pear/PEAR/Command/Package.php +++ b/pear/PEAR/Command/Package.php @@ -585,10 +585,10 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm $pkgdir = "$info[package]-$info[version]"; $info['rpm_xml_dir'] = '/var/lib/pear'; $this->config->set('verbose', $tmp); - if (!$tar->extractList("$pkgdir/package.xml", $tmpdir, $pkgdir)) { + if (!$tar->extractList("package.xml", $tmpdir, $pkgdir)) { return $this->raiseError("failed to extract $params[0]"); } - if (!file_exists("package.xml")) { + if (!file_exists("$tmpdir/package.xml")) { return $this->raiseError("no package.xml found in $params[0]"); } if (isset($options['spec-template'])) { @@ -611,10 +611,26 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm foreach ($info['filelist'] as $name => $attr) { if ($attr['role'] == 'doc') { $info['doc_files'] .= " $name"; - } elseif ($attr['role'] == 'src') { - $srcfiles++; + // Map role to the rpm vars + } else { + $c_prefix = '%{_libdir}/php/pear'; + switch ($attr['role']) { + case 'php': + $prefix = $c_prefix; break; + case 'ext': + $prefix = '%{_libdir}/php'; break; // XXX good place? + case 'src': + $srcfiles++; + $prefix = '%{_includedir}/php'; break; // XXX good place? + case 'test': + $prefix = "$c_prefix/tests/" . $info['package']; break; + case 'data': + $prefix = "$c_prefix/data/" . $info['package']; break; + case 'script': + $prefix = '%{_bindir}'; break; + } + $info['files'] .= "$prefix/$name\n"; } - $info['files'] .= "$attr[installed_as]\n"; } if ($srcfiles > 0) { include_once "OS/Guess.php"; |
