mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
MFB
This commit is contained in:
parent
a643675b43
commit
ad747ba2e3
@ -251,10 +251,7 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
|||||||
$this->output = '';
|
$this->output = '';
|
||||||
include_once 'PEAR/Packager.php';
|
include_once 'PEAR/Packager.php';
|
||||||
$pkginfofile = isset($params[0]) ? $params[0] : 'package.xml';
|
$pkginfofile = isset($params[0]) ? $params[0] : 'package.xml';
|
||||||
$packager =& new PEAR_Packager($this->config->get('php_dir'),
|
$packager =& new PEAR_Packager();
|
||||||
$this->config->get('ext_dir'),
|
|
||||||
$this->config->get('doc_dir'));
|
|
||||||
$packager->debug = $this->config->get('verbose');
|
|
||||||
$err = $warn = array();
|
$err = $warn = array();
|
||||||
$dir = dirname($pkginfofile);
|
$dir = dirname($pkginfofile);
|
||||||
$compress = empty($options['nocompress']) ? true : false;
|
$compress = empty($options['nocompress']) ? true : false;
|
||||||
@ -561,15 +558,25 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
|||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
// {{{ doMakeRPM()
|
// {{{ doMakeRPM()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
(cox)
|
(cox)
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
- Fill the rpm dependencies in the template file.
|
- Fill the rpm dependencies in the template file.
|
||||||
|
|
||||||
IDEAS:
|
IDEAS:
|
||||||
|
|
||||||
- Instead of mapping the role to rpm vars, perhaps it's better
|
- Instead of mapping the role to rpm vars, perhaps it's better
|
||||||
|
|
||||||
to use directly the pear cmd to install the files by itself
|
to use directly the pear cmd to install the files by itself
|
||||||
|
|
||||||
in %postrun so:
|
in %postrun so:
|
||||||
|
|
||||||
pear -d php_dir=%{_libdir}/php/pear -d test_dir=.. <package>
|
pear -d php_dir=%{_libdir}/php/pear -d test_dir=.. <package>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function doMakeRPM($command, $options, $params)
|
function doMakeRPM($command, $options, $params)
|
||||||
@ -619,27 +626,47 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
|||||||
$info['rpm_package'] = sprintf($rpm_pkgname_format, $info['package']);
|
$info['rpm_package'] = sprintf($rpm_pkgname_format, $info['package']);
|
||||||
$srcfiles = 0;
|
$srcfiles = 0;
|
||||||
foreach ($info['filelist'] as $name => $attr) {
|
foreach ($info['filelist'] as $name => $attr) {
|
||||||
|
|
||||||
if ($attr['role'] == 'doc') {
|
if ($attr['role'] == 'doc') {
|
||||||
$info['doc_files'] .= " $name";
|
$info['doc_files'] .= " $name";
|
||||||
|
|
||||||
// Map role to the rpm vars
|
// Map role to the rpm vars
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$c_prefix = '%{_libdir}/php/pear';
|
$c_prefix = '%{_libdir}/php/pear';
|
||||||
|
|
||||||
switch ($attr['role']) {
|
switch ($attr['role']) {
|
||||||
|
|
||||||
case 'php':
|
case 'php':
|
||||||
|
|
||||||
$prefix = $c_prefix; break;
|
$prefix = $c_prefix; break;
|
||||||
|
|
||||||
case 'ext':
|
case 'ext':
|
||||||
|
|
||||||
$prefix = '%{_libdir}/php'; break; // XXX good place?
|
$prefix = '%{_libdir}/php'; break; // XXX good place?
|
||||||
|
|
||||||
case 'src':
|
case 'src':
|
||||||
|
|
||||||
$srcfiles++;
|
$srcfiles++;
|
||||||
|
|
||||||
$prefix = '%{_includedir}/php'; break; // XXX good place?
|
$prefix = '%{_includedir}/php'; break; // XXX good place?
|
||||||
|
|
||||||
case 'test':
|
case 'test':
|
||||||
|
|
||||||
$prefix = "$c_prefix/tests/" . $info['package']; break;
|
$prefix = "$c_prefix/tests/" . $info['package']; break;
|
||||||
|
|
||||||
case 'data':
|
case 'data':
|
||||||
|
|
||||||
$prefix = "$c_prefix/data/" . $info['package']; break;
|
$prefix = "$c_prefix/data/" . $info['package']; break;
|
||||||
|
|
||||||
case 'script':
|
case 'script':
|
||||||
|
|
||||||
$prefix = '%{_bindir}'; break;
|
$prefix = '%{_bindir}'; break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$info['files'] .= "$prefix/$name\n";
|
$info['files'] .= "$prefix/$name\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($srcfiles > 0) {
|
if ($srcfiles > 0) {
|
||||||
|
@ -162,7 +162,10 @@ class PEAR_Dependency
|
|||||||
$code = $this->codeFromRelation($relation, $version, $req, $opt);
|
$code = $this->codeFromRelation($relation, $version, $req, $opt);
|
||||||
if ($opt) {
|
if ($opt) {
|
||||||
$errmsg = "package `$name' version " . $this->signOperator($relation) .
|
$errmsg = "package `$name' version " . $this->signOperator($relation) .
|
||||||
" $req is recommended to utilize some features. Installed version is $version";
|
" $req is recommended to utilize some features.";
|
||||||
|
if ($version) {
|
||||||
|
$errmsg .= " Installed version is $version";
|
||||||
|
}
|
||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
$errmsg = "requires package `$name' " .
|
$errmsg = "requires package `$name' " .
|
||||||
|
Loading…
Reference in New Issue
Block a user