summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--3563.patch23
-rw-r--r--PHPINFO4
-rw-r--r--REFLECTION17
-rw-r--r--composer.json9
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-twig.spec100
7 files changed, 137 insertions, 51 deletions
diff --git a/.gitignore b/.gitignore
index d820c84..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
*.tar.gz
+*.tar.xz
+*.tar.xz.asc
*.src.rpm
+*/*rpm
diff --git a/3563.patch b/3563.patch
new file mode 100644
index 0000000..dcb0abb
--- /dev/null
+++ b/3563.patch
@@ -0,0 +1,23 @@
+From 61df934a7ea2ed0c9860bf62c0c68f5318d99926 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Wed, 22 Sep 2021 11:33:46 +0200
+Subject: [PATCH] Missing Environment and LoaderInterface
+
+---
+ tests/escapingTest.php | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/escapingTest.php b/tests/escapingTest.php
+index a35ce9ab1..6ebb7b7e3 100644
+--- a/tests/escapingTest.php
++++ b/tests/escapingTest.php
+@@ -2,6 +2,9 @@
+
+ namespace Twig\Tests;
+
++use Twig\Environment;
++use Twig\Loader\LoaderInterface;
++
+ /**
+ * This class is adapted from code coming from Zend Framework.
+ *
diff --git a/PHPINFO b/PHPINFO
deleted file mode 100644
index bf96a77..0000000
--- a/PHPINFO
+++ /dev/null
@@ -1,4 +0,0 @@
-
-twig
-
-Version => 1.42.2
diff --git a/REFLECTION b/REFLECTION
deleted file mode 100644
index faeac61..0000000
--- a/REFLECTION
+++ /dev/null
@@ -1,17 +0,0 @@
-Extension [ <persistent> extension #79 twig version 1.42.2 ] {
-
- - Functions {
- Function [ <internal:twig> function twig_template_get_attributes ] {
-
- - Parameters [6] {
- Parameter #0 [ <required> $template ]
- Parameter #1 [ <required> $object ]
- Parameter #2 [ <required> $item ]
- Parameter #3 [ <required> $arguments ]
- Parameter #4 [ <required> $type ]
- Parameter #5 [ <required> $isDefinedTest ]
- }
- }
- }
-}
-
diff --git a/composer.json b/composer.json
index 9807aa7..46b0fc7 100644
--- a/composer.json
+++ b/composer.json
@@ -5,6 +5,7 @@
"keywords": ["templating"],
"homepage": "https://twig.symfony.com",
"license": "BSD-3-Clause",
+ "minimum-stability": "dev",
"authors": [
{
"name": "Fabien Potencier",
@@ -14,7 +15,6 @@
},
{
"name": "Twig Team",
- "homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
},
{
@@ -24,12 +24,11 @@
}
],
"require": {
- "php": ">=5.5.0",
+ "php": ">=7.2.5",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
- "symfony/phpunit-bridge": "^4.4@dev|^5.0",
- "symfony/debug": "^3.4|^4.2",
+ "symfony/phpunit-bridge": "^4.4.9|^5.0.9",
"psr/container": "^1.0"
},
"autoload": {
@@ -47,7 +46,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.42-dev"
+ "dev-master": "1.44-dev"
}
}
}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..97be9f6
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global github_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global github_name/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^%global github_version/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global github_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+rm -rf $PROJECT-$COMMIT
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-twig.spec b/php-twig.spec
index 31ab782..4331931 100644
--- a/php-twig.spec
+++ b/php-twig.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-twig
#
-# Copyright (c) 2014-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2014-2022 Shawn Iwinski <shawn.iwinski@gmail.com>
# Remi Collet <remi@fedoraproject.org>
#
# License: MIT
@@ -11,20 +11,21 @@
# Please preserve changelog entries
#
+# Build using "--without tests" to disable tests
+%bcond_without tests
+
%global github_owner twigphp
%global github_name Twig
-%global github_version 1.42.3
-%global github_commit 201baee843e0ffe8b0b956f336dd42b2a92fae4e
+%global github_version 1.44.7
+%global github_commit 0887422319889e442458e48e2f3d9add1a172ad5
+%global github_short %(c=%{github_commit}; echo ${c:0:7})
# Lib
%global composer_vendor twig
%global composer_project twig
-# "php": ">=5.5.0"
-%global php_min_ver 5.5
-
-# Build using "--without tests" to disable tests
-%global with_tests 0%{!?_without_tests:1}
+# "php": ">=7.2.5"
+%global php_min_ver 7.2.5
%{!?phpdir: %global phpdir %{_datadir}/php}
%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
@@ -36,21 +37,26 @@ Summary: The flexible, fast, and secure template engine for PHP
License: BSD
URL: http://twig.sensiolabs.org
-Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+Source0: %{name}-%{github_version}-%{github_short}.tgz
+Source1: makesrc.sh
BuildArch: noarch
-BuildRequires: php-devel >= %{php_min_ver}
+# as we use phpunit9 (for assertFileDoesNotExist)
+BuildRequires: php-devel >= 7.3
# Tests
-%if %{with_tests}
-BuildRequires: phpunit7
+%if %{with tests}
+# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(symfony/debug) >= 3.4 with php-composer(symfony/debug) < 4)
BuildRequires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2)
+# remirepo:5
%else
BuildRequires: php-symfony3-debug >= 3.4
-BuildRequires: php-composer(psr/container) < 2
-BuildRequires: php-composer(psr/container) >= 1.0
+BuildRequires: php-psr-container < 2
+BuildRequires: php-psr-container >= 1.0
%endif
+%global phpunit %{_bindir}/phpunit9
+BuildRequires: %{phpunit}
## phpcompatinfo (computed from version 1.42.2)
BuildRequires: php-ctype
BuildRequires: php-date
@@ -95,7 +101,7 @@ Provides: php-twig-Twig = %{version}-%{release}
Provides: php-pear(pear.twig-project.org/Twig) = %{version}
# This pkg was the only one in this channel so the channel is no longer needed
-Obsoletes: php-channel-twig
+Obsoletes: php-channel-twig < 1.4
%description
@@ -143,7 +149,7 @@ cp -rp lib/* %{buildroot}%{phpdir}/
%{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Twig/autoload.php";
exit(version_compare("%{version}", Twig\Environment::VERSION, "=") ? 0 : 1);'
-%if %{with_tests}
+%if %{with tests}
: Generate autoloader
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
@@ -156,26 +162,26 @@ require_once '%{buildroot}%{phpdir}/Twig/autoload.php';
));
EOF
-: Disable listener from symfony/phpunit-bridge ^4.4@dev
+: Disable listener from symfony/phpunit-bridge # ^4.4.9|^5.0.9
sed -e '/listener/d' phpunit.xml.dist > phpunit.xml
: Test suite without extension
ret=0
-for cmd in php php71 php72 php73 php74; do
- if which $cmd; then
- $cmd %{_bindir}/phpunit7 \
- --filter '^((?!(testGetAttributeExceptions|testGetAttributeWithTemplateAsObject)).)*$' \
- --verbose || ret=1
- fi
+for SCL in "php %{phpunit}" php74 php80 php81 php82; do
+ if which $SCL; then
+ set $SCL
+ $1 ${2:-%{_bindir}/phpunit9} $SKIP \
+ --verbose || RETURN_CODE=1
+ fi
done
-
-exit $ret
+exit $RETURN_CODE
%else
: Tests skipped
%endif
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc CHANGELOG README.rst composer.json
@@ -184,6 +190,50 @@ exit $ret
%changelog
+* Thu Sep 29 2022 Remi Collet <remi@remirepo.net> - 1.44.7-1
+- update to 1.44.7
+
+* Thu Nov 25 2021 Remi Collet <remi@remirepo.net> - 1.44.6-1
+- update to 1.44.6 (no change)
+- drop patch merged upstream
+
+* Wed Sep 22 2021 Remi Collet <remi@remirepo.net> - 1.44.5-1
+- update to 1.44.5
+- add patch for test suite from https://github.com/twigphp/Twig/pull/3563
+
+* Mon May 17 2021 Remi Collet <remi@remirepo.net> - 1.44.4-1
+- update to 1.44.4
+
+* Wed May 12 2021 Remi Collet <remi@remirepo.net> - 1.44.3-1
+- update to 1.44.3
+
+* Wed Jan 6 2021 Remi Collet <remi@remirepo.net> - 1.44.2-1
+- update to 1.44.2
+
+* Wed Oct 28 2020 Remi Collet <remi@remirepo.net> - 1.44.1-1
+- update to 1.44.1
+
+* Wed Oct 21 2020 Remi Collet <remi@remirepo.net> - 1.44.0-1
+- update to 1.44.0
+- raise dependency on PHP 7.2.5
+
+* Tue Aug 11 2020 Remi Collet <remi@remirepo.net> - 1.43.1-1
+- update to 1.43.1
+- switch to phpunit9
+- skip 1 more test with PHP 8.0
+
+* Mon Jul 6 2020 Remi Collet <remi@remirepo.net> - 1.43.0-1
+- update to 1.43.0
+- raise dependency on PHP 7.1.3
+- switch to phpunit8
+
+* Wed Feb 12 2020 Remi Collet <remi@remirepo.net> - 1.42.5-1
+- update to 1.42.5
+
+* Tue Nov 12 2019 Remi Collet <remi@remirepo.net> - 1.42.4-1
+- update to 1.42.4
+- sources from git snapshot
+
* Tue Aug 27 2019 Remi Collet <remi@remirepo.net> - 1.42.3-1
- update to 1.42.3
- use symfony/debug v3