summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json7
-rw-r--r--php-clue-stream-filter.spec52
2 files changed, 42 insertions, 17 deletions
diff --git a/composer.json b/composer.json
index 834f2d4..797fb53 100644
--- a/composer.json
+++ b/composer.json
@@ -7,17 +7,20 @@
"authors": [
{
"name": "Christian Lück",
- "email": "christian@lueck.tv"
+ "email": "christian@clue.engineering"
}
],
"require": {
"php": ">=5.3"
},
"require-dev": {
- "phpunit/phpunit": "^5.0 || ^4.8"
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
},
"autoload": {
"psr-4": { "Clue\\StreamFilter\\": "src/" },
"files": [ "src/functions_include.php" ]
+ },
+ "autoload-dev": {
+ "psr-4": { "Clue\\Tests\\StreamFilter\\": "tests/" }
}
}
diff --git a/php-clue-stream-filter.spec b/php-clue-stream-filter.spec
index 1d8dcde..39d165a 100644
--- a/php-clue-stream-filter.spec
+++ b/php-clue-stream-filter.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-clue-stream-filter
#
-# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2017-2020 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner clue
%global github_name php-stream-filter
-%global github_version 1.4.1
-%global github_commit 5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71
+%global github_version 1.5.0
+%global github_commit aeb7d8ea49c7963d3b581378955dbf5bc49aa320
%global composer_vendor clue
%global composer_project stream-filter
@@ -22,7 +22,7 @@
%global php_min_ver 5.3
# Build using "--without tests" to disable tests
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -33,25 +33,35 @@ Summary: A simple and modern approach to stream filtering in PHP
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
-Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+
+# GitHub export does not include tests
+# Run php-clue-stream-filter-get-source.sh to create full source
+Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
+Source1: %{name}-get-source.sh
BuildArch: noarch
# Tests
-%if %{with_tests}
+%if %{with tests}
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-composer(phpunit/phpunit)
-## phpcompatinfo (computed from version 1.4.1)
+%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
+# "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
+%global phpunit %{_bindir}/phpunit9
+BuildRequires: phpunit9 >= 9.3
+%else
+%global phpunit %{_bindir}/phpunit
+BuildRequires: php-phpunit-PHPUnit >= 4.8.35
+%endif
+## phpcompatinfo (computed from version 1.5.0)
BuildRequires: php-reflection
BuildRequires: php-spl
-BuildRequires: php-zlib
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.4.1)
+# phpcompatinfo (computed from version 1.5.0)
Requires: php-reflection
Requires: php-spl
# Autoloader
@@ -94,13 +104,21 @@ cp -rp src %{buildroot}%{phpdir}/Clue/StreamFilter
%check
-%if %{with_tests}
+%if %{with tests}
+: Mock Composer autoloader
+mkdir vendor
+cat <<'AUTOLOAD' | tee vendor/autoload.php
+<?php
+require_once '%{buildroot}%{phpdir}/Clue/StreamFilter/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Clue\\Tests\\StreamFilter\\', dirname(__DIR__).'/tests');
+AUTOLOAD
+
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in php %{?rhel:php54 php55 php56 php70} php71 php72php73 php74; do
- if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC %{_bindir}/phpunit --verbose \
- --bootstrap %{buildroot}%{phpdir}/Clue/StreamFilter/autoload.php \
+for CMDARG in "php %{phpunit}" "php72 %{_bindir}/phpunit" php73 php74 php80; do
+ if which $CMDARG; then
+ set $CMDARG
+ $1 ${2:-%{_bindir}/phpunit9} --verbose \
|| RETURN_CODE=1
fi
done
@@ -120,6 +138,10 @@ exit $RETURN_CODE
%changelog
+* Tue Nov 3 2020 Remi Collet <remi@remirepo.net> - 1.5.0-1
+- update to 1.5.0
+- switch to phpunit9
+
* Fri May 10 2019 Shawn Iwinski <shawn@iwin.ski> - 1.4.1-1
- Update to 1.4.1 (RHBZ #1698047)