From 9f66bfe3ed7e6c91f093f1732fd112ba2b3f2129 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 30 May 2016 13:48:39 +0200 Subject: php-twig: 1.24.1 --- REFLECTION | 2 +- composer.json | 46 ++++++++++++++++++++++++++++++++++++++++++++++ php-twig.spec | 30 ++++++++++++++++++++++++++++-- 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 composer.json diff --git a/REFLECTION b/REFLECTION index 9e84344..6cd0ced 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #172 twig version 1.24.0 ] { +Extension [ extension #172 twig version 1.24.1 ] { - Functions { Function [ function twig_template_get_attributes ] { diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..507d8ae --- /dev/null +++ b/composer.json @@ -0,0 +1,46 @@ +{ + "name": "twig/twig", + "type": "library", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "keywords": ["templating"], + "homepage": "http://twig.sensiolabs.org", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "support": { + "forum": "https://groups.google.com/forum/#!forum/twig-users" + }, + "require": { + "php": ">=5.2.7" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7", + "symfony/debug": "~2.7" + }, + "autoload": { + "psr-0" : { + "Twig_" : "lib/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.24-dev" + } + } +} diff --git a/php-twig.spec b/php-twig.spec index 3389228..f2cfd2b 100644 --- a/php-twig.spec +++ b/php-twig.spec @@ -14,10 +14,16 @@ %global github_owner twigphp %global github_name Twig -%global github_version 1.24.0 -%global github_commit 3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8 +%global github_version 1.24.1 +%global github_commit 3566d311a92aae4deec6e48682dc5a4528c4a512 %global github_short %(c=%{github_commit}; echo ${c:0:7}) +%if "%{php_version}" < "7" +%global with_ext 1 +%else +%global with_ext 0 +BuildArch: noarch +%endif # Lib %global composer_vendor twig @@ -171,6 +177,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qn %{github_name}-%{github_commit} +%if %{with_ext} : Ext -- NTS mv ext/%{ext_name} ext/NTS %if %{with_zts} @@ -183,6 +190,7 @@ cat > %{ini_name} << 'INI' ; Enable %{ext_name} extension module extension=%{ext_name}.so INI +%endif : Create lib autoloader cat <<'AUTOLOAD' | tee lib/Twig/autoload.php @@ -197,8 +205,12 @@ require_once __DIR__ . '/Autoloader.php'; Twig_Autoloader::register(); AUTOLOAD +: Disable deprecated warning +sed -e '/trigger_error/d' -i lib/Twig/Autoloader.php + %build +%if %{with_ext} : Ext -- NTS pushd ext/NTS %{_bindir}/phpize @@ -214,6 +226,7 @@ pushd ext/ZTS make %{?_smp_mflags} popd %endif +%endif %install @@ -223,6 +236,7 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{phpdir} cp -rp lib/* %{buildroot}%{phpdir}/ +%if %{with_ext} : Ext -- NTS make -C ext/NTS install INSTALL_ROOT=%{buildroot} install -D -m 0644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -231,6 +245,7 @@ install -D -m 0644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} make -C ext/ZTS install INSTALL_ROOT=%{buildroot} install -D -m 0644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif +%endif %check @@ -238,6 +253,7 @@ 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);' +%if %{with_ext} : Extension version check EXT_VERSION=`grep PHP_TWIG_VERSION ext/NTS/php_twig.h | awk '{print $3}' | sed 's/"//g'` \ %{_bindir}/php -r 'exit(version_compare("%{version}", getenv("EXT_VERSION"), "=") ? 0 : 1);' @@ -253,6 +269,7 @@ EXT_VERSION=`grep PHP_TWIG_VERSION ext/NTS/php_twig.h | awk '{print $3}' | sed ' --define extension=ext/ZTS/modules/%{ext_name}.so \ --modules | grep %{ext_name} %endif +%endif %if %{with_tests} : Skip tests known to fail @@ -264,6 +281,7 @@ sed -e 's/function testGetAttributeWithTemplateAsObject/function skip_testGetAtt : Test suite without extension %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Twig/autoload.php --verbose +%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 @@ -271,6 +289,7 @@ sed -e 's/function testGetAttributeWithTemplateAsObject/function skip_testGetAtt if which php70; then php70 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Twig/autoload.php --verbose fi +%endif %else : Tests skipped %endif @@ -287,6 +306,7 @@ rm -rf %{buildroot} %doc CHANGELOG README.rst composer.json # Lib %{phpdir}/Twig +%if %{with_ext} # Ext ## NTS %config(noreplace) %{php_inidir}/%{ini_name} @@ -296,9 +316,15 @@ rm -rf %{buildroot} %config(noreplace) %{php_ztsinidir}/%{ini_name} %{php_ztsextdir}/%{ext_name}.so %endif +%endif %changelog +* Mon May 30 2016 Remi Collet - 1.24.1-1 +- Update to 1.24.1 +- disable deprecation warning +- disable extension build with PHP 7 + * Tue Jan 26 2016 Remi Collet - 1.24.0-1 - Update to 1.24.0 -- cgit