summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-06-06 09:03:45 +0200
committerRemi Collet <remi@remirepo.net>2017-06-06 09:03:45 +0200
commit6f8b51d7f1f0025f95dc77f810bbe304c73f9fbf (patch)
treed2288e64675f0df7cfdf71866d8c90c23476da05
parent2e29f48b249d426c4b571367f05979b276f0779a (diff)
v1.34.2
-rw-r--r--REFLECTION2
-rw-r--r--composer.json7
-rw-r--r--php-twig.spec85
3 files changed, 44 insertions, 50 deletions
diff --git a/REFLECTION b/REFLECTION
index 0c399ec..6d2055f 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #75 twig version 1.33.2 ] {
+Extension [ <persistent> extension #75 twig version 1.34.2 ] {
- Functions {
Function [ <internal:twig> function twig_template_get_attributes ] {
diff --git a/composer.json b/composer.json
index b89f14c..71ceed8 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
"forum": "https://groups.google.com/forum/#!forum/twig-users"
},
"require": {
- "php": ">=5.2.7"
+ "php": ">=5.3.3"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.3@dev",
@@ -37,11 +37,14 @@
"autoload": {
"psr-0" : {
"Twig_" : "lib/"
+ },
+ "psr-4" : {
+ "Twig\\" : "src/"
}
},
"extra": {
"branch-alias": {
- "dev-master": "1.33-dev"
+ "dev-master": "1.34-dev"
}
}
}
diff --git a/php-twig.spec b/php-twig.spec
index 31b37da..030ed41 100644
--- a/php-twig.spec
+++ b/php-twig.spec
@@ -30,8 +30,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
%global github_short %(c=%{github_commit}; echo ${c:0:7})
%if "%{php_version}" < "7"
@@ -54,8 +54,8 @@ BuildArch: noarch
%global ini_name 40-%{ext_name}.ini
%endif
-# "php": ">=5.2.7"
-%global php_min_ver 5.2.7
+# "php": ">=5.3.3"
+%global php_min_ver 5.3.3
%global phpdir %{_datadir}/php
@@ -73,10 +73,11 @@ BuildRequires: %{?scl_prefix}php-devel >= %{php_min_ver}
%if %{with_tests}
# For 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.23.3)
+## phpcompatinfo (computed from version 1.34.2)
BuildRequires: %{?scl_prefix}php-ctype
BuildRequires: %{?scl_prefix}php-date
BuildRequires: %{?scl_prefix}php-dom
@@ -88,11 +89,13 @@ BuildRequires: %{?scl_prefix}php-pcre
BuildRequires: %{?scl_prefix}php-reflection
BuildRequires: %{?scl_prefix}php-spl
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# Lib
## composer.json
Requires: %{?scl_prefix}php(language) >= %{php_min_ver}
-## phpcompatinfo (computed from version 1.22.2)
+## phpcompatinfo (computed from version 1.34.2)
Requires: %{?scl_prefix}php-ctype
Requires: %{?scl_prefix}php-date
Requires: %{?scl_prefix}php-dom
@@ -109,6 +112,8 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# Lib
## Composer
@@ -210,21 +215,11 @@ extension=%{ext_name}.so
INI
%endif
-: 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
+: Move the PSR-4 compat library
+mv src lib/Twig/psr4
-: Disable deprecated warning
-sed -e '/trigger_error/d' -i lib/Twig/Autoloader.php
+: Create lib autoloader
+phpab --template fedora --output lib/Twig/autoload.php lib
%build
@@ -252,7 +247,7 @@ popd
%install
%{?dtsenable}
-: Lib
+: PSR-0 and PSR-4 Libraries
mkdir -p %{buildroot}%{phpdir}
cp -rp lib/* %{buildroot}%{phpdir}/
@@ -273,6 +268,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'` \
@@ -297,12 +295,10 @@ 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
: Skip tests known to fail
@@ -310,28 +306,17 @@ EOF
sed -e 's/function testGetAttributeWithTemplateAsObject/function skip_testGetAttributeWithTemplateAsObject/' \
-i test/Twig/Tests/TemplateTest.php
%endif
-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
: Test suite without extension
-# remirepo:11
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose || ret=1
-# remirepo:1
-fi
-
+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 \
@@ -364,6 +349,12 @@ exit $ret
%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
+
* Fri Apr 21 2017 Remi Collet <remi@remirepo.net> - 1.33.2-1
- Update to 1.33.2