diff --git a/.gitignore b/.gitignore index 1d4ff64..6d84998 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /DependencyInjection-2.1.6.tgz /DependencyInjection-2.1.7.tgz /DependencyInjection-2.1.8.tgz +/DependencyInjection-2.2.0.tgz diff --git a/php-symfony2-DependencyInjection-tests-bootstrap.patch b/php-symfony2-DependencyInjection-tests-bootstrap.patch deleted file mode 100644 index 03be72e..0000000 --- a/php-symfony2-DependencyInjection-tests-bootstrap.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- Symfony/Component/DependencyInjection/Tests/bootstrap.php 2012-09-20 03:42:08.000000000 -0400 -+++ Symfony/Component/DependencyInjection/Tests/bootstrap.php 2012-10-20 22:38:53.782073532 -0400 -@@ -10,9 +10,18 @@ - */ - - spl_autoload_register(function ($class) { -- if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\DependencyInjection')) { -- if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\DependencyInjection')).'.php')) { -- require_once $file; -+ if (0 === strpos(ltrim($class, '/'), 'Symfony\Component')) { -+ $file = substr(str_replace('\\', '/', $class), strlen('Symfony\Component')).'.php'; -+ if (file_exists(__DIR__.'/../..'.$file)) { -+ // Load from source tree -+ require_once __DIR__.'/../..'.$file; -+ } else { -+ try { -+ // Try loading from incude path -+ require_once 'Symfony/Component'.$file; -+ } catch (Exception $e) { -+ // Fail silently so class not found fatal error still raised -+ } - } - } - }); diff --git a/php-symfony2-DependencyInjection.spec b/php-symfony2-DependencyInjection.spec index 97959ac..6f49f3b 100644 --- a/php-symfony2-DependencyInjection.spec +++ b/php-symfony2-DependencyInjection.spec @@ -2,35 +2,34 @@ %{!?pear_metadir: %global pear_metadir %{pear_phpdir}} %global pear_channel pear.symfony.com -%global pear_name %(echo %{name} | sed -e 's/^php-symfony2-//' -e 's/-/_/g') +%global pear_name DependencyInjection %global php_min_ver 5.3.3 -Name: php-symfony2-DependencyInjection -Version: 2.1.8 -Release: 2%{?dist} +Name: php-symfony2-%{pear_name} +Version: 2.2.0 +Release: 1%{?dist} Summary: Symfony2 %{pear_name} Component Group: Development/Libraries License: MIT URL: http://symfony.com/doc/current/components/dependency_injection/index.html Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz -Patch0: %{name}-tests-bootstrap.patch BuildArch: noarch BuildRequires: php-pear(PEAR) BuildRequires: php-channel(%{pear_channel}) -# Test requires +# For tests BuildRequires: php-common >= %{php_min_ver} BuildRequires: php-pear(pear.phpunit.de/PHPUnit) -BuildRequires: php-pear(%{pear_channel}/Config) >= 2.1.0 -BuildRequires: php-pear(%{pear_channel}/Yaml) >= 2.1.0 -# Test requires: phpci -BuildRequires: php-ctype +BuildRequires: php-pear(%{pear_channel}/Config) >= 2.2.0 +BuildRequires: php-pear(%{pear_channel}/Config) < 2.3.0 +BuildRequires: php-pear(%{pear_channel}/Yaml) >= 2.2.0 +BuildRequires: php-pear(%{pear_channel}/Yaml) < 2.3.0 +# For tests: phpci BuildRequires: php-dom -BuildRequires: php-libxml BuildRequires: php-pcre -BuildRequires: php-phar +BuildRequires: php-pecl(phar) BuildRequires: php-reflection BuildRequires: php-simplexml BuildRequires: php-spl @@ -40,18 +39,22 @@ Requires: php-pear(PEAR) Requires: php-channel(%{pear_channel}) Requires(post): %{__pear} Requires(postun): %{__pear} -# phpci requires -Requires: php-ctype +# phpci Requires: php-dom -Requires: php-libxml Requires: php-pcre -Requires: php-phar Requires: php-reflection Requires: php-simplexml Requires: php-spl -# Optional requires -Requires: php-pear(%{pear_channel}/Config) >= 2.1.0 -Requires: php-pear(%{pear_channel}/Yaml) >= 2.1.0 +%if 0%{?fedora} && 0%{?fedora} >= 19 +Requires: php-phar +%else +Requires: php-pecl(phar) +%endif +# Optional +Requires: php-pear(%{pear_channel}/Config) >= 2.2.0 +Requires: php-pear(%{pear_channel}/Config) < 2.3.0 +Requires: php-pear(%{pear_channel}/Yaml) >= 2.2.0 +Requires: php-pear(%{pear_channel}/Yaml) < 2.3.0 Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} @@ -66,23 +69,46 @@ Service Container (http://symfony.com/doc/current/book/service_container.html). %prep %setup -q -c -# Patches -cd %{pear_name}-%{version} -%patch0 -p0 -cd .. +# Create PHPUnit autoloader +( cat <<'PHPUNIT_AUTOLOADER' + phpunit.autoloader.php + +# Update PHPUnit config +sed -e 's#vendor/autoload.php#./phpunit.autoloader.php#' \ + -i %{pear_name}-%{version}/Symfony/Component/%{pear_name}/phpunit.xml.dist # Modify PEAR package.xml file: # - Remove .gitattributes file # - Remove .gitignore file # - Change role from "php" to "doc" for CHANGELOG.md file # - Change role from "php" to "test" for all test files -# - Remove md5sum from bootsrap.php file since it was patched +# - Remove md5sum from phpunit.xml.dist file since it was updated sed -e '/\.gitattributes/d' \ -e '/\.gitignore/d' \ -e '/CHANGELOG.md/s/role="php"/role="doc"/' \ - -e '/phpunit.xml.dist/s/role="php"/role="test"/' \ -e '/Tests/s/role="php"/role="test"/' \ - -e '/bootstrap.php/s/md5sum="[^"]*"\s*//' \ + -e '/phpunit.xml.dist/s/role="php"/role="test"/' \ + -e '/phpunit.xml.dist/s/md5sum="[^"]*"\s*//' \ -i package.xml # package.xml is version 2.0 @@ -104,14 +130,17 @@ rm -rf %{buildroot}%{pear_metadir}/.??* mkdir -p %{buildroot}%{pear_xmldir} install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} +# Install PHPUnit autoloader +install -pm 0644 ../phpunit.autoloader.php \ + %{buildroot}/%{pear_testdir}/%{pear_name}/Symfony/Component/%{pear_name}/ + %check cd %{pear_name}-%{version}/Symfony/Component/%{pear_name} -# Temporarily disable failing tests -rm -f Tests/CrossCheckTest.php Tests/Dumper/YamlDumperTest.php +sed 's#./phpunit.autoloader.php#./autoloader.php#' -i phpunit.xml.dist -%{_bindir}/phpunit +%{_bindir}/phpunit -d date.timezone="UTC" %post @@ -134,6 +163,12 @@ fi %changelog +* Wed Mar 13 2013 Shawn Iwinski 2.2.0-1 +- Updated to 2.2.0 +- Removed tests' bootstrap patch +- Removed php-ctype and php-libxml requires +- Added conditional for phar require + * Sat Mar 23 2013 Remi Collet 2.1.8-2 - fix Requires for phar extension diff --git a/sources b/sources index 10cdc30..5acac74 100644 --- a/sources +++ b/sources @@ -8,3 +8,4 @@ afcacc38e4d4fbb6ff00e9afa79abaf5 DependencyInjection-2.0.17.tgz 8d791edda3d183c2174e0ae9c5a4364c DependencyInjection-2.1.6.tgz b2534eda6395f3dff43328306d47fbc0 DependencyInjection-2.1.7.tgz 780d6edb38aa9a82a577477a8aab2812 DependencyInjection-2.1.8.tgz +e61f59e24468383bac3d279cb747e2c8 DependencyInjection-2.2.0.tgz