From 3a5b65dcebacb3f2a6978723aa99c8c012d022f1 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 29 Apr 2014 17:22:21 +0200 Subject: php-phpunit-PHPUnit: 4.0.18, sources from github --- Autoload.php.in | 74 +++++++++++++++++++++++ php-phpunit-PHPUnit.spec | 153 +++++++++++++++++++++++++---------------------- phpunit-rpm.patch | 32 ++++++++++ 3 files changed, 187 insertions(+), 72 deletions(-) create mode 100644 Autoload.php.in create mode 100644 phpunit-rpm.patch diff --git a/Autoload.php.in b/Autoload.php.in new file mode 100644 index 0000000..83fd1fb --- /dev/null +++ b/Autoload.php.in @@ -0,0 +1,74 @@ += 5.3.3 -BuildRequires: php-pear(PEAR) >= 1.9.4 -BuildRequires: php-channel(%{pear_channel}) - +BuildRequires: %{_bindir}/phpab +BuildRequires: php-phpunit-File-Iterator >= 1.3.1 +BuildRequires: php-phpunit-Text-Template >= 1.2 +BuildRequires: php-phpunit-PHP-CodeCoverage >= 2.0 +BuildRequires: php-phpunit-PHP-Timer >= 1.0.2 +BuildRequires: php-phpunit-PHPUnit-MockObject >= 2.0 +BuildRequires: php-phpunit-diff >= 1.1 +BuildRequires: php-phpunit-environment >= 1.0 +BuildRequires: php-phpunit-exporter >= 1.0.1 +BuildRequires: php-phpunit-Version >= 1.0.3 +BuildRequires: php-symfony-yaml >= 2.0.0 + +# From package.xml +Requires: php-phpunit-File-Iterator >= 1.3.1 +Requires: php-phpunit-Text-Template >= 1.2 +Requires: php-phpunit-PHP-CodeCoverage >= 2.0 +Requires: php-phpunit-PHP-CodeCoverage < 2.1 +Requires: php-phpunit-PHP-Timer >= 1.0.2 +Requires: php-phpunit-PHPUnit-MockObject >= 2.0 +Requires: php-phpunit-PHPUnit-MockObject < 2.1 +Requires: php-phpunit-diff >= 1.1 +Requires: php-phpunit-environment >= 1.0 +Requires: php-phpunit-exporter >= 1.0.1 +Requires: php-phpunit-Version >= 1.0.3 +Requires: php-symfony-yaml >= 2.0.0 +Requires: php-symfony-yaml < 3 Requires: php(language) >= 5.3.3 -Requires: php-ctype Requires: php-dom -Requires: php-libxml -Requires: php-pcntl +Requires: php-json Requires: php-pcre Requires: php-reflection Requires: php-spl -Requires: php-tidy -Requires: php-channel(%{pear_channel}) -Requires(post): %{__pear} -Requires(postun): %{__pear} -Requires: php-pear(%{pear_channel}/File_Iterator) >= 1.3.0 -Requires: php-pear(%{pear_channel}/Text_Template) >= 1.1.1 -Requires: php-pear(%{pear_channel}/PHP_CodeCoverage) >= 1.2.1 -Requires: php-pear(%{pear_channel}/PHP_CodeCoverage) < 1.3 -Requires: php-pear(%{pear_channel}/PHP_Timer) >= 1.0.4 -Requires: php-pear(pear.symfony.com/Yaml) >= 2.0.0 -Requires: php-pear(pear.symfony.com/Yaml) < 3 -# PHPUnit Extensions (yes, with circular dependency on PHPUnit) -Requires: php-pear(%{pear_channel}/PHPUnit_MockObject) >= 1.2.0 -Requires: php-pear(%{pear_channel}/PHPUnit_MockObject) < 1.3 - -# Optionnal dependencies -Requires: php-json -Requires: php-pdo +# Optional +Requires: php-phpunit-PHP-Invoker >= 1.1.0 +# From phpcompatinfo report for version 4.0.18 +Requires: php-date +Requires: php-libxml Requires: php-mbstring -Requires: php-pecl(Xdebug) >= 2.0.5 -Requires: php-pear(%{pear_channel}/PHP_Invoker) >= 1.1.0 -Requires: php-pear(%{pear_channel}/PHP_Invoker) < 1.2 +Requires: php-openssl +Requires: php-pcntl +Requires: php-phar +Requires: php-tidy +Requires: php-xml + +# For compatibility with PEAR mode Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} +# Package have been rename Obsoletes: php-pear-PHPUnit < %{version} Provides: php-pear-PHPUnit = %{version}-%{release} @@ -76,66 +96,55 @@ for the creation, execution and analysis of Unit Tests. %prep -%setup -qc +%setup -q -n %{gh_project}-%{gh_commit} -cd %{pear_name}-%{version} -%patch0 -p1 -b .msg - -# package.xml is V2 -sed -e '/TestRunner.php/s/md5sum="[^"]*"//' \ - ../package.xml >%{name}.xml +%patch0 -p0 -b .rpm %build -cd %{pear_name}-%{version} -# Empty build section, most likely nothing required. +phpab \ + --output src/Autoload.php \ + --template %{SOURCE1} \ + src %install -rm -rf %{buildroot} -cd %{pear_name}-%{version} - -# Install Package -%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml - -# Clean up unnecessary files -rm -rf %{buildroot}%{pear_metadir}/.??* - -# Install XML package description -install -d %{buildroot}%{pear_xmldir} -install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} +rm -rf %{buildroot} +mkdir -p %{buildroot}%{php_home} +cp -pr src %{buildroot}%{php_home}/PHPUnit +install -D -p -m 755 phpunit %{buildroot}%{_bindir}/phpunit -%clean -rm -rf %{buildroot} +%check +sed -e 's:vendor/autoload:src/Autoload:' \ + -i tests/bootstrap.php -%post -%{__pear} install --nodeps --soft --force --register-only \ - %{pear_xmldir}/%{name}.xml >/dev/null || : +sed -e '/logging/d' \ + -e '/ phpunit.xml -%postun -if [ $1 -eq 0 ] ; then - %{__pear} uninstall --nodeps --ignore-errors --register-only \ - %{pear_channel}/%{pear_name} >/dev/null || : -fi +./phpunit \ + --include-path=%{buildroot}%{php_home} \ + --testsuite=small \ + -d date.timezone=UTC -%triggerpostun -- php-pear-PHPUnit -# re-register extension unregistered during postun of obsoleted php-pear-PHPUnit -%{__pear} install --nodeps --soft --force --register-only \ - %{pear_xmldir}/%{name}.xml >/dev/null || : +%clean +rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc %{pear_docdir}/%{pear_name} -%{pear_xmldir}/%{name}.xml -%{pear_phpdir}/%{pear_name} %{_bindir}/phpunit +%{php_home}/PHPUnit %changelog +* Tue Apr 29 2014 Remi Collet - 4.0.14-1 +- update to 4.0.18 +- sources from github + * Tue Apr 22 2014 Remi Collet - 3.7.35-2 - remove message about deprecated PEAR channel diff --git a/phpunit-rpm.patch b/phpunit-rpm.patch new file mode 100644 index 0000000..0a1253b --- /dev/null +++ b/phpunit-rpm.patch @@ -0,0 +1,32 @@ +diff -up ./phpunit.rpm ./phpunit +--- ./phpunit.rpm 2014-04-29 16:21:26.000000000 +0200 ++++ ./phpunit 2014-04-29 16:22:50.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env php ++#!/usr/bin/php +