From 6e243701813f6871d469817dd56354e99a769013 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 20 Oct 2014 17:19:24 +0200 Subject: php-SymfonyCmfRouting: 1.2.0 (backport) --- php-SymfonyCmfRouting.spec | 163 ++++++++++++++++++++++++++------------------- 1 file changed, 96 insertions(+), 67 deletions(-) diff --git a/php-SymfonyCmfRouting.spec b/php-SymfonyCmfRouting.spec index 176e12f..b9e86a8 100644 --- a/php-SymfonyCmfRouting.spec +++ b/php-SymfonyCmfRouting.spec @@ -1,86 +1,98 @@ +# +# RPM spec file for php-SymfonyCmfRouting +# +# Copyright (c) 2013-2014 Shawn Iwinski +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + %global github_owner symfony-cmf %global github_name Routing -%global github_version 1.1.0 -%global github_commit 9f8607950cbf888ec678713a35f3d0088857c85f +%global github_version 1.2.0 +%global github_commit c67258b875eef3cb08009bf1428499d0f01ce5e7 +# "php": ">=5.3.3" %global php_min_ver 5.3.3 - +# "symfony/*": "~2.2" %global symfony_min_ver 2.2 %global symfony_max_ver 3.0 - +# "psr/log": "~1.0" %global psr_log_min_ver 1.0 %global psr_log_max_ver 2.0 -# Tests are only run with rpmbuild --with tests -# Need to investigate errors -%global with_tests %{?_with_tests:1}%{!?_with_tests:0} +# Build using "--without tests" to disable tests +%global with_tests %{?_without_tests:0}%{!?_without_tests:1} + +%{!?__phpunit: %global __phpunit %{_bindir}/phpunit} +%{!?phpdir: %global phpdir %{_datadir}/php} Name: php-SymfonyCmfRouting Version: %{github_version} -Release: 1%{?dist}.1 +Release: 1%{?dist} Summary: Extends the Symfony2 routing component for dynamic routes and chaining Group: Development/Libraries License: MIT -URL: http://symfony.com/doc/master/cmf/components/routing/index.html +URL: http://symfony.com/doc/master/cmf/book/routing.html Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch %if %{with_tests} -# For tests -BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-pear(pear.phpunit.de/PHPUnit) -BuildRequires: php-pear(pear.symfony.com/Config) >= %{symfony_min_ver} -BuildRequires: php-pear(pear.symfony.com/Config) < %{symfony_max_ver} -BuildRequires: php-pear(pear.symfony.com/DependencyInjection) >= %{symfony_min_ver} -BuildRequires: php-pear(pear.symfony.com/DependencyInjection) < %{symfony_max_ver} -BuildRequires: php-pear(pear.symfony.com/EventDispatcher) >= %{symfony_min_ver} -BuildRequires: php-pear(pear.symfony.com/EventDispatcher) < %{symfony_max_ver} -BuildRequires: php-pear(pear.symfony.com/HttpKernel) >= %{symfony_min_ver} -BuildRequires: php-pear(pear.symfony.com/HttpKernel) < %{symfony_max_ver} -BuildRequires: php-pear(pear.symfony.com/Routing) >= %{symfony_min_ver} -BuildRequires: php-pear(pear.symfony.com/Routing) < %{symfony_max_ver} -BuildRequires: php-PsrLog >= %{psr_log_min_ver} -BuildRequires: php-PsrLog < %{psr_log_max_ver} -# For tests: phpcompatinfo +# composer.json +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} +BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} +BuildRequires: php-phpunit-PHPUnit +BuildRequires: php-symfony-config >= %{symfony_min_ver} +BuildRequires: php-symfony-config < %{symfony_max_ver} +BuildRequires: php-symfony-dependencyinjection >= %{symfony_min_ver} +BuildRequires: php-symfony-dependencyinjection < %{symfony_max_ver} +BuildRequires: php-symfony-eventdispatcher >= %{symfony_min_ver} +BuildRequires: php-symfony-eventdispatcher < %{symfony_max_ver} +BuildRequires: php-symfony-httpkernel >= %{symfony_min_ver} +BuildRequires: php-symfony-httpkernel < %{symfony_max_ver} +BuildRequires: php-symfony-routing >= %{symfony_min_ver} +BuildRequires: php-symfony-routing < %{symfony_max_ver} +# phpcompatinfo (computed from version 1.2.0) BuildRequires: php-pcre BuildRequires: php-spl %endif -Requires: php(language) >= %{php_min_ver} -Requires: php-pear(pear.symfony.com/HttpKernel) >= %{symfony_min_ver} -Requires: php-pear(pear.symfony.com/HttpKernel) < %{symfony_max_ver} -Requires: php-pear(pear.symfony.com/Routing) >= %{symfony_min_ver} -Requires: php-pear(pear.symfony.com/Routing) < %{symfony_max_ver} -Requires: php-PsrLog >= %{psr_log_min_ver} -Requires: php-PsrLog < %{psr_log_max_ver} -# Optional -Requires: php-pear(pear.symfony.com/EventDispatcher) >= %{symfony_min_ver} -Requires: php-pear(pear.symfony.com/EventDispatcher) < %{symfony_max_ver} -# phpcompatinfo +# composer.json +Requires: php(language) >= %{php_min_ver} +Requires: php-composer(psr/log) >= %{psr_log_min_ver} +Requires: php-composer(psr/log) < %{psr_log_max_ver} +Requires: php-symfony-httpkernel >= %{symfony_min_ver} +Requires: php-symfony-httpkernel < %{symfony_max_ver} +Requires: php-symfony-routing >= %{symfony_min_ver} +Requires: php-symfony-routing < %{symfony_max_ver} +# composer.json: optional +Requires: php-symfony-eventdispatcher >= %{symfony_min_ver} +Requires: php-symfony-eventdispatcher < %{symfony_max_ver} +# phpcompatinfo (computed from version 1.2.0) Requires: php-pcre Requires: php-spl +# Composer +Provides: php-composer(symfony-cmf/routing) = %{version} + %description -The Symfony CMF Routing component extends the Symfony2 core routing component -to allow more flexibility. The most important difference is that the CMF -Routing component can load routing information from a database. +The Symfony CMF Routing component extends the Symfony2 core routing component. +It provides: +* A ChainRouter to run several routers in parallel +* A DynamicRouter that can load routes from any database and can generate + additional information in the route match +Even though it has Symfony in its name, the Routing component does not need the +full Symfony2 Framework and can be used in standalone projects. -%prep -%setup -q -n %{github_name}-%{github_commit} -# Overwrite Tests/bootstrap.php (which uses Composer autoloader) -# with a simple spl autoloader -( cat <<'AUTOLOAD' - Tests/bootstrap.php +%prep +%setup -qn %{github_name}-%{github_commit} %build @@ -88,35 +100,52 @@ AUTOLOAD %install -mkdir -p -m 755 %{buildroot}%{_datadir}/php/Symfony/Cmf/Component/Routing -cp -rp * %{buildroot}%{_datadir}/php/Symfony/Cmf/Component/Routing/ +mkdir -pm 0755 %{buildroot}%{phpdir}/Symfony/Cmf/Component/Routing +cp -rp * %{buildroot}%{phpdir}/Symfony/Cmf/Component/Routing/ %check %if %{with_tests} -%{_bindir}/phpunit \ - -d include_path="%{buildroot}%{_datadir}/php:%{pear_phpdir}" \ - -c phpunit.xml.dist +# Create autoloader +mkdir vendor +cat > vendor/autoload.php <<'AUTOLOAD' + - 1.2.0-1 +- Updated to 1.2.0 (BZ #1096125) +- Enabled tests by default +- Updated URL, description, dependencies, %%check, and %%files +- Added "php-composer(symfony-cmf/routing)" virtual provide +- %%license usage + * Sat Nov 16 2013 Remi Collet - 1.1.0-1.1 - backport 1.1.0 for remi repo. -- cgit