summaryrefslogtreecommitdiffstats
path: root/php-phpunit-php-file-iterator2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-09-14 07:11:46 +0200
committerRemi Collet <remi@remirepo.net>2018-09-14 07:11:46 +0200
commit70b4a5d98ea0d546e91be1b45809f41dbabdcdd8 (patch)
treea9c2ac5072012d4f6a750370f76b8b0971b6d8bf /php-phpunit-php-file-iterator2.spec
parent6ee3e80f867d2699ac61fbf36a9c721c0df819a9 (diff)
update to 2.0.2
run upstream test suite
Diffstat (limited to 'php-phpunit-php-file-iterator2.spec')
-rw-r--r--php-phpunit-php-file-iterator2.spec48
1 files changed, 38 insertions, 10 deletions
diff --git a/php-phpunit-php-file-iterator2.spec b/php-phpunit-php-file-iterator2.spec
index 4674296..fe82712 100644
--- a/php-phpunit-php-file-iterator2.spec
+++ b/php-phpunit-php-file-iterator2.spec
@@ -7,7 +7,8 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit cecbc684605bb0cc288828eb5d65d93d5c676d3c
+%global bootstrap 0
+%global gh_commit 050bedf145a257b1ff02746c31894800e5122946
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project php-file-iterator
@@ -19,10 +20,15 @@
# Namespace
%global ns_vendor SebastianBergmann
%global ns_project FileIterator
+%if %{bootstrap}
+%global with_tests 0%{?_with_tests:1}
+%else
+%global with_tests 0%{!?_without_tests:1}
+%endif
Name: php-%{pk_vendor}-%{pk_project}%{major}
-Version: 2.0.1
+Version: 2.0.2
Release: 1%{?dist}
Summary: FilterIterator implementation that filters files based on a list of suffixes
@@ -31,14 +37,20 @@ 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
BuildArch: noarch
+%if %{with_tests}
+# From composer.json, "require-dev"
+# "phpunit/phpunit": "^7.1"
+BuildRequires: phpunit7 >= 7.1
BuildRequires: php(language) >= 7.1
-BuildRequires: php-cli
+BuildRequires: php-pcre
+BuildRequires: php-spl
+%endif
BuildRequires: php-fedora-autoloader-devel
-# From composer.json
+# From composer.json, "require"
# "php": "^7.1"
Requires: php(language) >= 7.1
-# From phpcompatinfo report for 2.0.0
+# From phpcompatinfo report for 2.0.2
Requires: php-pcre
Requires: php-spl
# Autoloader
@@ -68,14 +80,26 @@ cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}
%check
-: Minimal test for our autoloader
-php -r '
-require "%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php";
-exit(class_exists("SebastianBergmann\FileIterator\\Iterator") ? 0 : 1);
-'
+%if %{with_tests}
+mkdir vendor
+touch vendor/autoload.php
+
+: Run upstream test suite
+ret=0
+for cmd in php php71 php72; do
+ if which $cmd; then
+ $cmd -d auto_prepend_file=%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php \
+ %{_bindir}/phpunit7 --verbose || ret=1
+ fi
+done
+exit $ret
+%else
+: bootstrap build with test suite disabled
+%endif
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc ChangeLog.md README.md composer.json
@@ -84,6 +108,10 @@ exit(class_exists("SebastianBergmann\FileIterator\\Iterator") ? 0 : 1);
%changelog
+* Fri Sep 14 2018 Remi Collet <remi@remirepo.net> - 2.0.2-1
+- update to 2.0.2
+- run upstream test suite
+
* Mon Jun 11 2018 Remi Collet <remi@remirepo.net> - 2.0.1-1
- update to 2.0.1