From c45d408da3fd2330f01cfc8845a6fa1011f4019d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 10 Jul 2017 06:34:32 +0200 Subject: v1.5.1 (from Fedora) --- composer.json | 11 ++-- php-twig-extensions-upstream.patch | 36 ----------- php-twig-extensions.spec | 122 ++++++++++++++++++++----------------- 3 files changed, 71 insertions(+), 98 deletions(-) delete mode 100644 php-twig-extensions-upstream.patch diff --git a/composer.json b/composer.json index a59ff78..cabcd9c 100644 --- a/composer.json +++ b/composer.json @@ -12,21 +12,22 @@ } ], "require": { - "twig/twig": "~1.20|~2.0" + "twig/twig": "~1.27|~2.0" }, "require-dev": { - "symfony/translation": "~2.3" + "symfony/phpunit-bridge": "~3.3@dev", + "symfony/translation": "~2.3|~3.0" }, "suggest": { "symfony/translation": "Allow the time_diff output to be translated" }, "autoload": { - "psr-0": { "Twig_Extensions_": "lib/" } + "psr-0": { "Twig_Extensions_": "lib/" }, + "psr-4": { "Twig\\Extensions\\": "src/" } }, - "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } } } diff --git a/php-twig-extensions-upstream.patch b/php-twig-extensions-upstream.patch deleted file mode 100644 index 4576737..0000000 --- a/php-twig-extensions-upstream.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 658c6eade785eb8b0257e28dfa5165383aeffcd9 Mon Sep 17 00:00:00 2001 -From: Fabien Potencier -Date: Fri, 30 Sep 2016 13:06:23 -0700 -Subject: [PATCH] fixed tests - ---- - test/Twig/Tests/Extension/DateTest.php | 16 +--------------- - 1 file changed, 1 insertion(+), 15 deletions(-) - -diff --git a/test/Twig/Tests/Extension/DateTest.php b/test/Twig/Tests/Extension/DateTest.php -index 8453d13..0080098 100644 ---- a/test/Twig/Tests/Extension/DateTest.php -+++ b/test/Twig/Tests/Extension/DateTest.php -@@ -21,21 +21,7 @@ class Twig_Tests_Extension_DateTest extends PHPUnit_Framework_TestCase - - public function setUp() - { -- $timezone = new DateTimeZone(date_default_timezone_get()); -- -- $coreExtension = $this->getMockBuilder('Twig_Extension_Core')->getMock(); -- $coreExtension -- ->expects($this->any()) -- ->method('getTimezone') -- ->will($this->returnValue($timezone)); -- -- $this->env = $this->getMockBuilder('Twig_Environment')->disableOriginalConstructor()->getMock(); -- $this->env -- ->expects($this->any()) -- ->method('getExtension') -- ->with('core') -- ->will($this->returnValue($coreExtension)) -- ; -+ $this->env = new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()); - } - - /** diff --git a/php-twig-extensions.spec b/php-twig-extensions.spec index 9836344..0a7c64f 100644 --- a/php-twig-extensions.spec +++ b/php-twig-extensions.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-twig-extensions # -# Copyright (c) 2014-2016 Shawn Iwinski +# Copyright (c) 2014-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,17 +12,17 @@ %global github_owner twigphp %global github_name Twig-extensions -%global github_version 1.4.1 -%global github_commit f0bb8431c8691f5a39f1017d9a5967a082bf01ff +%global github_version 1.5.1 +%global github_commit d188c76168b853481cc75879ea045bf93d718e9c %global composer_vendor twig %global composer_project extensions -# "symfony/translation": "~2.3" -%global symfony_min_ver 2.3 -%global symfony_max_ver 3.0 -# "twig/twig": "~1.20|~2.0" -# 1.27 to avoid Error: Call to undefined method Twig_Node_Expression_Name::getTemplateLine() +# "symfony/translation": "~2.3|~3.0" +# NOTE: Min version not 2.3 because autoloader required +%global symfony_min_ver %{?el6:2.3.31}%{!?el6:2.7.1} +%global symfony_max_ver 4.0 +# "twig/twig": "~1.27|~2.0" %global twig_min_ver 1.27 %global twig_max_ver 3.0 @@ -33,46 +33,51 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 2%{?dist} +Release: 1%{?dist} Summary: Twig extensions Group: Development/Libraries License: MIT -URL: http://twig.sensiolabs.org/doc/extensions/index.html +URL: http://twig-extensions.readthedocs.io/ 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 # Tests %if %{with_tests} BuildRequires: php-composer(phpunit/phpunit) ## composer.json BuildRequires: php-composer(symfony/translation) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/translation) < %{symfony_max_ver} +BuildRequires: php-composer(twig/twig) >= %{twig_min_ver} %if 0%{?fedora} < 25 -BuildRequires: php-composer(twig/twig) < 2 +BuildRequires: php-composer(twig/twig) < 2 +%else +BuildRequires: php-composer(twig/twig) < %{twig_max_ver} %endif -BuildRequires: php-composer(twig/twig) >= %{twig_min_ver} -## phpcompatinfo (computed from version 1.4.0) +## phpcompatinfo (computed from version 1.5.1) +BuildRequires: php(language) >= 5.3.0 BuildRequires: php-date BuildRequires: php-mbstring BuildRequires: php-pcre BuildRequires: php-spl +## Autoloader +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json %if 0%{?fedora} < 25 -Requires: php-composer(twig/twig) < 2 +Requires: php-composer(twig/twig) < 2 %else -Requires: php-composer(twig/twig) < %{twig_max_ver} +Requires: php-composer(twig/twig) < %{twig_max_ver} %endif -Requires: php-composer(twig/twig) >= %{twig_min_ver} +Requires: php-composer(twig/twig) >= %{twig_min_ver} # composer.json: optional Requires: php-composer(symfony/translation) >= %{symfony_min_ver} Requires: php-composer(symfony/translation) < %{symfony_max_ver} -# phpcompatinfo (computed from version 1.4.0) -Requires: php-mbstring -Requires: php-pcre -Requires: php-spl +# phpcompatinfo (computed from version 1.5.1) +Requires: php(language) >= 5.3.0 +# Autoloader +Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -80,6 +85,8 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description Common additional features for Twig that do not directly belong in core Twig. +Autoloader: %{phpdir}/Twig/Extensions/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} @@ -89,18 +96,23 @@ cat <<'AUTOLOAD' | tee lib/Twig/Extensions/autoload.php - 1.5.1-1 +- Update to 1.5.1 (RHBZ #1456812) +- Add max version constraints to BuildRequires +- Switch autoloader to php-composer(fedora/autoloader) +- Add Symfony Translation to autoloader +- Test with SCLs if available + * Fri Jan 6 2017 Remi Collet - 1.4.1-2 - use Twig 2 when installed but ensure it is not pulled by defaut to avoid pulling PHP 7 -- cgit