summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-06-06 09:12:44 +0200
committerRemi Collet <remi@remirepo.net>2017-06-06 09:12:44 +0200
commit9a51a8cf5057c1e9d121c8ee956a816278b4f92e (patch)
tree4468f372a61924798975eca0eb30069f575bbc13
parentd716444abf354297bb204bc8a9a0a311567f03a5 (diff)
v2.4.2
-rw-r--r--composer.json5
-rw-r--r--php-twig2.spec31
2 files changed, 25 insertions, 11 deletions
diff --git a/composer.json b/composer.json
index 9b5d0bc..d7c9756 100644
--- a/composer.json
+++ b/composer.json
@@ -38,6 +38,9 @@
"autoload": {
"psr-0" : {
"Twig_" : "lib/"
+ },
+ "psr-4" : {
+ "Twig\\" : "src/"
}
},
"autoload-dev": {
@@ -47,7 +50,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
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 <remi@remirepo.net> - 2.4.2-1
+- Update to 2.4.2
+- add namespaced compat library
+
* Fri Apr 21 2017 Remi Collet <remi@remirepo.net> - 2.3.2-1
- Update to 2.3.2