[php-theseer-autoload] - Update to 1.16.2 - switch from pear to github sources

Remi Collet remi at fedoraproject.org
Tue Nov 25 15:34:53 UTC 2014


commit 606f24572391fec97a2174062d91d7308f9da297
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Nov 25 16:34:47 2014 +0100

    - Update to 1.16.2
    - switch from pear to github sources

 .gitignore                |    1 +
 Autoload-rpm.patch        |   26 ++++++++++++
 Autoload-timezone.patch   |   24 -----------
 php-theseer-autoload.spec |  100 +++++++++++++++++++++------------------------
 sources                   |    2 +-
 5 files changed, 75 insertions(+), 78 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 053e970..09df280 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
 /Autoload-1.15.0.tgz
 /Autoload-1.15.1.tgz
 /Autoload-1.16.0.tgz
+/Autoload-1.16.2.tar.gz
diff --git a/Autoload-rpm.patch b/Autoload-rpm.patch
new file mode 100644
index 0000000..cfc8ddd
--- /dev/null
+++ b/Autoload-rpm.patch
@@ -0,0 +1,26 @@
+--- phpab.php.rpm	2014-11-25 11:32:11.000000000 +0100
++++ phpab.php	2014-11-25 14:40:59.288514790 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env php
++#!/usr/bin/php
+ <?php
+ /**
+  * Copyright (c) 2009-2014 Arne Blankerts <arne at blankerts.de>
+@@ -42,12 +42,15 @@
+  *   4 - Lint Error
+  */
+ 
+-define('PHPAB_VERSION', '%development%');
++define('PHPAB_VERSION', '@VERSION@');
+ 
+ if (!ini_get('date.timezone')) {
+      ini_set('date.timezone', 'UTC');
+ }
+-require __DIR__ . '/src/autoload.php';
++require 'TheSeer/DirectoryScanner/autoload.php';
++require 'TheSeer/Autoload/autoload.php';
++require 'ezc/Base/base.php';
++spl_autoload_register(array('\ezcBase','autoload'));
+ 
+ $factory = new \TheSeer\Autoload\Factory();
+ $factory->getCLI()->run();
diff --git a/php-theseer-autoload.spec b/php-theseer-autoload.spec
index 1cd484b..984d9c8 100644
--- a/php-theseer-autoload.spec
+++ b/php-theseer-autoload.spec
@@ -6,47 +6,50 @@
 #
 # Please, preserve the changelog entries
 #
-%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
-%{!?__pear:       %global __pear       %{_bindir}/pear}
-%global pear_name     Autoload
-%global pear_channel  pear.netpirates.net
+%global gh_commit    2a47cae1efaf0b395f72e748cfbcbd2f54399616
+%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner     theseer
+%global gh_project   Autoload
+%global php_home     %{_datadir}/php/TheSeer
+%global pear_name    Autoload
+%global pear_channel pear.netpirates.net
 
 Name:           php-theseer-autoload
-Version:        1.16.0
-Release:        2%{?dist}
+Version:        1.16.2
+Release:        1%{?dist}
 Summary:        A tool and library to generate autoload code
 
 Group:          Development/Libraries
 License:        BSD
-URL:            https://github.com/theseer/Autoload
-Source0:        http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
+URL:            https://github.com/%{gh_owner}/%{gh_project}
+Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
 
-# https://github.com/theseer/Autoload/pull/52
-Patch0:         %{pear_name}-timezone.patch
+# Autoload stuff - die composer !
+Patch0:         %{gh_project}-rpm.patch
 
 BuildArch:      noarch
 BuildRequires:  php(language) >= 5.3.1
-BuildRequires:  php-pear(PEAR)
-BuildRequires:  php-channel(%{pear_channel})
 # For tests
-BuildRequires:  php-pear(%{pear_channel}/DirectoryScanner) >= 1.3.0
+BuildRequires:  php-composer(theseer/directoryscanner) >= 1.3.0
+BuildRequires:  php-composer(theseer/directoryscanner) <  1.4
 BuildRequires:  %{_bindir}/phpunit
 
-Requires(post): %{__pear}
-Requires(postun): %{__pear}
-# From package.xml
+# From composer.json
+#        "theseer/directoryscanner": "~1.3.0",
+#        "zetacomponents/console-tools": "dev-master"
 Requires:       php(language) >= 5.3.1
-Requires:       php-openssl
-Requires:       php-phar
-Requires:       php-tokenizer
-Requires:       php-pear(PEAR)
-Requires:       php-channel(%{pear_channel})
-Requires:       php-pear(%{pear_channel}/DirectoryScanner) >= 1.3.0
+Requires:       php-composer(theseer/directoryscanner) >= 1.3.0
+Requires:       php-composer(theseer/directoryscanner) <  1.4
+# Use ezc instead of zetacomponent (no release, no package)
 Requires:       php-pear(components.ez.no/ConsoleTools) >= 1.6
-# From phpcompatinfo report for version 1.16.0
+# From phpcompatinfo report for version 1.16.1
 Requires:       php-date
 Requires:       php-json
+Requires:       php-openssl
+Requires:       php-phar
 Requires:       php-spl
+Requires:       php-tokenizer
+# Optional xdebug
 
 Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
 Provides:       php-composer(theseer/autoload) = %{version}
@@ -59,65 +62,56 @@ the option of creating static require lists as well as phar archives.
 
 
 %prep
-%setup -q -c
+%setup -q -n %{gh_project}-%{gh_commit}
 
-cd %{pear_name}-%{version}
-%patch0 -p1 -b .tz
-# Drop checksum for patched file
-sed -e '/phpab.php/s/md5sum="[^"]*"//' \
-    ../package.xml >%{name}.xml
-touch -r ../package.xml %{name}.xml
+%patch0 -p0 -b .rpm
+# autoload only for this package
+sed -e '\:../vendor/:d'          -i src/autoload.php
+# set version
+sed -e 's/@VERSION@/%{version}/' -i phpab.php
 
 
 %build
-cd %{pear_name}-%{version}
 # Empty build section, most likely nothing required.
 
 
 %install
-cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
-
-# Clean up unnecessary files
-rm -rf %{buildroot}%{pear_metadir}/.??*
+mkdir -p   %{buildroot}%{php_home}
+cp -pr src %{buildroot}%{php_home}/%{gh_project}
 
-# Install XML package description
-mkdir -p %{buildroot}%{pear_xmldir}
-install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+install -Dpm 0755 phpab.php %{buildroot}%{_bindir}/phpab
 
 
 %check
-cd %{pear_name}-%{version}
 cat <<EOF | tee tests/init.php
 <?php
 require 'TheSeer/DirectoryScanner/autoload.php';
 require 'TheSeer/Autoload/autoload.php';
 EOF
 
-phpunit --include-path=%{buildroot}%{pear_phpdir}
+phpunit --include-path=%{buildroot}%{_datadir}/php
 
 
 %post
-%{__pear} install --nodeps --soft --force --register-only \
-    %{pear_xmldir}/%{name}.xml >/dev/null || :
-
-%postun
-if [ $1 -eq 0 ] ; then
-    %{__pear} uninstall --nodeps --ignore-errors --register-only \
-        %{pear_channel}/%{pear_name} >/dev/null || :
+if [ -x %{_bindir}/pear ]; then
+  %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
+      %{pear_channel}/%{pear_name} >/dev/null || :
 fi
 
 
 %files
-%doc %{pear_docdir}/%{pear_name}
-%doc %{pear_testdir}/%{pear_name}
-%{pear_xmldir}/%{name}.xml
-
-%{pear_phpdir}/TheSeer/%{pear_name}
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README.md composer.json
+%{php_home}/%{gh_project}
 %{_bindir}/phpab
 
 
 %changelog
+* Tue Nov 25 2014 Remi Collet <remi at fedoraproject.org> - 1.16.2-1
+- Update to 1.16.2
+- switch from pear to github sources
+
 * Wed Nov 12 2014 Remi Collet <remi at fedoraproject.org> - 1.16.0-2
 - define date.timezone in phpab command to avoid warning
 
diff --git a/sources b/sources
index 9f85faf..e72e40d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6d0e9ca5c3b7958369329ad428aa9f6a  Autoload-1.16.0.tgz
+aa45c470e8eced763f2ea7cea1da7900  Autoload-1.16.2.tar.gz


More information about the scm-commits mailing list