packages: php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec, php-...
glen
glen at pld-linux.org
Sat Aug 21 01:58:45 CEST 2010
Author: glen Date: Fri Aug 20 23:58:45 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- up to 0.2.0
---- Files affected:
packages/php-pear-PEAR_Command_Packaging:
php-pear-PEAR-template.spec (1.20 -> 1.21) , php-pear-PEAR_Command_Packaging.patch (1.6 -> 1.7) , php-pear-PEAR_Command_Packaging.spec (1.14 -> 1.15)
---- Diffs:
================================================================
Index: packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec
diff -u packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec:1.20 packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec:1.21
--- packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec:1.20 Fri Aug 20 23:53:25 2010
+++ packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec Sat Aug 21 01:58:39 2010
@@ -18,12 +18,12 @@
BuildRequires: rpmbuild(macros) >= 1.571
Requires: php-pear
@extra_headers@
-BuildArch: @arch@
+ at arch_statement@
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%if @have_optional_deps@
+%if "@_noautoreq@" != ""
# exclude optional dependencies
-%define _noautoreq @optional@
+%define _noautoreq @_noautoreq@
%endif
%description
@@ -45,23 +45,31 @@
%clean
rm -rf $RPM_BUILD_ROOT
-%if @have_optional_deps@
-%post
-if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
- cat %{_docdir}/%{name}-%{version}/optional-packages.txt
-fi
+%if "@_noautoreq@" != ""
+%post -p <lua>
+%pear_package_print_optionalpackages
%endif
%files
%defattr(644,root,root,755)
%doc ChangeLog install.log
-%if @have_optional_deps@
+%if "@_noautoreq@" != ""
%doc optional-packages.txt
%endif
@doc_files_statement@
%{php_pear_dir}/.registry/*.reg
- at files@
- at data_files@
+ at cfg_files_statement@
+ at script_files_statement@
+ at php_files_statement@
+ at data_files_statement@
+%if 0
+# www:
+ at www_files_statement@
+# test:
+ at test_files_statement@
+# custom:
+ at customrole_files_statement@
+%endif
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -69,6 +77,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.21 2010/08/20 23:58:39 glen
+- up to 0.2.0
+
Revision 1.20 2010/08/20 21:53:25 glen
- build changelog
================================================================
Index: packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.patch
diff -u packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.patch:1.6 packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.patch:1.7
--- packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.patch:1.6 Mon Sep 3 02:39:00 2007
+++ packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.patch Sat Aug 21 01:58:39 2010
@@ -1,329 +1,351 @@
---- ./usr/share/pear/PEAR/Command/Packaging.php 2006-11-08 21:05:54.294127778 +0200
-+++ ./usr/share/pear/PEAR/Command/Packaging.php 2006-11-08 21:12:50.723466165 +0200
-@@ -54,6 +54,11 @@
- 'arg' => 'FILE',
- 'doc' => 'Use FILE as RPM spec file template'
- ),
-+ 'output' => array(
-+ 'shortopt' => 'o',
-+ 'arg' => 'FILE',
-+ 'doc' => 'Use FILE as output filename'
-+ ),
- 'rpm-release' => array(
- 'shortopt' => 'r',
- 'arg' => 'RELEASE',
-@@ -98,7 +103,7 @@
- var $output;
+--- PEAR_Command_Packaging-0.2.0/usr/share/pear/PEAR/Command/Packaging.php 2010-08-21 02:49:57.027662427 +0300
++++ PEAR_Command_Packaging-0.2.0/usr/share/pear/PEAR/Command/Packaging.php 2010-08-21 02:49:27.971832168 +0300
+@@ -121,7 +121,7 @@
+ * $commands array above and in Packaging.xml so that it is consistent.
+ */
+ var $_rpm_pkgname_format = array(
+- 'pkg' => '%C::%s',
++ 'pkg' => 'php-pear-%s',
+ 'chan' => 'php-channel-%c',
+ );
- // The default format of the RPM package name
-- var $_rpm_pkgname_format = '%C::%s';
-+ var $_rpm_pkgname_format = 'php-pear-%s';
+@@ -142,7 +142,8 @@
+ var $_rpm_depname_format = array(
+ 'pkg' => '%P',
+ 'ext' => 'php-%l',
+- 'php' => 'php',
++ 'pecl-ext' => 'php-pecl-%l',
++ 'php' => 'php-common',
+ 'chan' => 'php-channel(%n)',
+ );
- // The default format of various dependencies that might be generated in the
- // spec file.
-@@ -113,7 +118,7 @@
- // the rpm-pkgname format string, with the addition of:
- // %v = package version
- // %P = use the same as whatever rpm_pkgname_format is set to be
-- var $_rpm_specname_format = '%P-%v.spec';
-+ var $_rpm_specname_format = '%P.spec';
-
- /**
- * PEAR_Command_Packaging constructor.
-@@ -172,7 +177,8 @@
- }
- $reg = &$this->config->getRegistry();
- $pkg = &$this->getPackageFile($this->config, $this->_debug);
-- $pf = &$pkg->fromAnyFile($params[0], PEAR_VALIDATE_NORMAL);
-+ $tarball = $params[0];
-+ $pf = &$pkg->fromAnyFile($tarball, PEAR_VALIDATE_NORMAL);
- if (PEAR::isError($pf)) {
- $u = $pf->getUserinfo();
- if (is_array($u)) {
-@@ -219,6 +225,10 @@
- } else {
- $info['release'] = '1';
+@@ -159,7 +160,7 @@
+ * chan - used when generating a spec file for a channel
+ */
+ var $_rpm_specname_format = array(
+- 'pkg' => '%P-%v.spec',
++ 'pkg' => '%P.spec',
+ 'chan' => 'php-channel-%c.spec'
+ );
+
+@@ -182,11 +183,11 @@
+ * need to be listed here
+ */
+ var $_file_prefixes = array(
+- 'php' => '%{_libdir}/php/pear',
++ 'php' => '%{php_pear_dir}',
+ 'doc' => '',
+- 'ext' => '%{_libdir}/php',
+- 'test' => '%{_libdir}/php/tests/%s',
+- 'data' => '%{_libdir}/php/data/%s',
++ 'ext' => '%{%php_extensiondir}',
++ 'test' => '%{php_pear_dir}/tests/%s',
++ 'data' => '%{php_pear_dir}/data/%s',
+ 'script' => '%{_bindir}',
+ 'cfg' => '%{_sysconfdir}/pear',
+ 'www' => '%{_datadir}/pear/www'
+@@ -197,7 +198,7 @@
+ * printf format. The first '%s' is the RPM header name followed by a colon,
+ * the second is the header value.
+ */
+- var $_spec_line_format = '%s %s';
++ var $_spec_line_format = "%s\t%s";
+
+ // ------------------------------------------------------------------------
+ // --- END DISTRIBUTION CONFIG
+@@ -247,6 +248,7 @@
+ 'test_dir' => '',
+ 'test_files_statement' => '',// empty string, or list of test files
+ 'www_files_statement' => '', // empty string, or newline-separated list of files with "www" role
++ '_noautoreq' => '', // no autoreqdep. PLD Linux specific
+ );
+
+ // The name of the template spec file to use
+@@ -335,10 +338,14 @@
+ if (isset($options['rpm-release'])) {
+ $this->_output['release'] = $options['rpm-release'];
}
+
-+ // pld specific, need source md5
-+ $info['tarball'] = $tarball;
-+ $info['tarball_md5'] = md5(file_get_contents($tarball));
++ // PLD Linux specific. need source md5
++ $this->_output['tarball'] = $source_file;
++ $this->_output['tarball_md5'] = md5(file_get_contents($source_file));
- // Work out the alias for the channel that this package is in
- $info['possible_channel'] = '';
-@@ -234,17 +244,19 @@
- $info['doc_files'] = array();
- $info['doc_files_relocation_script'] = '';
- $info['doc_files_statement'] = '';
-- $info['files'] = '';
-+ $info['files'] = array();
-+ $info['test_files'] = array();
-+ $info['data_files'] = array();
- $info['package2xml'] = '';
- $info['rpm_package'] = $this->_getRPMName($pf->getPackage(), $pf->getChannel());
- $info['pear_rpm_name'] = $this->_getRPMName('PEAR', 'pear.php.net', 'pkgdep');
-- $info['description'] = wordwrap($info['description']);
-+ $info['description'] = wordwrap($info['description'], 70);
+ // Set the PEAR RPM name for the PEAR core package
+ $this->_output['pear_rpm_name'] = $this->_getRPMName('PEAR', 'pear.php.net', null, 'pkgdep');
+-
++
+ // If source file ends in ".xml" we assume we are creating an RPM spec
+ // for a channel rather than an actual package
+ if (substr(strtolower($source_file), -4) == '.xml') {
+@@ -378,13 +385,40 @@
+ /**
+ * Format an RPM header line to be added to the spec file
+ * @param string $header The name of the RPM header to be added
+- * @param string $value The contents of the RPM header
++ * @param mixed $value The contents of the RPM header
+ * @return string
+ */
+- function _formatRpmHeader($header, $value)
++ function _formatRpmHeader($header, $values)
++ {
++ // PLD Linux: we want values sorted and each on their line
++ $values = (array )$values;
++ sort($values);
++ $ret = '';
++ foreach ($values as $value) {
++ $ret .= sprintf($this->_spec_line_format, $header . ':', $value) . "\n";
++ }
++ return $ret;
++ }
++
++
++ /*
++ * Get an version for RPM package.
++ *
++ * @param string $version Package version (e.g. '1.2.3RC1')
++ * @return string Normalized version
++ */
++ function _formatRpmVersion($version)
+ {
+- return sprintf($this->_spec_line_format, $header . ':', $value);
++
++ // In PLD Linux alpha, beta, rc versions are noted in Release: not Version: tag.
++ preg_match('/^(?P<version>[0-9.]+)(?P<extraversion>.*)$/', $version, $m);
++ if ($m['extraversion']) {
++ $version = "{$m['version']}-0.{$m['extraversion']}";
++ }
++
++ return $version;
+ }
++
+
+ /**
+ * Replace a macro in the output spec file
+@@ -457,7 +491,7 @@
- // Hook to support virtual provides, where the dependency name differs
- // from the package name
- $rpmdep = $this->_getRPMName($pf->getPackage(), $pf->getChannel(), 'pkgdep');
- if (!empty($rpmdep) && $rpmdep != $info['rpm_package']) {
-- $info['extra_headers'] .= "Provides: $rpmdep = " . $pf->getVersion(). "\n";
-+ $info['extra_headers'] .= "Provides:\t$rpmdep = " . $pf->getVersion(). "\n";
+ $rpmdep = $this->_getRPMName(null, $cf->getName(), $cf->getAlias(), 'chandep');
+ if (!empty($rpmdep) && $rpmdep != $this->_output['rpm_package']) {
+- $this->_output['extra_headers'] = $this->_formatRpmHeader('Provides', "$rpmdep") . "\n";
++ $this->_output['extra_headers'] = $this->_formatRpmHeader('Provides', $rpmdep) . "\n";
}
+
+ // Channels don't really have version numbers; this will need to be
+@@ -564,7 +598,7 @@
- $srcfiles = 0;
-@@ -253,44 +265,49 @@
- continue;
+ // Set up some of the basic macros
+ $this->_output['rpm_package'] = $this->_getRPMName($pf->getPackage(), $pf->getChannel(), null, 'pkg');
+- $this->_output['description'] = wordwrap($package_info['description']);
++ $this->_output['description'] = wordwrap($package_info['description'], 70);
+ $this->_output['summary'] = trim($package_info['summary']);
+ $this->_output['possible_channel'] = $pf->getChannel();
+ $this->_output['channel_alias'] = $this->_getChannelAlias($pf->getPackage(), $pf->getChannel());
+@@ -646,11 +680,13 @@
+ if (substr($this->_file_prefixes[$role], -2) == '%s') {
+ $this->_output[$macro_name] = str_replace('%s', $pf->getPackage(), $this->_file_prefixes[$role]);
+ } else {
++ $attr = '';
+ if ($role == 'cfg') {
+- $this->_output[$macro_name] = '%config(noreplace) ' . implode("\n%config(noreplace) ", $files);
+- } else {
+- $this->_output[$macro_name] = implode("\n", $files);
++ $attr = '%config(noreplace) %verify(not md5 mtime size) ';
++ } elseif ($role == 'script') {
++ $attr = '%attr(755,root,root) ';
+ }
++ $this->_output[$macro_name] = $attr . implode("\n$attr", $files);
}
- $name = preg_replace('![/:\\\\]!', '/', $name);
-- if ($attr['role'] == 'doc') {
-- $info['doc_files'][] .= $name;
-+ $name = str_replace('\\', '/', $name); ## XXX is this really neccessary?
-+
- // 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/" . $pf->getPackage();
-- break;
-- case 'data':
-- $prefix = "$c_prefix/data/" . $pf->getPackage();
-- break;
-- case 'script':
-- $prefix = '%{_bindir}';
-- break;
-- default: // non-standard roles
-- $prefix = "$c_prefix/$attr[role]/" . $pf->getPackage();
-- $info['extra_config'] .=
-- "\n -d {$attr[role]}_dir=$c_prefix/{$attr[role]} \\";
-- $this->ui->outputData('WARNING: role "' . $attr['role'] . '" used, ' .
-- 'and will be installed in "' . $c_prefix . '/' . $attr['role'] .
-- '/' . $pf->getPackage() .
-- ' - hand-edit the final .spec if this is wrong', $command);
-- break;
-- }
-- $name = str_replace('\\', '/', $name);
-- $info['files'] .= "$prefix/$name\n";
-- }
-+ $c_prefix = '%{php_pear_dir}';
-+ switch ($attr['role']) {
-+ case 'doc':
-+ $info['doc_files'][] = $name;
-+ break;
-+ case 'php':
-+ $info['files'][] = "$c_prefix/$name";
-+ break;
-+ case 'ext':
-+ $prefix = '%{extensionsdir}';
-+ $info['files'][] = "$prefix/$name";
-+ break; // XXX good place?
-+ case 'src':
-+ $srcfiles++;
-+ $prefix = '%{_includedir}/php';
-+ $info['files'][] = "$prefix/$name";
-+ break; // XXX good place?
-+ case 'test':
-+ $prefix = "$c_prefix/tests/" . $pf->getPackage();
-+ $info['test_files'][] = "$prefix/$name";
-+ break;
-+ case 'data':
-+ $prefix = "$c_prefix/data/" . $pf->getPackage();
-+ $info['data_files'][] = "$prefix/$name";
-+ break;
-+ case 'script':
-+ $prefix = '%{_bindir}';
-+ $info['files'][] = "$prefix/$name";
-+ break;
-+ default: // non-standard roles
-+ $prefix = "$c_prefix/$attr[role]/" . $pf->getPackage();
-+ $info['extra_config'] .=
-+ "\n -d {$attr[role]}_dir=$c_prefix/{$attr[role]} \\";
-+ $this->ui->outputData('WARNING: role "' . $attr['role'] . '" used, ' .
-+ 'and will be installed in "' . $c_prefix . '/' . $attr['role'] .
-+ '/' . $pf->getPackage() .
-+ ' - hand-edit the final .spec if this is wrong', $command);
-+ $info['files'][] = "$prefix/$name";
-+ break;
-+ }
- }
-
- $ndocs = count($info['doc_files']);
-@@ -305,6 +322,12 @@
- $info['doc_files_statement'] = '%doc ' . $info['doc_files'];
- $info['doc_files_relocation_script'] = "mv %{buildroot}/docs .\n";
}
-+
-+ $info['have_tests'] = count($info['test_files']);
-+
-+ $info['files'] = count($info['files']) > 0 ? join("\n", $info['files']) : '';
-+ $info['test_files'] = count($info['test_files']) > 0 ? join("\n", $info['test_files']) : '';
-+ $info['data_files'] = count($info['data_files']) > 0 ? join("\n", $info['data_files']) : '';
-
- if ($srcfiles > 0) {
- require_once 'OS/Guess.php';
-@@ -332,11 +355,27 @@
- $info['version'] = $pf->getVersion();
- $info['release_license'] = $pf->getLicense();
- $info['release_state'] = $pf->getState();
-+ @list($info['class'], $info['subclass']) = explode('_', $info['package'], 2);
-+ if (empty($info['subclass'])) {
-+ $info['subclass'] = '%{nil}';
-+ }
-+
- if ($pf->getDeps()) {
- if ($pf->getPackagexmlVersion() == '1.0') {
- $requires = $conflicts = array();
- foreach ($pf->getDeps() as $dep) {
- if (isset($dep['optional']) && $dep['optional'] == 'yes') {
-+ if ($dep['type'] == 'ext') {
-+ $info['optional-ext'][] = 'php-' . $dep['name'];
-+ } else {
-+ if ($dep['type'] == 'php') {
-+ # this doesn't make much sense, so ignore
-+ #$info['optional-php'][] = 'php-common';
-+ } else {
-+ $info['optional'][] = "'pear(". str_replace('_', '/', $dep['name']) . ".*)'";
-+ $info['optional-pkg'][] = 'php-pear-'. $dep['name'];
-+ }
-+ }
- continue;
- }
-
-@@ -368,6 +407,13 @@
- 'le' => '<=',
- 'eq' => '=',
- );
-+
-+ // known rpm epoches
-+ $epoches = array(
-+ 'php-common' => 3,
-+ 'php-pear-PEAR' => 1,
-+ );
-+
- if ($dep['rel'] == 'has') {
- // We use $package as the index to the $requires array to de-duplicate deps.
- // Note that in the case of duplicate deps, versioned deps will "win" - see several lines down.
-@@ -375,16 +421,22 @@
- } elseif ($dep['rel'] == 'not') {
- $conflicts[] = $package;
- } elseif ($dep['rel'] == 'ne') {
-- $conflicts[] = $package . ' = ' . $dep['version'];
-+ $epoch = isset($epoches[$package]) ? ($epoches[$package] . ':') : '';
-+ $conflicts[] = $package . ' = ' . $epoch . $dep['version'];
- } elseif (isset($trans[$dep['rel']])) {
-- $requires[$package] = $package . ' ' . $trans[$dep['rel']] . ' ' . $dep['version'];
-+ $epoch = isset($epoches[$package]) ? ($epoches[$package] . ':') : '';
-+ $requires[$package] = $package . ' ' . $trans[$dep['rel']] . ' ' . $epoch . $dep['version'];
- }
- }
- if (count($requires)) {
-- $info['extra_headers'] .= 'Requires: ' . implode(', ', $requires) . "\n";
-+ foreach ($requires as $dep) {
-+ $info['extra_headers'] .= "Requires:\t" . $dep . "\n";
-+ }
+ $this->_output['files'] = trim($this->_output['files']);
+@@ -685,12 +721,10 @@
+
+ function _generatePackageDeps($pf)
+ {
+- $requires = $conflicts = array();
++ $buildrequires = $requires = $conflicts = $suggests = array();
+ if ($pf->getPackagexmlVersion() == '1.0') {
+ foreach ($pf->getDeps() as $dep) {
+- if (isset($dep['optional']) && $dep['optional'] == 'yes') {
+- continue;
+- }
++ $optional = isset($dep['optional']) && $dep['optional'] == 'yes';
+
+ if (!isset($dep['type']) || $dep['type'] == 'pkg') {
+ $type = 'pkgdep';
+@@ -725,21 +759,25 @@
+ if ($dep['rel'] == 'has') {
+ // We use $package as the index to the $requires array to de-duplicate deps.
+ // Note that in the case of duplicate deps, versioned deps will "win" - see several lines down.
+- $requires[$package] = $package;
++ if ($optional) {
++ $suggests[$package] = $package;
++ } else {
++ $requires[$package] = $package;
++ }
+ } elseif ($dep['rel'] == 'not') {
+ $conflicts[] = $package;
+ } elseif ($dep['rel'] == 'ne') {
+- $conflicts[] = $package . ' = ' . $dep['version'];
++ $version = $this->_formatRpmVersion($dep['version']);
++ $conflicts[] = $package . ' = ' . $version;
+ } elseif (isset($trans[$dep['rel']])) {
+- $requires[$package] = $package . ' ' . $trans[$dep['rel']] . ' ' . $dep['version'];
++ $version = $this->_formatRpmVersion($dep['version']);
++ if ($optional) {
++ $suggests[$package] = $package . ' ' . $trans[$dep['rel']] . ' ' . $version;
++ } else {
++ $requires[$package] = $package . ' ' . $trans[$dep['rel']] . ' ' . $version;
++ }
}
- if (count($conflicts)) {
-- $info['extra_headers'] .= 'Conflicts: ' . implode(', ', $conflicts) . "\n";
-+ foreach ($conflicts as $dep) {
-+ $info['extra_headers'] .= "Conflicts:\t" . $dep . "\n";
-+ }
+ }
+- if (count($requires)) {
+- $this->_output['extra_headers'] .= $this->_formatRpmHeader('Requires', implode(', ', $requires)) . "\n";
+- }
+- if (count($conflicts)) {
+- $this->_output['extra_headers'] .= $this->_formatRpmHeader('Conflicts', implode(', ', $conflicts)) . "\n";
+- }
+ } else {
+ $this->_output['package2xml'] = '2'; // tell the spec to use package2.xml
+ $deps = $pf->getDeps(true);
+@@ -842,10 +880,10 @@
+ }
+ } else {
+ if (isset($dep['min'])) {
+- $requires[$package] = $package . ' >= ' . $dep['min'];
++ $requires[$package] = $package . ' >= ' . $this->_formatRpmVersion($dep['min']);
+ }
+ if (isset($dep['max'])) {
+- $requires[$package] = $package . ' <= ' . $dep['max'];
++ $requires[$package] = $package . ' <= ' . $this->_formatRpmVersion($dep['max']);
+ }
+ if (isset($dep['exclude'])) {
+ $ex = $dep['exclude'];
+@@ -864,18 +902,109 @@
+ $a = $tar->extractInString('package2.xml');
+ $tar->popErrorHandling();
+ if ($a === null || PEAR::isError($a)) {
+- $this->_output['package2xml'] = '';
+ // this doesn't have a package.xml version 1.0
+- $requires[$this->_output['pear_rpm_name']] = $this->_output['pear_rpm_name'] . ' >= ' .
+- $deps['required']['pearinstaller']['min'];
++ $this->_output['package2xml'] = '';
++ $version = $this->_formatRpmVersion($deps['required']['pearinstaller']['min']);
++ // PLD linux hack: include epoch for PEAR package
++ $version = "1:{$version}";
++ $buildrequires[$this->_output['pear_rpm_name']] = $this->_output['pear_rpm_name'] . ' >= ' . $version;
}
- } else {
- $info['package2xml'] = '2'; // tell the spec to use package2.xml
-@@ -515,18 +567,60 @@
- $requires[$info['pear_rpm_name']] = $info['pear_rpm_name'] . ' >= ' .
- $deps['required']['pearinstaller']['min'];
- }
-- if (count($requires)) {
-- $info['extra_headers'] .= 'Requires: ' . implode(', ', $requires) . "\n";
-- }
-- if (count($conflicts)) {
-- $info['extra_headers'] .= 'Conflicts: ' . implode(', ', $conflicts) . "\n";
-- }
-+ if (count($requires)) {
-+ foreach ($requires as $dep) {
-+ $info['extra_headers'] .= "Requires:\t" . $dep . "\n";
-+ }
-+ }
-+ if (count($conflicts)) {
-+ foreach ($conflicts as $dep) {
-+ $info['extra_headers'] .= "Conflicts:\t" . $dep . "\n";
-+ }
-+ }
+- if (count($requires)) {
+- $this->_output['extra_headers'] .= $this->_formatRpmHeader('Requires', implode(', ', $requires)) . "\n";
++ }
++
++ if (isset($deps['required']['extension'])) {
++ if (!isset($deps['required']['extension'][0])) {
++ $deps['required']['extension'] = array($deps['required']['extension']);
}
-- }
-- }
+- if (count($conflicts)) {
+- $this->_output['extra_headers'] .= $this->_formatRpmHeader('Conflicts', implode(', ', $conflicts)) . "\n";
++ foreach ((array )$deps['required']['extension'] as $dep) {
++ if (!isset($dep['channel'])) $dep['channel'] = null;
++ // $package contains the *dependency name* here, which may or may
++ // not be the same as the package name
++ $package = $this->_getRPMName($dep['name'], $dep['channel'], null, 'ext');
++
++ if (empty($package)) {
++ continue;
++ }
+
-+ if (isset($deps['optional']['package'])) {
-+ $a = $deps['optional']['package'];
-+ foreach ((isset($a[0]) ? $a : array($a)) as $dep) {
-+ $info['optional'][] = "'pear(". str_replace('_', '/', $dep['name']) . ".*)' ";
-+ $info['optional-pkg'][] = 'php-pear-'. $dep['name'];
-+ }
-+ }
-+ if (isset($deps['optional']['extension'])) {
-+ $a = $deps['optional']['extension'];
-+ foreach (isset($a[0]) ? $a : array($a) as $dep) {
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR-template.spec?r1=1.20&r2=1.21&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.patch?r1=1.6&r2=1.7&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pear-PEAR_Command_Packaging/php-pear-PEAR_Command_Packaging.spec?r1=1.14&r2=1.15&f=u
More information about the pld-cvs-commit
mailing list