From 97c2c01f98f59e3e20b2130a50f4e6d737065b6a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 4 Nov 2020 13:53:11 +0100 Subject: update to 1.5.0 switch to phpunit9 --- composer.json | 7 ++++-- php-clue-stream-filter.spec | 52 ++++++++++++++++++++++++++++++++------------- 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 +# Copyright (c) 2017-2020 Shawn Iwinski # # 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 + - 1.5.0-1 +- update to 1.5.0 +- switch to phpunit9 + * Fri May 10 2019 Shawn Iwinski - 1.4.1-1 - Update to 1.4.1 (RHBZ #1698047) -- cgit