summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-02-27 07:39:47 +0100
committerRemi Collet <fedora@famillecollet.com>2017-02-27 07:39:47 +0100
commit7ce5b1d928d7c22864ad980fbacd924e48306944 (patch)
tree2612cd72acb2e02f5ebe9bfe8a93241536e97218
parent9eb15da0d905ad20d9b2d2b8edb808811fa7eb6c (diff)
php-twig: 1.32.0
-rw-r--r--REFLECTION2
-rw-r--r--composer.json5
-rw-r--r--php-twig.spec43
3 files changed, 36 insertions, 14 deletions
diff --git a/REFLECTION b/REFLECTION
index 167de6d..191dda6 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #73 twig version 1.31.0 ] {
+Extension [ <persistent> extension #75 twig version 1.32.0 ] {
- Functions {
Function [ <internal:twig> function twig_template_get_attributes ] {
diff --git a/composer.json b/composer.json
index b1ef8f2..f53b91b 100644
--- a/composer.json
+++ b/composer.json
@@ -31,7 +31,8 @@
},
"require-dev": {
"symfony/phpunit-bridge": "~3.2",
- "symfony/debug": "~2.7"
+ "symfony/debug": "~2.7",
+ "psr/container": "^1.0"
},
"autoload": {
"psr-0" : {
@@ -40,7 +41,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.31-dev"
+ "dev-master": "1.32-dev"
}
}
}
diff --git a/php-twig.spec b/php-twig.spec
index 5e8e135..2f14d73 100644
--- a/php-twig.spec
+++ b/php-twig.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-twig
#
-# Copyright (c) 2014-2016 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2014-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
# Remi Collet <remi@fedoraproject.org>
#
# License: MIT
@@ -30,8 +30,8 @@
%global github_owner twigphp
%global github_name Twig
-%global github_version 1.31.0
-%global github_commit ddc9e3e20ee9c0b6908f401ac8353635b750eca7
+%global github_version 1.32.0
+%global github_commit 9935b662e24d6e634da88901ab534cc12e8c728f
%global github_short %(c=%{github_commit}; echo ${c:0:7})
%if "%{php_version}" < "7"
@@ -73,7 +73,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel >= %{php_min_ver}
%if %{with_tests}
# For tests
-BuildRequires: %{_bindir}/phpunit
+BuildRequires: php-composer(phpunit/phpunit)
+BuildRequires: php-composer(symfony/phpunit-bridge)
+BuildRequires: php-composer(symfony/debug) >= 2.7
+BuildRequires: php-composer(psr/container) >= 1.0
## phpcompatinfo (computed from version 1.23.3)
BuildRequires: %{?scl_prefix}php-ctype
BuildRequires: %{?scl_prefix}php-date
@@ -135,7 +138,7 @@ Provides: %{?scl_prefix}php-pecl(pear.twig-project.org/CTwig)%{?_isa} = %{v
# This pkg was the only one in this channel so the channel is no longer needed
Obsoletes: %{?scl_prefix}php-channel-twig
-%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
+%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
Obsoletes: php53-%{ext_name} <= %{version}
Obsoletes: php53u-%{ext_name} <= %{version}
@@ -284,35 +287,50 @@ EXT_VERSION=`grep PHP_TWIG_VERSION ext/NTS/php_twig.h | awk '{print $3}' | sed '
%endif
%if %{with_tests}
+: Generate autoloader
+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';
+EOF
+
: Skip tests known to fail
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
sed -e 's/function testGetAttributeWithTemplateAsObject/function skip_testGetAttributeWithTemplateAsObject/' \
-i test/Twig/Tests/TemplateTest.php
%endif
-: Disable listener from symfony/phpunit-bridge 3.2@dev
-sed -e '/listener/d' phpunit.xml.dist > phpunit.xml
+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
: Test suite without extension
# remirepo:11
run=0
ret=0
if which php56; then
- php56 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Twig/autoload.php || ret=1
+ php56 %{_bindir}/phpunit || ret=1
run=1
fi
if which php71; then
- php71 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Twig/autoload.php || ret=1
+ php71 %{_bindir}/phpunit || ret=1
run=1
fi
if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Twig/autoload.php --verbose || ret=1
+%{_bindir}/phpunit --verbose || ret=1
# remirepo:1
fi
%if %{with_ext}
: Test suite with extension
%{_bindir}/php --define extension=ext/NTS/modules/%{ext_name}.so \
- %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Twig/autoload.php --verbose || ret=1
+ %{_bindir}/phpunit --verbose || ret=1
%endif
exit $ret
@@ -346,6 +364,9 @@ rm -rf %{buildroot}
%changelog
+* Mon Feb 27 2017 Remi Collet <remi@fedoraproject.org> - 1.32.0-1
+- Update to 1.32.0
+
* Thu Jan 12 2017 Remi Collet <remi@fedoraproject.org> - 1.31.0-1
- Update to 1.31.0