[php-phpunit-PHP-CodeCoverage/epel7] - update to 2.0.6 for PHPUnit 4 - sources from github - drop dependency on php-ezc-ConsoleTools - ad

Remi Collet remi at fedoraproject.org
Tue May 6 07:23:23 UTC 2014


commit ebadc2367277896cdfb2d2d4e30bf441a37115a9
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue May 6 09:18:47 2014 +0200

    - update to 2.0.6 for PHPUnit 4
    - sources from github
    - drop dependency on php-ezc-ConsoleTools
    - add dependencies on php-phpunit-environment, php-phpunit-Version
    - run test when build --with tests option
    
    (cherry picked from commit 38de29b9be8210e2bb95334d4fe7d0c7786378b5)

 .gitignore                        |    1 +
 Autoload.php.in                   |   30 +++++++++++
 php-phpunit-PHP-CodeCoverage.spec |   96 +++++++++++++++++++++----------------
 sources                           |    2 +-
 4 files changed, 87 insertions(+), 42 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index dfcf973..af8a983 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ package*.xml
 /PHP_CodeCoverage-1.2.15.tgz
 /PHP_CodeCoverage-1.2.16.tgz
 /PHP_CodeCoverage-1.2.17.tgz
+/php-code-coverage-2.0.6.tar.gz
diff --git a/Autoload.php.in b/Autoload.php.in
new file mode 100644
index 0000000..98b2e99
--- /dev/null
+++ b/Autoload.php.in
@@ -0,0 +1,30 @@
+<?php
+/* inspired from Autoload.php from version 1.2 */
+
+require_once 'File/Iterator/Autoload.php';
+require_once 'PHP/Token/Stream/Autoload.php';
+require_once 'Text/Template/Autoload.php';
+require_once 'SebastianBergmann/Environment/autoload.php';
+require_once 'SebastianBergmann/Version/autoload.php';
+
+spl_autoload_register(
+  function ($class)
+  {
+      static $classes = NULL;
+      static $path = NULL;
+
+      if ($classes === NULL) {
+          $classes = array(
+            ___CLASSLIST___
+          );
+
+          $path = dirname(dirname(__FILE__));
+      }
+
+      $cn = strtolower($class);
+
+      if (isset($classes[$cn])) {
+          require $path . $classes[$cn];
+      }
+  }
+);
diff --git a/php-phpunit-PHP-CodeCoverage.spec b/php-phpunit-PHP-CodeCoverage.spec
index 7114538..e6aab89 100644
--- a/php-phpunit-PHP-CodeCoverage.spec
+++ b/php-phpunit-PHP-CodeCoverage.spec
@@ -6,93 +6,107 @@
 #
 # Please, preserve the changelog entries
 #
-%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
-%{!?__pear:       %global __pear       %{_bindir}/pear}
+%global gh_commit    bccecf50645068b44f49a84009e2a0499a500b99
+%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner     sebastianbergmann
+%global gh_project   php-code-coverage
+%global php_home     %{_datadir}/php
 %global pear_name    PHP_CodeCoverage
 %global pear_channel pear.phpunit.de
+# disable because of circular dep with phpunit
+%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
 
 Name:           php-phpunit-PHP-CodeCoverage
-Version:        1.2.17
+Version:        2.0.6
 Release:        1%{?dist}
 Summary:        PHP code coverage information
 
 Group:          Development/Libraries
 License:        BSD
-URL:            https://github.com/sebastianbergmann/php-code-coverage
-Source0:        http://pear.phpunit.de/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
+
+# Autoload template from version 1.2
+Source1:        Autoload.php.in
 
 BuildArch:      noarch
 BuildRequires:  php(language) >= 5.3.3
-BuildRequires:  php-pear(PEAR) >= 1.9.4
-BuildRequires:  php-channel(%{pear_channel})
+BuildRequires:  %{_bindir}/phpab
+%if %{with_tests}
+BuildRequires:  php-pear-PHPUnit >= 4.0.14
+%endif
 
-Requires(post): %{__pear}
-Requires(postun): %{__pear}
+# From composer.json
 Requires:       php(language) >= 5.3.3
-Requires:       php-date
 Requires:       php-dom
+Requires:       php-phpunit-File-Iterator >= 1.3.1
+Requires:       php-phpunit-PHP-TokenStream >= 1.2.2
+Requires:       php-phpunit-Text-Template >= 1.2.0
+Requires:       php-phpunit-environment >= 1.0.0
+Requires:       php-phpunit-Version >= 1.0.3
+Requires:       php-pecl(Xdebug) >= 2.1.4
+# From phpcompatinfo report for version 2.0.7
+Requires:       php-date
 Requires:       php-json
-Requires:       php-pcre
 Requires:       php-reflection
 Requires:       php-spl
 Requires:       php-tokenizer
-Requires:       php-pecl(Xdebug) >= 2.0.5
-Requires:       php-pear(PEAR) >= 1.9.4
-Requires:       php-channel(%{pear_channel})
-Requires:       php-pear(%{pear_channel}/File_Iterator) >= 1.3.0
-Requires:       php-pear(%{pear_channel}/PHP_TokenStream) >= 1.1.3
-Requires:       php-pear(%{pear_channel}/Text_Template) >= 1.2.0
-Requires:       php-pear(components.ez.no/ConsoleTools) >= 1.6
+Requires:       php-xmlwriter
 
+# For compatibility with PEAR mode
 Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
 
+
 %description
 Library that provides collection, processing, and rendering functionality
 for PHP code coverage information.
 
 
 %prep
-%setup -q -c
-cd %{pear_name}-%{version}
-# package.xml is V2
-mv ../package.xml %{name}.xml
+%setup -q -n %{gh_project}-%{gh_commit}
 
 
 %build
-cd %{pear_name}-%{version}
-# Empty build section, most likely nothing required.
+phpab \
+  --output   src/CodeCoverage/Autoload.php \
+  --template %{SOURCE1} \
+  src
 
 
 %install
-cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
+mkdir -p   %{buildroot}%{php_home}
+cp -pr src %{buildroot}%{php_home}/PHP
 
-# Clean up unnecessary files
-rm -rf %{buildroot}%{pear_metadir}/.??*
 
-# Install XML package description
-mkdir -p %{buildroot}%{pear_xmldir}
-install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+%if %{with_tests}
+%check
+phpunit \
+  -d date.timezone=UTC \
+  --bootstrap src/CodeCoverage/Autoload.php
+%endif
 
 
 %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}
-%{pear_xmldir}/%{name}.xml
-%{pear_phpdir}/PHP
+%doc CONTRIBUTING.md README.md LICENSE composer.json
+%{php_home}/PHP/CodeCoverage
+%{php_home}/PHP/CodeCoverage.php
 
 
 %changelog
+* Tue May  6 2014 Remi Collet <remi at fedoraproject.org> - 2.0.6-1
+- update to 2.0.6 for PHPUnit 4
+- sources from github
+- drop dependency on php-ezc-ConsoleTools
+- add dependencies on php-phpunit-environment, php-phpunit-Version
+- run test when build --with tests option
+
 * Tue Apr 01 2014 Remi Collet <remi at fedoraproject.org> - 1.2.17-1
 - Update to 1.2.17
 
diff --git a/sources b/sources
index 07e763e..8110259 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-9512f9398319e735e1bf61b19dd6811c  PHP_CodeCoverage-1.2.17.tgz
+e883235cf9b48ab589da9995ba7e342d  php-code-coverage-2.0.6.tar.gz


More information about the scm-commits mailing list