[php-symfony2-HttpKernel] Updated to upstream version 2.1.2 + added tests

Shawn Iwinski siwinski at fedoraproject.org
Sat Oct 27 21:58:45 UTC 2012


commit 75fba3c387f012cb3f82ab20d2df523dd71db8db
Author: Shawn Iwinski <shawn.iwinski at gmail.com>
Date:   Sun Sep 23 14:05:28 2012 -0400

    Updated to upstream version 2.1.2 + added tests

 .gitignore                                    |    1 +
 php-symfony2-HttpKernel-tests-bootstrap.patch |   24 +++++
 php-symfony2-HttpKernel.spec                  |  121 +++++++++++++++++++++----
 sources                                       |    1 +
 4 files changed, 127 insertions(+), 20 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ee808c5..a9df76a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /HttpKernel-2.0.15.tgz
 /HttpKernel-2.0.16.tgz
 /HttpKernel-2.0.17.tgz
+/HttpKernel-2.1.2.tgz
diff --git a/php-symfony2-HttpKernel-tests-bootstrap.patch b/php-symfony2-HttpKernel-tests-bootstrap.patch
new file mode 100644
index 0000000..099c67f
--- /dev/null
+++ b/php-symfony2-HttpKernel-tests-bootstrap.patch
@@ -0,0 +1,24 @@
+--- Symfony/Component/HttpKernel/Tests/bootstrap.php	2012-09-20 03:42:12.000000000 -0400
++++ Symfony/Component/HttpKernel/Tests/bootstrap.php	2012-10-27 17:02:39.283668836 -0400
+@@ -10,9 +10,18 @@
+  */
+ 
+ spl_autoload_register(function ($class) {
+-    if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\HttpKernel')) {
+-        if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpKernel')).'.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-HttpKernel.spec b/php-symfony2-HttpKernel.spec
index 6b591e3..9f91743 100644
--- a/php-symfony2-HttpKernel.spec
+++ b/php-symfony2-HttpKernel.spec
@@ -1,10 +1,15 @@
 %{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
+%{!?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 php_min_ver  5.3.3
+# Broken: require_once(Symfony/Component/HttpKernel/Tests/some_controller_function.php)
+%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
+
 
 Name:             php-symfony2-HttpKernel
-Version:          2.0.17
+Version:          2.1.2
 Release:          1%{?dist}
 Summary:          Symfony2 %{pear_name} Component
 
@@ -12,44 +17,97 @@ Group:            Development/Libraries
 License:          MIT
 URL:              http://symfony.com/components
 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})
-
-Requires:         php-common >= 5.3.2
+%if %{with_tests}
+# Test requires
+BuildRequires:    php-common >= %{php_min_ver}
+BuildRequires:    php-pear(%{pear_channel}/BrowserKit) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/ClassLoader) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/Config) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/Console) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/DependencyInjection) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/EventDispatcher) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/Finder) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/HttpFoundation) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/Process) >= 2.1.0
+BuildRequires:    php-pear(%{pear_channel}/Routing) >= 2.1.0
+# Test requires: phpci
+BuildRequires:    php-date
+BuildRequires:    php-json
+BuildRequires:    php-pcre
+BuildRequires:    php-pdo
+BuildRequires:    php-pdo_mysql
+BuildRequires:    php-pdo_sqlite
+BuildRequires:    php-reflection
+BuildRequires:    php-session
+BuildRequires:    php-spl
+BuildRequires:    php-tokenizer
+%endif
+
+Requires:         php-common >= %{php_min_ver}
 Requires:         php-pear(PEAR)
 Requires:         php-channel(%{pear_channel})
-Requires:         php-pear(%{pear_channel}/HttpFoundation) = %{version}
-Requires:         php-pear(%{pear_channel}/EventDispatcher) = %{version}
+Requires:         php-pear(%{pear_channel}/EventDispatcher) >= 2.1.0
+Requires:         php-pear(%{pear_channel}/HttpFoundation) >= 2.1.0
 Requires(post):   %{__pear}
 Requires(postun): %{__pear}
 # phpci requires
-Requires:         php-ctype
 Requires:         php-date
+Requires:         php-json
 Requires:         php-pcre
+Requires:         php-pdo
+Requires:         php-pdo_mysql
+Requires:         php-pdo_sqlite
 Requires:         php-reflection
+Requires:         php-session
 Requires:         php-spl
 Requires:         php-tokenizer
 # Optional requires
-Requires:         php-pdo
-Requires:         php-pdo_mysql
-Requires:         php-pdo_sqlite
-Requires:         php-pear(%{pear_channel}/BrowserKit) = %{version}
-Requires:         php-pear(%{pear_channel}/ClassLoader) = %{version}
-Requires:         php-pear(%{pear_channel}/Config) = %{version}
-Requires:         php-pear(%{pear_channel}/Console) = %{version}
-Requires:         php-pear(%{pear_channel}/DependencyInjection) = %{version}
-Requires:         php-pear(%{pear_channel}/Finder) = %{version}
+Requires:         php-pear(%{pear_channel}/BrowserKit) >= 2.1.0
+Requires:         php-pear(%{pear_channel}/ClassLoader) >= 2.1.0
+Requires:         php-pear(%{pear_channel}/Config) >= 2.1.0
+Requires:         php-pear(%{pear_channel}/Console) >= 2.1.0
+Requires:         php-pear(%{pear_channel}/DependencyInjection) >= 2.1.0
+Requires:         php-pear(%{pear_channel}/Finder) >= 2.1.0
 
 Provides:         php-pear(%{pear_channel}/%{pear_name}) = %{version}
 
 %description
-%{summary}.
+HttpKernel provides the building blocks to create flexible and fast
+HTTP-based frameworks.
+
+It takes a Request as an input and should return a Response as an output.
+Using this interface makes your code compatible with all frameworks using
+the Symfony2 components. And this will give you many cool features for free.
+
+Optional dependencies: memcache, memcached, mongo
 
 
 %prep
 %setup -q -c
+
+# Patches
+cd %{pear_name}-%{version}
+%patch0 -p0
+cd ..
+
+# Modify PEAR package.xml 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
+sed -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*//' \
+    -i package.xml
+
 # package.xml is version 2.0
 mv package.xml %{pear_name}-%{version}/%{name}.xml
 
@@ -60,14 +118,23 @@ mv package.xml %{pear_name}-%{version}/%{name}.xml
 
 %install
 cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
+%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
 
 # Clean up unnecessary files
-rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
+rm -rf %{buildroot}%{pear_metadir}/.??*
 
 # Install XML package description
-mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
-install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
+mkdir -p %{buildroot}%{pear_xmldir}
+install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+
+
+%check
+%if %{with_tests}
+    cd %{pear_name}-%{version}/Symfony/Component/%{pear_name}
+    %{_bindir}/phpunit
+%else
+: Tests skipped, missing '--with tests' option
+%endif
 
 
 %post
@@ -86,9 +153,23 @@ fi
 %doc %{pear_docdir}/%{pear_name}
 %{pear_xmldir}/%{name}.xml
 %{pear_phpdir}/Symfony/Component/%{pear_name}
+%{pear_testdir}/%{pear_name}
 
 
 %changelog
+* Fri Sep 21 2012 Shawn Iwinski <shawn.iwinski at gmail.com> 2.1.2-1
+- Updated to upstream version 2.1.2
+- Updated description
+- PHP minimum version 5.3.3 instead of 5.3.2
+- Require other components ">= 2.1.0" instead of "= %%{version}"
+- Added php-json and php-session requires
+- Removed php-ctype require
+- Added PEAR package.xml modifications
+- Added patch for tests' bootstrap.php
+- Added tests (%%check)
+- Changed RPM_BUILD_ROOT to %%{buildroot}
+- Added %%global pear_metadir
+
 * Sat Sep 15 2012 Shawn Iwinski <shawn.iwinski at gmail.com> 2.0.17-1
 - Updated to upstream version 2.0.17
 - Added php-reflection require
diff --git a/sources b/sources
index 98072d6..ba1baf4 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,4 @@
 ab1240e00df458b8eb4bafe80bc6c112  HttpKernel-2.0.15.tgz
 e44643b80c2d1470990ad3c303e1913d  HttpKernel-2.0.16.tgz
 3cc91f7dcc3f4c5ea3f3d9e704f5f135  HttpKernel-2.0.17.tgz
+78f688091c21b7e4a8db91935c6184f8  HttpKernel-2.1.2.tgz


More information about the scm-commits mailing list