From b72d6123bbaab895499ec4ca36d55a61a78d16a0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Jun 06 2017 07:46:59 +0000 Subject: Update to 2.4.2 add namespaced compat library (cherry picked from commit 5025d607c380e5b94b581eb3bee5aa32e6efca27) --- diff --git a/.gitignore b/.gitignore index 95ca51a..821b222 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clog /php-twig2-2.2.0-29bb02d.tar.gz /php-twig2-2.3.0-9718186.tar.gz /php-twig2-2.3.2-85e8372.tar.gz +/php-twig2-2.4.2-fe3e3f3.tar.gz diff --git a/php-twig2.spec b/php-twig2.spec index 86df66b..023774d 100644 --- a/php-twig2.spec +++ b/php-twig2.spec @@ -13,7 +13,7 @@ %global with_tests 0%{!?_without_tests:1} %global github_owner twigphp %global github_name Twig -%global github_commit 85e8372c451510165c04bf781295f9d922fa524b +%global github_commit fe3e3f3359b23b36f65cb600cd516142c07a2e7d %global github_short %(c=%{github_commit}; echo ${c:0:7}) %global composer_vendor twig @@ -24,7 +24,7 @@ %global phpdir %{_datadir}/php Name: php-%{composer_project}2 -Version: 2.3.2 +Version: 2.4.2 Release: 1%{?dist} Summary: The flexible, fast, and secure template engine for PHP @@ -40,10 +40,11 @@ BuildRequires: php-fedora-autoloader-devel # For tests BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: php-composer(symfony/phpunit-bridge) +BuildRequires: php-composer(symfony/debug) < 3 BuildRequires: php-composer(symfony/debug) >= 2.7 +BuildRequires: php-composer(psr/container) < 2 BuildRequires: php-composer(psr/container) >= 1.0 -## phpcompatinfo (computed from version 2.0.0) +## phpcompatinfo (computed from version 2.4.2) BuildRequires: php-ctype BuildRequires: php-date BuildRequires: php-hash @@ -58,7 +59,7 @@ BuildRequires: php-simplexml ## composer.json Requires: php(language) >= %{php_min_ver} -## phpcompatinfo (computed from version 2.0.0) +## phpcompatinfo (computed from version 2.4.2) Requires: php-ctype Requires: php-date Requires: php-hash @@ -95,6 +96,9 @@ Autoloader: %{phpdir}/Twig2/autoload.php %prep %setup -qn %{github_name}-%{github_commit} +: Move the PSR-4 compat library +mv src lib/Twig/psr4 + %build : Create classmap autoloader @@ -111,25 +115,28 @@ cp -rp lib/Twig %{buildroot}%{phpdir}/Twig2 %{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Twig2/autoload.php"; exit(version_compare("%{version}", Twig_Environment::VERSION, "=") ? 0 : 1);' +%{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Twig2/autoload.php"; + exit(version_compare("%{version}", Twig\Environment::VERSION, "=") ? 0 : 1);' + %if %{with_tests} mkdir vendor phpab --output vendor/autoload.php test + cat << 'EOF' | tee -a vendor/autoload.php // This library require_once '%{buildroot}%{phpdir}/Twig2/autoload.php'; // Dependencies (require-dev) -require_once '%{phpdir}/Symfony/Bridge/PhpUnit/autoload.php'; require_once '%{phpdir}/Symfony/Component/Debug/autoload.php'; require_once '%{phpdir}/Psr/Container/autoload.php'; EOF -: Upstream test suite -RETURN_CODE=0 -%{_bindir}/phpunit --verbose || RETURN_CODE=1 +: Disable listener from symfony/phpunit-bridge ~3.2 +sed -e '/listener/d' phpunit.xml.dist > phpunit.xml +RETURN_CODE=0 : Upstream tests with SCLs if available -for SCL in php70 php71; do +for SCL in php php70 php71 php72; do if which $SCL; then $SCL %{_bindir}/phpunit --verbose || RETURN_CODE=1 fi @@ -148,6 +155,10 @@ exit $RETURN_CODE %changelog +* Tue Jun 6 2017 Remi Collet - 2.4.2-1 +- Update to 2.4.2 +- add namespaced compat library + * Fri Apr 21 2017 Remi Collet - 2.3.2-1 - Update to 2.3.2 diff --git a/sources b/sources index ca05538..1690b28 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-twig2-2.3.2-85e8372.tar.gz) = 377b6c064e8bd7f6b25a1f1b3b988aec03577512cf7abb2b73c3206c0dabf5b2bd379ecec606de8dc2d16668163f4ae07bf48cc01c7ff3f6b86324dd9bdde74f +SHA512 (php-twig2-2.4.2-fe3e3f3.tar.gz) = 2e624bb00d3be8685ff9df1ce32371a8291341e4d964bc56bfad53f12a3bc81eb7aef58a9b52dc9a9bb0580fc584f0e404bb968438c8dbe0713ed65cb2ee45f5