rpms/php-pear/devel LICENSE, NONE, 1.1 php-pear-1.4.8-package.patch, NONE, 1.1 php-pear-1.4.8-template.patch, NONE, 1.1 .cvsignore, 1.4, 1.5 php-pear.spec, 1.9, 1.10 sources, 1.4, 1.5

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon May 8 09:34:03 UTC 2006


Author: jorton

Update of /cvs/dist/rpms/php-pear/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv8514

Modified Files:
	.cvsignore php-pear.spec sources 
Added Files:
	LICENSE php-pear-1.4.8-package.patch 
	php-pear-1.4.8-template.patch 
Log Message:
* Mon May  8 2006 Joe Orton <jorton at redhat.com> 1:1.4.9-2
- update to 1.4.9 (thanks to Remi Collet, #183359)
- package /usr/share/pear/.pkgxml (#190252)
- update to XML_RPC-1.4.8
- bundle the v3.0 LICENSE file



--- NEW FILE LICENSE ---
-------------------------------------------------------------------- 
                  The PHP License, version 3.0
Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
-------------------------------------------------------------------- 

Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
 
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.
 
  3. The name "PHP" must not be used to endorse or promote products
     derived from this software without prior written permission. For
     written permission, please contact group at php.net.
  
  4. Products derived from this software may not be called "PHP", nor
     may "PHP" appear in their name, without prior written permission
     from group at php.net.  You may indicate that your software works in
     conjunction with PHP by saying "Foo for PHP" instead of calling
     it "PHP Foo" or "phpfoo"
 
  5. The PHP Group may publish revised and/or new versions of the
     license from time to time. Each version will be given a
     distinguishing version number.
     Once covered code has been published under a particular version
     of the license, you may always continue to use it under the terms
     of that version. You may also choose to use such covered code
     under the terms of any subsequent version of the license
     published by the PHP Group. No one other than the PHP Group has
     the right to modify the terms applicable to covered code created
     under this License.

  6. Redistributions of any form whatsoever must retain the following
     acknowledgment:
     "This product includes PHP, freely available from
     <http://www.php.net/>".

THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

-------------------------------------------------------------------- 

This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.

The PHP Group can be contacted via Email at group at php.net.

For more information on the PHP Group and the PHP project, 
please see <http://www.php.net>.

This product includes the Zend Engine, freely available at
<http://www.zend.com>.

php-pear-1.4.8-package.patch:
 Package.php |  202 +++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 160 insertions(+), 42 deletions(-)

--- NEW FILE php-pear-1.4.8-package.patch ---
--- PEAR/Command/Package.php.orig	2006-03-13 19:00:47.000000000 +0100
+++ PEAR/Command/Package.php	2006-03-13 19:01:32.000000000 +0100
@@ -205,12 +205,28 @@
                     'arg' => 'FILE',
                     'doc' => 'Use FILE as RPM spec file template'
                     ),
+                'rpm-release' => array(
+                    'shortopt' => 'r',
+                    'arg' => 'RELEASE',
+                    'doc' => 'RPM release version. Defaults to "1".'
+                    ),
                 'rpm-pkgname' => array(
                     'shortopt' => 'p',
                     'arg' => 'FORMAT',
-                    'doc' => 'Use FORMAT as format string for RPM package name, %s is replaced
-by the PEAR package name, defaults to "PEAR::%s".',
+                    'doc' => 'Use FORMAT as format string for RPM package name. Substitutions
+are as follows:
+%s = PEAR package name
+%S = PEAR package name (with underscores replaced with hyphens)
+%C = Channel alias
+%c = Channel alias, lowercased
+Defaults to "php-%c-%S".',
                     ),
+                'rpm-depname' => array(
+                    'shortopt' => 'd',
+                    'arg' => 'FORMAT',
+                    'doc' => 'Use FORMAT as format string for RPM package name. Substitutions
+are as for the --rpm-pkgname option. Defaults to "php-%c(%s)"',
+                   ),
                 ),
             'doc' => '<package-file>
 
@@ -219,10 +235,10 @@
 package tarball in the SOURCES directory:
 
 $ pear makerpm ../SOURCES/Net_Socket-1.0.tgz
-Wrote RPM spec file PEAR::Net_Geo-1.0.spec
-$ rpm -bb PEAR::Net_Socket-1.0.spec
+Wrote RPM spec file php-pear-Net-Socket.spec
+$ rpm -bb php-pear-Net-Socket.spec
 ...
-Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
+Wrote: /usr/src/redhat/RPMS/i386/php-pear-Net-Socket-1.0-1.i386.rpm
 ',
             ),
         'convert' => array(
@@ -730,7 +746,7 @@
         $a = &new PEAR_Installer($ui);
         return $a;
     }
-    
+
     /**
      * For unit testing purposes
      */
@@ -816,28 +832,42 @@
         }
         $info['possible_channel'] = '';
         $info['extra_config'] = '';
+        
         if (isset($options['rpm-pkgname'])) {
             $rpm_pkgname_format = $options['rpm-pkgname'];
         } else {
-            if ($pf->getChannel() == 'pear.php.net' || $pf->getChannel() == 'pecl.php.net') {
-                $alias = 'PEAR';
-            } else {
-                $chan = &$reg->getChannel($pf->getChannel());
-                if (PEAR::isError($chan)) {
-                    return $this->raiseError($chan);
-                }
-                $alias = $chan->getAlias();
-                $alias = strtoupper($alias);
-                $info['possible_channel'] = $pf->getChannel() . '/';
-            }
-            $rpm_pkgname_format = $alias . '::%s';
+            $rpm_pkgname_format = 'php-%c-%S';
+        }
+        
+        if (isset($options['rpm-depname'])) {
+            $rpm_depname_format = $options['rpm-depname'];
+        } else {
+            $rpm_depname_format = 'php-%c(%s)';
+        }
+        
+        if (isset($options['rpm-release'])) {
+            $info['release'] = $options['rpm-release'];
+        } else {
+            $info['release'] = '1';
+        }
+        
+        $alias = $this->_getChannelAlias($pf->getChannel(), $pf->getPackage());
+        if ($alias != 'PEAR' && $alias != 'PECL') {
+            $info['possible_channel'] = $pf->getChannel() . '/';
         }
 
         $info['extra_headers'] = '';
         $info['doc_files'] = '';
         $info['files'] = '';
         $info['package2xml'] = '';
-        $info['rpm_package'] = sprintf($rpm_pkgname_format, $pf->getPackage());
+        $info['rpm_package'] = $this->_getRPMNameFromFormat($rpm_pkgname_format, $pf->getPackage(), $alias);
+        
+        // Hook to support virtual provides, where the dependency name differs
+        // from the package name
+        if ($rpm_pkgname_format != $rpm_depname_format) {
+            $info['extra_headers'] .= 'Provides: ' . $this->_getRPMNameFromFormat($rpm_depname_format, $pf->getPackage(), $alias) . ' = ' . $pf->getVersion(). "\n";
+        }
+        
         $srcfiles = 0;
         foreach ($info['filelist'] as $name => $attr) {
             if (!isset($attr['role'])) {
@@ -848,7 +878,7 @@
                 $info['doc_files'] .= " $name";
             // Map role to the rpm vars
             } else {
-                $c_prefix = '%{_libdir}/php/pear';
+                $c_prefix = '%{_datadir}/pear';
                 switch ($attr['role']) {
                     case 'php':
                         $prefix = $c_prefix;
@@ -897,7 +927,7 @@
                 $chan = $reg->getChannel($pf->getChannel());
                 if (PEAR::isError($chan)) {
                     return $this->raiseError($chan);
-                }
+		}
                 $info[$k] = $chan->getServer();
                 continue;
             }
@@ -918,18 +948,25 @@
                     if (isset($dep['optional']) && $dep['optional'] == 'yes') {
                         continue;
                     }
-                    if ($dep['type'] != 'pkg') {
-                        continue;
-                    }
-                    if (isset($dep['channel']) && $dep['channel'] != 'pear.php.net' &&
-                          $dep['channel'] != 'pecl.php.net') {
-                        $chan = &$reg->getChannel($dep['channel']);
-                        if (PEAR::isError($chan)) {
-                            return $this->raiseError($chan);
-                        }
-                        $package = strtoupper($chan->getAlias()) . '::' . $dep['name'];
-                    } else {
-                        $package = 'PEAR::' . $dep['name'];
+                    
+                    switch ($dep['type']) {
+                        case 'pkg':
+                            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->_getRPMNameFromFormat($rpm_depname_format, $dep['name'], $this->_getChannelAlias($dep['channel'], $dep['name']));
+                            break;
+                        case 'ext':
+                            // This only works if all PHP extensions are either in their own
+                            // package, and/or the main package Provides: php-[extname] for
+                            // built-in extensions
+                            $package = 'php-'.$dep['name'];
+                            break;
+                        case 'php':
+                            $package = 'php';
+                            break;
+                        default:
+                            continue;
                     }
                     $trans = array(
                         '>' => '>',
@@ -968,15 +1005,10 @@
                         $deps['required']['package'] = array($deps['required']['package']);
                     }
                     foreach ($deps['required']['package'] as $dep) {
-                        if ($dep['channel'] != 'pear.php.net' &&  $dep['channel'] != 'pecl.php.net') {
-                            $chan = &$reg->getChannel($dep['channel']);
-                            if (PEAR::isError($chan)) {
-                                return $this->raiseError($chan);
-                            }
-                            $package = strtoupper($chan->getAlias()) . '::' . $dep['name'];
-                        } else {
-                            $package = 'PEAR::' . $dep['name'];
-                        }
+                        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->_getRPMNameFromFormat($rpm_depname_format, $dep['name'], $this->_getChannelAlias($dep['channel'], $dep['name']));
                         if (isset($dep['conflicts']) && (isset($dep['min']) ||
                               isset($dep['max']))) {
                             $deprange = array();
@@ -1113,6 +1145,92 @@
 
         return true;
     }
+    
+    // }}}
+    // {{{ _getChannelAlias()
+    /*
+     * Return a channel alias from a channel name
+     *
+     * @param  string $chan_name    Channel name (e.g. 'pecl.php.net')
+     * @param  string $package_name Optional name of the PEAR package to which $chan_name relates.
+     *                              Assists when "guessing" channel aliases for PEAR/PECL  
+     * @return string Channel alias (e.g. 'PECL')
+     */
+    
+    function _getChannelAlias($chan_name, $package_name = null)
+    {
+        switch($chan_name) {
+            case null:
+            case '':
+                // If channel name not supplied, it is presumably
+                // either PEAR or PECL. There's no sure-fire way of
+                // telling between the two, but we try to make an
+                // intelligent guess: if the package name is supplied
+                // and starts with a lowercase letter, it's PECL.
+                if (ereg('^[a-z]', $package_name)) {
+                    $alias = 'PECL';
+                } else {
+                    $alias = 'PEAR';
+                }
+                break;
+            case 'pear.php.net':
+                $alias = 'PEAR';
+                break;
+            case 'pecl.php.net':
+                $alias = 'PECL';
+                break;
+            default:
+                $reg = &$this->config->getRegistry();
+                $chan = &$reg->getChannel($pf->getChannel());
+                if (PEAR::isError($chan)) {
+                	return $this->raiseError($chan);
+                }
+                $alias = $chan->getAlias();
+                $alias = strtoupper($alias);
+                break;
+         }
+         return $alias;
+    }
+    
+    // }}}
+    // {{{ _getRPMNameFromFormat()
+    
+    /*
+     * Get an RPM package or dependency name from a format string
+     *
+     * This method generates an RPM package or dependency name based on
+     * a format string containing substitution variables, rather like
+     * sprintf(). It supports the following substitution variables:
+     * %s = package name
+     * %S = package name, with underscores replaced with hyphens
+     * %C = channel alias
+     * %c = channel alias, lowercased
+     *
+     * @param  string $format            Format string
+     * @param  string $pear_package_name PEAR package name (e.g. Example_Package)
+     * @param  string $channel_alias     Channel alias (e.g. 'PEAR', 'PECL')
+     * @return string RPM package/dependency name
+     */
+    
+    function _getRPMNameFromFormat($format, $pear_package_name, $channel_alias)
+    {
+        // The package name
+        $name = str_replace('%s', $pear_package_name, $format);
+        
+        // The package name, with underscores replaced with hyphens
+        $name = str_replace('%S', str_replace('_', '-', $pear_package_name), $name);
+        
+        // The channel alias
+        $name = str_replace('%C', $channel_alias, $name);
+        
+        // The channel alias, lowercased
+        $name = str_replace('%c', strtolower($channel_alias), $name);
+        
+        return $name;
+    }
+    
+    // }}}
+    // {{{ doConvert()
 
     function doConvert($command, $options, $params)
     {

php-pear-1.4.8-template.patch:
 template.spec |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

--- NEW FILE php-pear-1.4.8-template.patch ---
--- data/PEAR/template.spec.orig	2006-03-13 17:57:44.000000000 +0100
+++ data/PEAR/template.spec	2006-03-13 18:27:51.000000000 +0100
@@ -1,7 +1,9 @@
+%define peardir %(pear config-get php_dir 2> /dev/null || echo %{_datadir}/pear)
+
 Summary: PEAR: @summary@
 Name: @rpm_package@
 Version: @version@
-Release: 1
+Release: @release@
 License: @release_license@
 Group: Development/Libraries
 Source: http://@master_server@/get/@package@-%{version}.tgz
@@ -19,11 +21,11 @@
 %setup -c -T
 # XXX Source files location is missing here in pear cmd
 pear -v -c %{buildroot}/pearrc \
-        -d php_dir=%{_libdir}/php/pear \
+        -d php_dir=%{peardir} \
         -d doc_dir=/docs \
         -d bin_dir=%{_bindir} \
-        -d data_dir=%{_libdir}/php/pear/data \
-        -d test_dir=%{_libdir}/php/pear/tests \
+        -d data_dir=%{peardir}/data \
+        -d test_dir=%{peardir}/tests \
         -d ext_dir=%{_libdir} \@extra_config@
         -s
 
@@ -33,40 +35,41 @@
 %postun
 # if refcount = 0 then package has been removed (not upgraded)
 if [ "$1" -eq "0" ]; then
-    pear uninstall --nodeps -r @possible_channel@@package@
-    rm @rpm_xml_dir@/@package at .xml
+    pear uninstall --nodeps --ignore-errors --register-only @possible_channel@@package@
 fi
 
 
 %post
 # if refcount = 2 then package has been upgraded
 if [ "$1" -ge "2" ]; then
-    pear upgrade --nodeps -r @rpm_xml_dir@/@package at .xml
+    pear upgrade --nodeps --soft --force --register-only @rpm_xml_dir@/@package at .xml
 else
-    pear install --nodeps -r @rpm_xml_dir@/@package at .xml
+    pear install --nodeps --soft --force --register-only @rpm_xml_dir@/@package at .xml
 fi
 
 %install
 pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \
         $RPM_SOURCE_DIR/@package at -%{version}.tgz
+
 rm %{buildroot}/pearrc
-rm %{buildroot}/%{_libdir}/php/pear/.filemap
-rm %{buildroot}/%{_libdir}/php/pear/.lock
-rm -rf %{buildroot}/%{_libdir}/php/pear/.registry
+rm %{buildroot}/%{peardir}/.filemap
+rm %{buildroot}/%{peardir}/.lock
+rm -rf %{buildroot}/%{peardir}/.registry
+rm -rf %{buildroot}/%{peardir}/.channels
+rm %{buildroot}/%{peardir}/.depdb
+rm %{buildroot}/%{peardir}/.depdblock
+
 if [ "@doc_files@" != "" ]; then
      mv %{buildroot}/docs/@package@/* .
      rm -rf %{buildroot}/docs
 fi
+
 mkdir -p %{buildroot}@rpm_xml_dir@
 tar -xzf $RPM_SOURCE_DIR/@package at -%{version}.tgz package at package2xml@.xml
 cp -p package at package2xml@.xml %{buildroot}@rpm_xml_dir@/@package at .xml
 
-#rm -rf %{buildroot}/*
-#pear -q install -R %{buildroot} -n package at package2xml@.xml
-#mkdir -p %{buildroot}@rpm_xml_dir@
-#cp -p package at package2xml@.xml %{buildroot}@rpm_xml_dir@/@package at .xml
-
 %files
     %defattr(-,root,root)
     %doc @doc_files@
-    /
+    %{peardir}/*
+    @rpm_xml_dir@/@package at .xml


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/php-pear/devel/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	13 Jan 2006 11:26:55 -0000	1.4
+++ .cvsignore	8 May 2006 09:33:54 -0000	1.5
@@ -1,3 +1,8 @@
 XML_RPC-1.4.4.tgz
 install-pear-nozlib-1.4.5.phar
 install-pear-nozlib-1.4.6.phar
+XML_RPC-1.4.8.tgz
+install-pear-nozlib-1.4.9.phar
+noarch
+clog
+*.src.rpm


Index: php-pear.spec
===================================================================
RCS file: /cvs/dist/rpms/php-pear/devel/php-pear.spec,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- php-pear.spec	28 Feb 2006 13:46:12 -0000	1.9
+++ php-pear.spec	8 May 2006 09:33:59 -0000	1.10
@@ -1,27 +1,26 @@
 
 %define peardir %{_datadir}/pear
 
-%define xmlrpcver 1.4.4
+%define xmlrpcver 1.4.8
 
 Summary: PHP Extension and Application Repository framework
 Name: php-pear
-Version: 1.4.6
+Version: 1.4.9
 Release: 2
 Epoch: 1
-License: PHP
+License: The PHP License 3.0
 Group: System
 URL: http://pear.php.net/package/PEAR
 Source0: install-pear-nozlib-%{version}.phar
 Source2: relocate.php
 Source3: strip.php
+Source4: LICENSE
 Source10: pear.sh
 Source11: pecl.sh
 Source12: peardev.sh
-Source20: XML_RPC-%{xmlrpcver}.tgz
-Patch0: php-pear-1.4.5-template-fixes.patch
-Patch1: php-pear-1.4.5-template-postun.patch
-Patch2: php-pear-1.4.5-makerpm-cleanup.patch
-Patch3: php-pear-1.4.5-makerpm-rh-namingconvs.patch
+Source20: http://pear.php.net/get/XML_RPC-%{xmlrpcver}.tgz
+Patch0: php-pear-1.4.8-template.patch
+Patch1: php-pear-1.4.8-package.patch
 BuildArchitectures: noarch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: php >= 5.1.0-1
@@ -52,10 +51,8 @@
                  %{SOURCE20}
 
 pushd %{buildroot}%{peardir}
-%{__patch} -p0 data/PEAR/template.spec %{PATCH0}
-%{__patch} -p1 data/PEAR/template.spec %{PATCH1}
-%{__patch} -p0 < %{PATCH2}
-%{__patch} -p0 < %{PATCH3}
+%{__patch} -p0 < %{PATCH0}
+%{__patch} -p0 < %{PATCH1}
 popd
 
 # Replace /usr/bin/* with simple scripts:
@@ -64,7 +61,8 @@
 done
 
 install -d $RPM_BUILD_ROOT%{_sysconfdir} \
-           $RPM_BUILD_ROOT%{_localstatedir}/cache/php-pear
+           $RPM_BUILD_ROOT%{_localstatedir}/cache/php-pear \
+           $RPM_BUILD_ROOT%{peardir}/.pkgxml
 
 # Relocate everything:
 sed -si "s,$RPM_BUILD_ROOT,,g" \
@@ -81,6 +79,8 @@
    mv ${f}.new ${f}
 done
 
+install -m 644 -c $RPM_SOURCE_DIR/LICENSE .
+
 %check
 # Check that no buildroot-relative or arch-specific paths are left in the pear.conf
 grep $RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
@@ -97,8 +97,15 @@
 %{_bindir}/*
 %config %{_sysconfdir}/pear.conf
 %dir %{_localstatedir}/cache/php-pear
+%doc LICENSE
 
 %changelog
+* Mon May  8 2006 Joe Orton <jorton at redhat.com> 1:1.4.9-2
+- update to 1.4.9 (thanks to Remi Collet, #183359)
+- package /usr/share/pear/.pkgxml (#190252)
+- update to XML_RPC-1.4.8
+- bundle the v3.0 LICENSE file
+
 * Tue Feb 28 2006 Joe Orton <jorton at redhat.com> 1:1.4.6-2
 - set cache_dir directory, own /var/cache/php-pear
 


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/php-pear/devel/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sources	30 Jan 2006 15:47:59 -0000	1.4
+++ sources	8 May 2006 09:33:59 -0000	1.5
@@ -1,2 +1,2 @@
-48a9334065e24afdf7a623046eae9d78  XML_RPC-1.4.4.tgz
-2d10cdab58239fd738cb1b1d5a5047df  install-pear-nozlib-1.4.6.phar
+c2e94575bd14a4425de9e20976c65d43  XML_RPC-1.4.8.tgz
+1030f325e0ce140db7cb3063bda52d3b  install-pear-nozlib-1.4.9.phar




More information about the fedora-cvs-commits mailing list