[php-symfony2-HttpFoundation] Updated to 2.2.0
Shawn Iwinski
siwinski at fedoraproject.org
Sat Mar 23 15:02:48 UTC 2013
commit c9694af01cb473487f07a71ee47f6fe274a7c5f9
Author: Shawn Iwinski <shawn.iwinski at gmail.com>
Date: Wed Mar 13 21:25:53 2013 -0400
Updated to 2.2.0
- Removed tests' bootstrap patch
- Added php-intl require
.gitignore | 1 +
php-symfony2-HttpFoundation-tests-bootstrap.patch | 44 ----------
php-symfony2-HttpFoundation.spec | 95 +++++++++++++++-----
sources | 1 +
tests-bootstrap.patch | 26 ------
5 files changed, 73 insertions(+), 94 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4e59165..6f0756b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
/HttpFoundation-2.1.6.tgz
/HttpFoundation-2.1.7.tgz
/HttpFoundation-2.1.8.tgz
+/HttpFoundation-2.2.0.tgz
diff --git a/php-symfony2-HttpFoundation.spec b/php-symfony2-HttpFoundation.spec
index 5b4353b..9a036fc 100644
--- a/php-symfony2-HttpFoundation.spec
+++ b/php-symfony2-HttpFoundation.spec
@@ -2,13 +2,11 @@
%{!?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 HttpFoundation
%global php_min_ver 5.3.3
-# Temp disable tests by default b/c build failures on F18, F17, and EL6
-%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
-Name: php-symfony2-HttpFoundation
-Version: 2.1.8
+Name: php-symfony2-%{pear_name}
+Version: 2.2.0
Release: 1%{?dist}
Summary: Symfony2 %{pear_name} Component
@@ -16,19 +14,18 @@ Group: Development/Libraries
License: MIT
URL: http://symfony.com/doc/current/components/http_foundation/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})
-%if %{with_tests}
-# Test requires
+# For tests
BuildRequires: php-common >= %{php_min_ver}
BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
-# Test requires: phpci
+# For tests: phpci
BuildRequires: php-date
BuildRequires: php-fileinfo
+BuildRequires: php-intl
BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-pdo
@@ -37,16 +34,16 @@ BuildRequires: php-session
BuildRequires: php-sockets
BuildRequires: php-spl
%{?fedora:BuildRequires: php-filter}
-%endif
Requires: php-common >= %{php_min_ver}
Requires: php-pear(PEAR)
Requires: php-channel(%{pear_channel})
Requires(post): %{__pear}
Requires(postun): %{__pear}
-# phpci requires
+# phpci
Requires: php-date
Requires: php-fileinfo
+Requires: php-intl
Requires: php-json
Requires: php-pcre
Requires: php-pdo
@@ -75,23 +72,54 @@ Optional dependencies: memcache, memcached, mongo
%prep
%setup -q -c
-# Patches
-cd %{pear_name}-%{version}
-%patch0 -p0
-cd ..
+# Create PHPUnit autoloader
+( cat <<'PHPUNIT_AUTOLOADER'
+<?php
+
+# This file was created by RPM packaging and is not part of the original
+# Symfony2 %{pear_name} PEAR package.
+
+set_include_path(
+ '%{pear_phpdir}'.PATH_SEPARATOR.
+ '%{pear_testdir}/%{pear_name}'.PATH_SEPARATOR.
+ get_include_path()
+);
+
+spl_autoload_register(function ($class) {
+ if ('\\' == $class[0]) {
+ $class = substr($class, 1);
+ }
+
+ $file = str_replace('\\', '/', $class).'.php';
+ @include $file;
+});
+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 file test is looking for
+sed 's#README.md#%{pear_docdir}/%{pear_name}/Symfony/Component/%{pear_name}/README.md#g' \
+ -i %{pear_name}-%{version}/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
+sed '/README.md.*Content-Disposition/s#".*README.md#"README.md#g' \
+ -i %{pear_name}-%{version}/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
# 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
+# - Remove md5sum from BinaryFileResponseTest.php 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*//' \
+ -e '/BinaryFileResponseTest.php/s/md5sum="[^"]*"\s*//' \
-i package.xml
# package.xml is version 2.0
@@ -113,14 +141,28 @@ 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
-%if %{with_tests}
- cd %{pear_name}-%{version}/Symfony/Component/%{pear_name}
- %{_bindir}/phpunit
-%else
-: Tests skipped, missing '--with tests' option
-%endif
+cd %{pear_name}-%{version}/Symfony/Component/%{pear_name}
+
+sed 's#./phpunit.autoloader.php#./autoloader.php#' -i phpunit.xml.dist
+
+# Update test file location
+sed 's#%{pear_docdir}#%{buildroot}%{pear_docdir}#g' \
+ -i Tests/BinaryFileResponseTest.php
+
+# Skip tests requiring write access to /var/lib/php/session (root user)
+sed -e 's/testBag/SKIP_testBag/' \
+ -e 's/testGetId/SKIP_testGetId/' \
+ -e 's/testRegenerate/SKIP_testRegenerate/' \
+ -e 's/testRegenerateDestroy/SKIP_testRegenerateDestroy/' \
+ -i Tests/Session/Storage/NativeSessionStorageTest.php
+
+%{_bindir}/phpunit -d date.timezone="UTC"
%post
@@ -145,6 +187,11 @@ fi
%changelog
+* Wed Mar 13 2013 Shawn Iwinski <shawn.iwinski at gmail.com> 2.2.0-1
+- Updated to 2.2.0
+- Removed tests' bootstrap patch
+- Added php-intl require
+
* Sun Mar 03 2013 Shawn Iwinski <shawn.iwinski at gmail.com> 2.1.8-1
- Updated to upstream version 2.1.8
diff --git a/sources b/sources
index 3636afc..f136aec 100644
--- a/sources
+++ b/sources
@@ -8,3 +8,4 @@ e40bf935183057d5143c777484430dec HttpFoundation-2.1.3.tgz
8b21ceb8cc53978b7976cdc887cfaa79 HttpFoundation-2.1.6.tgz
8b84f0a32d62d56200dbf146511dca80 HttpFoundation-2.1.7.tgz
c795ad30936dcdb42946397c251209a8 HttpFoundation-2.1.8.tgz
+f738b5c72a7ac8df3fe7c492eed13d56 HttpFoundation-2.2.0.tgz
More information about the scm-commits
mailing list