From: Tomas V.V.Cox Date: Sun, 15 Jun 2003 16:29:10 +0000 (+0000) Subject: Fix makerpm (again) X-Git-Tag: RELEASE_1_0_2~229 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47aa7a9b3600ad9d907fa8631f316d9d9e867390;p=php Fix makerpm (again) Build an independant filelist tree (this command still needs some work) --- 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";