summaryrefslogtreecommitdiffstats
path: root/php-phpunit-php-text-template2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-06-16 07:32:46 +0200
committerRemi Collet <remi@remirepo.net>2020-06-16 07:32:46 +0200
commit69185d627ae0a4469c2db3ed95bc2760d80085b0 (patch)
tree51910a592551c3e3eca8a3f6d797e8d1434572a1 /php-phpunit-php-text-template2.spec
parent46e44a4bec72768e2fcefa0665352f09aa8b9219 (diff)
update to 2.0.1
sources from git snapshot run upstream test suite
Diffstat (limited to 'php-phpunit-php-text-template2.spec')
-rw-r--r--php-phpunit-php-text-template2.spec44
1 files changed, 36 insertions, 8 deletions
diff --git a/php-phpunit-php-text-template2.spec b/php-phpunit-php-text-template2.spec
index 2fd98f6..fbc80d0 100644
--- a/php-phpunit-php-text-template2.spec
+++ b/php-phpunit-php-text-template2.spec
@@ -6,7 +6,8 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 526dc996cc0ebdfa428cd2dfccd79b7b53fee346
+%global bootstrap 0
+%global gh_commit 0c69cbf965d5317ba33f24a352539f354a25db09
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project php-text-template
@@ -19,19 +20,31 @@
%global php_home %{_datadir}/php
%global ver_major 2
+%if %{bootstrap}
+%global with_tests 0%{?_with_tests:1}
+%else
+%global with_tests 0%{!?_without_tests:1}
+%endif
+
Name: php-%{pk_vendor}-%{pk_project}%{ver_major}
-Version: 2.0.0
+Version: 2.0.1
Release: 1%{?dist}
Summary: Simple template engine
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
+Source0: %{name}-%{version}-%{gh_short}.tgz
+Source1: makesrc.sh
BuildArch: noarch
BuildRequires: php(language) >= 7.3
BuildRequires: php-cli
BuildRequires: php-fedora-autoloader-devel
+%if %{with_tests}
+# From composer.json, require-dev
+# "phpunit/phpunit": "^9.0"
+BuildRequires: phpunit9
+%endif
# From composer.json
# "php": "^7.3"
@@ -60,12 +73,22 @@ mkdir -p %{buildroot}%{php_home}/%{ns_vendor}
cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{ver_major}
+%if %{with_tests}
%check
-: check autoloader
-php -r '
-require "%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{ver_major}/autoload.php";
-exit (class_exists("%{ns_vendor}\\%{ns_project}\\Template") ? 0 : 1);
-'
+: Generate tests autoloader
+mkdir vendor
+%{_bindir}/phpab --output vendor/autoload.php tests
+
+: Run upstream test suite
+ret=0
+for cmd in php php73 php74 php80; do
+ if which $cmd; then
+ $cmd -d auto_prepend_file=%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{ver_major}/autoload.php \
+ %{_bindir}/phpunit9 --verbose || ret=1
+ fi
+done
+exit $ret
+%endif
%files
@@ -79,6 +102,11 @@ exit (class_exists("%{ns_vendor}\\%{ns_project}\\Template") ? 0 : 1);
%changelog
+* Tue Jun 16 2020 Remi Collet <remi@remirepo.net> - 2.0.1-1
+- update to 2.0.1
+- sources from git snapshot
+- run upstream test suite
+
* Fri Feb 7 2020 Remi Collet <remi@remirepo.net> - 2.0.0-1
- update to 2.0.0
- raise dependency on PHP 7.3