summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--composer.json16
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-twig2.spec144
4 files changed, 159 insertions, 35 deletions
diff --git a/.gitignore b/.gitignore
index d820c84..fc9aa8c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,8 @@
+clog
+package-*.xml
+*.tgz
*.tar.gz
+*.tar.xz
+*.tar.xz.asc
*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
index b0c5836..4bc2421 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,13 +24,13 @@
}
],
"require": {
- "php": "^7.0",
+ "php": ">=7.1.3",
"symfony/polyfill-mbstring": "^1.3",
- "symfony/polyfill-ctype": "^1.8"
+ "symfony/polyfill-ctype": "^1.8",
+ "symfony/polyfill-php72": "^1.8"
},
"require-dev": {
- "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0",
- "symfony/debug": "^2.7",
+ "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0",
"psr/container": "^1.0"
},
"autoload": {
@@ -42,13 +42,13 @@
}
},
"autoload-dev": {
- "psr-0" : {
- "Twig_Tests_" : "test/"
+ "psr-4" : {
+ "Twig\\Tests\\" : "tests/"
}
},
"extra": {
"branch-alias": {
- "dev-master": "2.11-dev"
+ "dev-master": "2.15-dev"
}
}
}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..8036200
--- /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 '/^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-twig2.spec b/php-twig2.spec
index 89883fb..fdfed23 100644
--- a/php-twig2.spec
+++ b/php-twig2.spec
@@ -1,8 +1,8 @@
# fedora/remirepo spec file for php-twig2, from
#
-# Fedora spec file for php-twig
+# Fedora spec file for php-twig2
#
-# Copyright (c) 2014-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2014-2023 Shawn Iwinski <shawn.iwinski@gmail.com>
# Remi Collet <remi@fedoraproject.org>
#
# License: MIT
@@ -10,50 +10,51 @@
#
# Please preserve changelog entries
#
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
+
%global github_owner twigphp
%global github_name Twig
-%global github_commit 699ed2342557c88789a15402de5eb834dedd6792
+%global github_commit fc02a6af3eeb97c4bf5650debc76c2eda85ac22e
%global github_short %(c=%{github_commit}; echo ${c:0:7})
%global composer_vendor twig
%global composer_project twig
-# "php": "^7.0"
-%global php_min_ver 7.0
+# "php": ">=7.1.3"
+%global php_min_ver 7.1.3
%global phpdir %{_datadir}/php
Name: php-%{composer_project}2
-Version: 2.11.3
+Version: 2.15.5
Release: 1%{?dist}
Summary: The flexible, fast, and secure template engine for PHP
-License: BSD
+License: BSD-3-Clause
URL: https://twig.symfony.com
-Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{version}-%{github_short}.tar.gz
+Source0: %{name}-%{version}-%{github_short}.tgz
+Source1: makesrc.sh
BUildArch: noarch
## Autoloader
BuildRequires: php-fedora-autoloader-devel
-%if %{with_tests}
+%if %{with tests}
# For tests
-BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: phpunit6
+# as we use phpunit9 (for assertFileDoesNotExist)
+BuildRequires: php(language) >= 7.3
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(symfony/debug) >= 2.7 with php-composer(symfony/debug) < 3)
BuildRequires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2)
BuildRequires: (php-composer(symfony/polyfill-mbstring) >= 1.3 with php-composer(symfony/polyfill-mbstring) < 2)
-# remirepo:7
+BuildRequires: (php-composer(symfony/polyfill-php72) >= 1.8 with php-composer(symfony/polyfill-php72) < 2)
+# remirepo:6
%else
-BuildRequires: php-symfony-debug >= 2.7
-BuildRequires: php-composer(psr/container) < 2
-BuildRequires: php-composer(psr/container) >= 1.0
+BuildRequires: php-psr-container < 2
+BuildRequires: php-psr-container >= 1.0
BuildRequires: php-symfony-polyfill < 2
-BuildRequires: php-symfony-polyfill >= 1.3
+BuildRequires: php-symfony-polyfill >= 1.8
%endif
-# Workaround
-BuildRequires: php-symfony-common
+%global phpunit %{_bindir}/phpunit9
+BuildRequires: %{phpunit}
## phpcompatinfo (computed from version 2.11.3)
BuildRequires: php-ctype
BuildRequires: php-date
@@ -72,10 +73,11 @@ Requires: php(language) >= %{php_min_ver}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(symfony/polyfill-mbstring) >= 1.3 with php-composer(symfony/polyfill-mbstring) < 2)
+Requires: (php-composer(symfony/polyfill-php72) >= 1.8 with php-composer(symfony/polyfill-php72) < 2)
# remirepo:4
%else
Requires: php-symfony-polyfill < 2
-Requires: php-symfony-polyfill >= 1.3
+Requires: php-symfony-polyfill >= 1.8
%endif
## phpcompatinfo (computed from version 2.11.3)
Requires: php-ctype
@@ -139,17 +141,18 @@ 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);'
-%if %{with_tests}
+%if %{with tests}
mkdir vendor
-phpab --output vendor/autoload.php test
+phpab --output vendor/autoload.php tests
cat << 'EOF' | tee -a vendor/autoload.php
// This library
require_once '%{buildroot}%{phpdir}/Twig2/autoload.php';
// Dependencies (require-dev)
-require_once '%{phpdir}/Symfony/Component/Debug/autoload.php';
-require_once '%{phpdir}/Psr/Container/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/Psr/Container/autoload.php',
+]);
EOF
: Disable listener from symfony/phpunit-bridge ~3.2
@@ -157,9 +160,11 @@ sed -e '/listener/d' phpunit.xml.dist > phpunit.xml
RETURN_CODE=0
: Upstream tests with SCLs if available
-for SCL in php php71 php72 php73 php74; do
+for SCL in "php %{phpunit}" php74 php80 php81 php82; do
if which $SCL; then
- $SCL %{_bindir}/phpunit6 --verbose || RETURN_CODE=1
+ set $SCL
+ $1 ${2:-%{_bindir}/phpunit9} $SKIP \
+ --verbose || RETURN_CODE=1
fi
done
exit $RETURN_CODE
@@ -177,6 +182,91 @@ exit $RETURN_CODE
%changelog
+* Thu May 4 2023 Remi Collet <remi@remirepo.net> - 2.15.5-1
+- update to 2.15.5
+
+* Tue Jan 3 2023 Remi Collet <remi@remirepo.net> - 2.15.4-1
+- update to 2.15.4
+
+* Thu Sep 29 2022 Remi Collet <remi@remirepo.net> - 2.15.3-1
+- update to 2.15.3
+
+* Tue Aug 16 2022 Remi Collet <remi@remirepo.net> - 2.15.2-1
+- update to 2.15.2
+
+* Tue May 17 2022 Remi Collet <remi@remirepo.net> - 2.15.1-1
+- update to 2.15.1
+
+* Mon May 16 2022 Remi Collet <remi@remirepo.net> - 2.15.0-1
+- update to 2.15.0
+
+* Wed Apr 6 2022 Remi Collet <remi@remirepo.net> - 2.14.13-1
+- update to 2.14.13
+
+* Mon Mar 28 2022 Remi Collet <remi@remirepo.net> - 2.14.12-1
+- update to 2.14.12
+
+* Fri Feb 4 2022 Remi Collet <remi@remirepo.net> - 2.14.11-1
+- update to 2.14.11
+
+* Tue Jan 4 2022 Remi Collet <remi@remirepo.net> - 2.14.10-1
+- update to 2.14.10
+
+* Mon Jan 3 2022 Remi Collet <remi@remirepo.net> - 2.14.9-1
+- update to 2.14.9
+
+* Thu Nov 25 2021 Remi Collet <remi@remirepo.net> - 2.14.8-1
+- update to 2.14.8 (no change)
+
+* Wed Sep 22 2021 Remi Collet <remi@remirepo.net> - 2.14.7-1
+- update to 2.14.7
+
+* Mon May 17 2021 Remi Collet <remi@remirepo.net> - 2.14.6-1
+- update to 2.14.6
+
+* Wed May 12 2021 Remi Collet <remi@remirepo.net> - 2.14.5-1
+- update to 2.14.5
+
+* Wed Mar 10 2021 Remi Collet <remi@remirepo.net> - 2.14.4-1
+- update to 2.14.4
+
+* Wed Jan 6 2021 Remi Collet <remi@remirepo.net> - 2.14.3-1
+- update to 2.14.3
+
+* Wed Oct 28 2020 Remi Collet <remi@remirepo.net> - 2.14.1-1
+- update to 2.14.1
+
+* Wed Oct 21 2020 Remi Collet <remi@remirepo.net> - 2.14.0-1
+- update to 2.14.0
+- raise dependency on PHP 7.2.5
+
+* Tue Aug 11 2020 Remi Collet <remi@remirepo.net> - 2.13.1-1
+- update to 2.13.1
+- switch to phpunit9
+- skip 1 test with PHP 8.0
+
+* Mon Jul 6 2020 Remi Collet <remi@remirepo.net> - 2.13.0-1
+- update to 2.13.0
+- raise dependency on PHP 7.1.3
+- switch to phpunit8
+
+* Wed Feb 12 2020 Remi Collet <remi@remirepo.net> - 2.12.5-1
+- update to 2.12.5
+
+* Fri Jan 3 2020 Remi Collet <remi@remirepo.net> - 2.12.3-1
+- update to 2.12.3
+
+* Tue Nov 12 2019 Remi Collet <remi@remirepo.net> - 2.12.2-1
+- update to 2.12.2
+
+* Thu Oct 17 2019 Remi Collet <remi@remirepo.net> - 2.12.1-1
+- update to 2.12.1 (no change)
+- sources from git snapshot
+
+* Mon Oct 7 2019 Remi Collet <remi@remirepo.net> - 2.12.0-1
+- update to 2.12.0
+- use phpunit7 and Symfony 4 for test suite
+
* Tue Jun 18 2019 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.11.3-1
- Update to 2.11.3