SOURCES: php-pear-PEAR-rpmvars.patch, php-pear-PEAR-template.spec ...

glen glen at pld-linux.org
Wed Sep 28 22:40:36 CEST 2005


Author: glen                         Date: Wed Sep 28 20:40:35 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- handle _noautoreq and %doc files

---- Files affected:
SOURCES:
   php-pear-PEAR-rpmvars.patch (1.5 -> 1.6) , php-pear-PEAR-template.spec (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/php-pear-PEAR-rpmvars.patch
diff -u SOURCES/php-pear-PEAR-rpmvars.patch:1.5 SOURCES/php-pear-PEAR-rpmvars.patch:1.6
--- SOURCES/php-pear-PEAR-rpmvars.patch:1.5	Wed Sep 28 22:23:41 2005
+++ SOURCES/php-pear-PEAR-rpmvars.patch	Wed Sep 28 22:40:30 2005
@@ -72,3 +72,62 @@
                      }
                  }
              }
+--- .//usr/share/pear/PEAR/Command/Package.php	2005-09-28 23:25:11.000000000 +0300
++++ /usr/share/pear/PEAR/Command/Package.php	2005-09-28 23:39:21.000000000 +0300
+@@ -814,7 +814,7 @@
+         }
+ 
+         $info['extra_headers'] = '';
+-        $info['doc_files'] = '';
++        $info['doc_files'] = array();
+         $info['files'] = '';
+         $info['package2xml'] = '';
+         $info['rpm_package'] = sprintf($rpm_pkgname_format, $pf->getPackage());
+@@ -825,7 +825,7 @@
+             }
+             $name = preg_replace('![/:\\\\]!', '/', $name);
+             if ($attr['role'] == 'doc') {
+-                $info['doc_files'] .= " $name";
++                $info['doc_files'][] = $name;
+             // Map role to the rpm vars
+             } else {
+                 $c_prefix = '%{_libdir}/php/pear';
+@@ -863,6 +863,16 @@
+                 $info['files'] .= "$prefix/$name\n";
+             }
+         }
++
++		$ndocs = count($info['doc_files']);
++		if ($ndocs > 1) {
++			$info['doc_files'] = '%doc docs/%{_pearname}/{' . join(',', $info['doc_files']) . '}';
++		} elseif ($ndocs > 0) {
++			$info['doc_files'] = '%doc docs/%{_pearname}/' . join(',', $info['doc_files']);
++		} else {
++			$info['doc_files'] = '';
++		}
++
+         if ($srcfiles > 0) {
+             require_once 'OS/Guess.php';
+             $os = new OS_Guess;
+@@ -894,10 +904,13 @@
+ 			$info['subclass'] = '%{nil}';
+ 		}
+         if ($pf->getDeps()) {
++			$info['optional'] = '';
++
+             if ($pf->getPackagexmlVersion() == '1.0') {
+                 $requires = $conflicts = array();
+                 foreach ($pf->getDeps() as $dep) {
+                     if (isset($dep['optional']) && $dep['optional'] == 'yes') {
++						$info['optional'] .= "'pear(". str_replace('_', '/', $dep['name']) . ".*)' ";
+                         continue;
+                     }
+                     if ($dep['type'] != 'pkg') {
+@@ -1020,6 +1033,7 @@
+ 
+         // remove the trailing newline
+         $info['extra_headers'] = trim($info['extra_headers']);
++        $info['optional'] = trim($info['optional']);
+         if (function_exists('file_get_contents')) {
+             fclose($fp);
+             $spec_contents = preg_replace('/@([a-z0-9_-]+)@/e', '$info["\1"]',

================================================================
Index: SOURCES/php-pear-PEAR-template.spec
diff -u SOURCES/php-pear-PEAR-template.spec:1.3 SOURCES/php-pear-PEAR-template.spec:1.4
--- SOURCES/php-pear-PEAR-template.spec:1.3	Wed Sep 28 22:16:39 2005
+++ SOURCES/php-pear-PEAR-template.spec	Wed Sep 28 22:40:30 2005
@@ -22,7 +22,7 @@
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # exclude optional dependencies
-#define		_noautoreq	'pear(XML/Beautifier/.*)'
+%define		_noautoreq	@optional@
 
 %description
 @description@
@@ -66,7 +66,7 @@
 %files
 %defattr(644,root,root,755)
 %doc install.log optional-packages.txt
-%doc @doc_files@
+ at doc_files@
 %{php_pear_dir}/.registry/*.reg
 %{php_pear_dir}/%{_class}/*.php
 
@@ -82,6 +82,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2005/09/28 20:40:30  glen
+- handle _noautoreq and %doc files
+
 Revision 1.3  2005/09/28 20:16:39  glen
 - extra_headers are pldized now
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/php-pear-PEAR-rpmvars.patch?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/SOURCES/php-pear-PEAR-template.spec?r1=1.3&r2=1.4&f=u




More information about the pld-cvs-commit mailing list