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

glen glen at pld-linux.org
Wed Sep 28 22:55:50 CEST 2005


Author: glen                         Date: Wed Sep 28 20:55:50 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- handle optional deps and optional tests
- handle different file classes

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

---- Diffs:

================================================================
Index: SOURCES/php-pear-PEAR-rpmvars.patch
diff -u SOURCES/php-pear-PEAR-rpmvars.patch:1.6 SOURCES/php-pear-PEAR-rpmvars.patch:1.7
--- SOURCES/php-pear-PEAR-rpmvars.patch:1.6	Wed Sep 28 22:40:30 2005
+++ SOURCES/php-pear-PEAR-rpmvars.patch	Wed Sep 28 22:55:45 2005
@@ -131,3 +131,57 @@
          if (function_exists('file_get_contents')) {
              fclose($fp);
              $spec_contents = preg_replace('/@([a-z0-9_-]+)@/e', '$info["\1"]',
+--- .//usr/share/pear/PEAR/Command/Package.php	2005-09-28 23:55:36.000000000 +0300
++++ /usr/share/pear/PEAR/Command/Package.php	2005-09-28 23:55:06.000000000 +0300
+@@ -816,6 +816,8 @@
+         $info['extra_headers'] = '';
+         $info['doc_files'] = array();
+         $info['files'] = '';
++        $info['test_files'] = '';
++        $info['data_files'] = '';
+         $info['package2xml'] = '';
+         $info['rpm_package'] = sprintf($rpm_pkgname_format, $pf->getPackage());
+         $srcfiles = 0;
+@@ -828,7 +830,7 @@
+                 $info['doc_files'][] = $name;
+             // Map role to the rpm vars
+             } else {
+-                $c_prefix = '%{_libdir}/php/pear';
++                $c_prefix = '%{php_pear_dir}';
+                 switch ($attr['role']) {
+                     case 'php':
+                         $prefix = $c_prefix;
+@@ -860,7 +862,15 @@
+                     break;
+                 }
+                 $name = str_replace('\\', '/', $name);
+-                $info['files'] .= "$prefix/$name\n";
++				if ($attr['role'] == 'test') {
++					$info['test_files'] .= "$prefix/$name\n";
++
++				} elseif ($attr['role'] == 'data') {
++					$info['data_files'] .= "$prefix/$name\n";
++
++				} else {
++					$info['files'] .= "$prefix/$name\n";
++				}
+             }
+         }
+ 
+@@ -872,6 +882,7 @@
+ 		} else {
+ 			$info['doc_files'] = '';
+ 		}
++		$info['have_tests'] = (count($info['test_files']) > 0) + 0;
+ 
+         if ($srcfiles > 0) {
+             require_once 'OS/Guess.php';
+@@ -1034,6 +1045,8 @@
+         // remove the trailing newline
+         $info['extra_headers'] = trim($info['extra_headers']);
+         $info['optional'] = trim($info['optional']);
++		$info['have_optional_deps'] = (strlen($info['optional']) > 0) + 0;
++
+         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.4 SOURCES/php-pear-PEAR-template.spec:1.5
--- SOURCES/php-pear-PEAR-template.spec:1.4	Wed Sep 28 22:40:30 2005
+++ SOURCES/php-pear-PEAR-template.spec	Wed Sep 28 22:55:45 2005
@@ -18,6 +18,9 @@
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 Requires:	php-pear
 @extra_headers@
+%if !@have_tests@
+Obsoletes:	%{name}-tests
+%endif
 BuildArch:	@arch@
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -58,23 +61,29 @@
 %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
+%endif
 
 %files
 %defattr(644,root,root,755)
 %doc install.log optional-packages.txt
+%if @have_optional_deps@
+%doc optional-packages.txt
+%endif
 @doc_files@
 %{php_pear_dir}/.registry/*.reg
-%{php_pear_dir}/%{_class}/*.php
-
-%{php_pear_dir}/data/%{_pearname}
+ at files@
+ at data_files@
 
+%if @have_tests@
 %files tests
 %defattr(644,root,root,755)
-%{php_pear_dir}/tests/*
+ at test_files@
+%endif
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -82,6 +91,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.5  2005/09/28 20:55:45  glen
+- handle optional deps and optional tests
+- handle different file classes
+
 Revision 1.4  2005/09/28 20:40:30  glen
 - handle _noautoreq and %doc files
 
================================================================

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




More information about the pld-cvs-commit mailing list