Update to 1.34.2

raise dependency on PHP 5.3.3
add namespaced compat library
switch to fedora/autoloader
drop build dependency on symfony/phpunit-bridge
This commit is contained in:
Remi Collet 2017-06-06 10:09:13 +02:00
commit 5bf2e25d8f
3 changed files with 42 additions and 33 deletions

1
.gitignore vendored
View file

@ -23,3 +23,4 @@ clog
/php-twig-1.32.0-9935b662e24d6e634da88901ab534cc12e8c728f.tar.gz
/php-twig-1.33.0-05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a.tar.gz
/php-twig-1.33.2-dd6ca96227917e1e85b41c7c3cc6507b411e0927.tar.gz
/php-twig-1.34.2-55e4beb721a044db9e31ae0470024fc205b6a008.tar.gz

View file

@ -12,8 +12,8 @@
%global github_owner twigphp
%global github_name Twig
%global github_version 1.33.2
%global github_commit dd6ca96227917e1e85b41c7c3cc6507b411e0927
%global github_version 1.34.2
%global github_commit 55e4beb721a044db9e31ae0470024fc205b6a008
%if 0%{?fedora} < 25
%global with_ext 1
@ -58,10 +58,11 @@ BuildRequires: php-devel >= %{php_min_ver}
# Tests
%if %{with_tests}
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 1.26.0)
## phpcompatinfo (computed from version 1.34.2)
BuildRequires: php-ctype
BuildRequires: php-date
BuildRequires: php-dom
@ -73,11 +74,13 @@ BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-spl
%endif
# Autoloader
BuildRequires: php-fedora-autoloader-devel
# Lib
## composer.json
Requires: php(language) >= %{php_min_ver}
## phpcompatinfo (computed from version 1.26.0)
## phpcompatinfo (computed from version 1.34.2)
Requires: php-ctype
Requires: php-date
Requires: php-dom
@ -93,6 +96,8 @@ Requires: php-spl
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
%endif
# Autoloader
Requires: php-composer(fedora/autoloader)
# Lib
## Composer
@ -157,21 +162,11 @@ extension=%{ext_name}.so
INI
%endif
: Move the PSR-4 compat library
mv src lib/Twig/psr4
: Create lib autoloader
cat <<'AUTOLOAD' | tee lib/Twig/autoload.php
<?php
/**
* Autoloader for %{name} and its' dependencies
*
* Created by %{name}-%{version}-%{release}
*/
require_once __DIR__ . '/Autoloader.php';
Twig_Autoloader::register();
AUTOLOAD
: Disable deprecated warning
sed -e '/trigger_error/d' -i lib/Twig/Autoloader.php
phpab --template fedora --output lib/Twig/autoload.php lib
%build
@ -195,7 +190,7 @@ popd
%install
: Lib
: PSR-0 and PSR-4 Libraries
mkdir -p %{buildroot}%{phpdir}
cp -rp lib/* %{buildroot}%{phpdir}/
@ -216,6 +211,9 @@ install -D -m 0644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Twig/autoload.php";
exit(version_compare("%{version}", Twig_Environment::VERSION, "=") ? 0 : 1);'
%{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Twig/autoload.php";
exit(version_compare("%{version}", Twig\Environment::VERSION, "=") ? 0 : 1);'
%if %{with_ext}
: Extension version check
EXT_VERSION=`grep PHP_TWIG_VERSION ext/NTS/php_twig.h | awk '{print $3}' | sed 's/"//g'` \
@ -240,18 +238,14 @@ mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require_once '%{buildroot}%{phpdir}/Twig/autoload.php';
// Dependencies (require-dev)
if (!file_exists('%{phpdir}/Zend/Expressive-Twig-autoload.php')) {
require_once '%{phpdir}/Symfony/Bridge/PhpUnit/autoload.php';
}
require_once '%{phpdir}/Symfony/Component/Debug/autoload.php';
require_once '%{phpdir}/Psr/Container/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Symfony/Component/Debug/autoload.php',
'%{phpdir}/Psr/Container/autoload.php',
));
EOF
if [ -f %{phpdir}/Zend/Expressive-Twig-autoload.php ]; then
: Disable listener from symfony/phpunit-bridge ~3.2
sed -e '/listener/d' phpunit.xml.dist > phpunit.xml
fi
: Disable listener from symfony/phpunit-bridge ~3.2
sed -e '/listener/d' phpunit.xml.dist > phpunit.xml
: Skip tests known to fail
sed -e 's#function testGetAttributeExceptions#function SKIP_testGetAttributeExceptions#' \
@ -263,13 +257,20 @@ sed 's/function testGetAttributeWithTemplateAsObject/function SKIP_testGetAttrib
%endif
: Test suite without extension
%{_bindir}/phpunit --verbose
ret=0
for cmd in php php56 php70 php71 php72; do
if which $cmd; then
$cmd %{_bindir}/phpunit --verbose || ret=1
fi
done
%if %{with_ext}
: Test suite with extension
%{_bindir}/php --define extension=ext/NTS/modules/%{ext_name}.so \
%{_bindir}/phpunit --verbose
%{_bindir}/phpunit --verbose || ret=1
%endif
exit $ret
%else
: Tests skipped
%endif
@ -295,6 +296,13 @@ sed 's/function testGetAttributeWithTemplateAsObject/function SKIP_testGetAttrib
%changelog
* Tue Jun 6 2017 Remi Collet <remi@remirepo.net> - 1.34.2-1
- Update to 1.34.2
- raise dependency on PHP 5.3.3
- add namespaced compat library
- switch to fedora/autoloader
- drop build dependency on symfony/phpunit-bridge
* Mon Apr 24 2017 Remi Collet <remi@remirepo.net> - 1.33.2-1
- Update to 1.33.2

View file

@ -1 +1 @@
SHA512 (php-twig-1.33.2-dd6ca96227917e1e85b41c7c3cc6507b411e0927.tar.gz) = b0e958760cba881ec4b04018b79d86a6b76b317803f9655a549d7eee41e5daaf3991885e5b77b804a036cfa429f0a23a1fa7e66d57e318ab991ca313b88d94d3
SHA512 (php-twig-1.34.2-55e4beb721a044db9e31ae0470024fc205b6a008.tar.gz) = 290e0fcb479ab4684945efb03295e8901a5f755ccabaed524c88b48dc455c94c89d853e93899b003aa106c59e1944df6bcec45beb21105e4d12115118e470258