From f46d176af1237fd18ea4fb6eb9254897c187b650 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 21 Nov 2019 11:24:16 +0100 Subject: - update to 3.0.0 - move to /usr/share/php/Twig3 - raise dependency on PHP 7.2.9 - drop dependency on symfony/polyfill-mbstring --- php-twig3.spec | 71 ++++++++++++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 39 deletions(-) (limited to 'php-twig3.spec') diff --git a/php-twig3.spec b/php-twig3.spec index 307bcfb..00aa05e 100644 --- a/php-twig3.spec +++ b/php-twig3.spec @@ -1,6 +1,6 @@ -# fedora/remirepo spec file for php-twig2, from +# fedora/remirepo spec file for php-twig3, from # -# Fedora spec file for php-twig +# Fedora spec file for php-twig3 # # Copyright (c) 2014-2019 Shawn Iwinski # Remi Collet @@ -13,18 +13,20 @@ %global with_tests 0%{!?_without_tests:1} %global github_owner twigphp %global github_name Twig -%global github_commit d761fd1f1c6b867ae09a7d8119a6d95d06dc44ed +%global github_commit 9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26 %global github_short %(c=%{github_commit}; echo ${c:0:7}) %global composer_vendor twig %global composer_project twig -# "php": "^7.0" -%global php_min_ver 7.0 +%global major 3 + +# "php": "^7.2.9" +%global php_min_ver 7.2.9 %global phpdir %{_datadir}/php -Name: php-%{composer_project}2 -Version: 2.12.2 +Name: php-%{composer_project}%{major} +Version: 3.0.0 Release: 1%{?dist} Summary: The flexible, fast, and secure template engine for PHP @@ -38,26 +40,23 @@ BUildArch: noarch BuildRequires: php-fedora-autoloader-devel %if %{with_tests} # For tests -BuildRequires: php(language) >= 7.1 +BuildRequires: php(language) >= %{php_min_ver} BuildRequires: phpunit7 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: (php-composer(symfony/debug) >= 4.2 with php-composer(symfony/debug) < 5) +BuildRequires: (php-composer(symfony/debug) >= 4.2 with php-composer(symfony/debug) < 6) BuildRequires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2) -BuildRequires: (php-composer(symfony/polyfill-mbstring) >= 1.3 with php-composer(symfony/polyfill-mbstring) < 2) -# remirepo:7 +# remirepo:4 %else BuildRequires: php-symfony3-debug >= 3.4 -BuildRequires: php-composer(psr/container) < 2 -BuildRequires: php-composer(psr/container) >= 1.0 -BuildRequires: php-symfony-polyfill < 2 -BuildRequires: php-symfony-polyfill >= 1.3 +BuildRequires: php-psr-container >= 1.0 %endif # Workaround BuildRequires: php-symfony-common -## phpcompatinfo (computed from version 2.11.3) +## phpcompatinfo (computed from version 3.0.0) BuildRequires: php-ctype BuildRequires: php-date +BuildRequires: php-filter BuildRequires: php-hash BuildRequires: php-iconv BuildRequires: php-json @@ -70,17 +69,10 @@ BuildRequires: php-simplexml ## composer.json Requires: php(language) >= %{php_min_ver} -# remirepo:1 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(symfony/polyfill-mbstring) >= 1.3 with php-composer(symfony/polyfill-mbstring) < 2) -# remirepo:4 -%else -Requires: php-symfony-polyfill < 2 -Requires: php-symfony-polyfill >= 1.3 -%endif -## phpcompatinfo (computed from version 2.11.3) +## phpcompatinfo (computed from version 3.0.0) Requires: php-ctype Requires: php-date +Requires: php-filter Requires: php-hash Requires: php-iconv Requires: php-json @@ -115,29 +107,23 @@ 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 -phpab --template fedora --output lib/Twig/autoload.php lib/Twig -cat << 'EOF' | tee -a lib/Twig/autoload.php +phpab --template fedora --output src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php require_once '%{phpdir}/Symfony/Polyfill/autoload.php'; EOF %install mkdir -p %{buildroot}%{phpdir} -cp -rp lib/Twig %{buildroot}%{phpdir}/Twig2 +cp -rp src %{buildroot}%{phpdir}/Twig%{major} %check : Check library version -%{_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"; +%{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Twig%{major}/autoload.php"; exit(version_compare("%{version}", Twig\Environment::VERSION, "=") ? 0 : 1);' %if %{with_tests} @@ -147,10 +133,11 @@ phpab --output vendor/autoload.php tests cat << 'EOF' | tee -a vendor/autoload.php // This library -require_once '%{buildroot}%{phpdir}/Twig2/autoload.php'; +require_once '%{buildroot}%{phpdir}/Twig%{major}/autoload.php'; // Dependencies (require-dev) \Fedora\Autoloader\Dependencies::required([ [ + '%{phpdir}/Symfony5/Component/Debug/autoload.php', '%{phpdir}/Symfony4/Component/Debug/autoload.php', '%{phpdir}/Symfony3/Component/Debug/autoload.php', ], @@ -158,12 +145,12 @@ require_once '%{buildroot}%{phpdir}/Twig2/autoload.php'; ]); EOF -: Disable listener from symfony/phpunit-bridge ~3.2 +: Disable listener from symfony/phpunit-bridge 4.4 sed -e '/listener/d' phpunit.xml.dist > phpunit.xml RETURN_CODE=0 : Upstream tests with SCLs if available -for SCL in php php71 php72 php73 php74; do +for SCL in php php72 php73 php74; do if which $SCL; then $SCL %{_bindir}/phpunit7 --verbose || RETURN_CODE=1 fi @@ -179,10 +166,16 @@ exit $RETURN_CODE %{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGELOG README.rst composer.json -%{phpdir}/Twig2 +%{phpdir}/Twig%{major} %changelog +* Thu Nov 21 2019 Remi Collet - 3.0.0-1 +- update to 3.0.0 +- move to /usr/share/php/Twig3 +- raise dependency on PHP 7.2.9 +- drop dependency on symfony/polyfill-mbstring + * Tue Nov 12 2019 Remi Collet - 2.12.2-1 - update to 2.12.2 -- cgit