diff options
-rw-r--r-- | composer.json | 33 | ||||
-rw-r--r-- | php-sabre-uri2.spec | 74 |
2 files changed, 86 insertions, 21 deletions
diff --git a/composer.json b/composer.json index 30f3829..03c3387 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "homepage": "http://sabre.io/uri/", "license": "BSD-3-Clause", "require": { - "php": ">=7" + "php": "^7.4 || ^8.0" }, "authors": [ { @@ -33,13 +33,36 @@ }, "autoload-dev": { "psr-4": { - "Sabre\\Uri\\": "tests/" + "Sabre\\Uri\\": "tests/Uri" } }, "require-dev": { - "phpunit/phpunit" : "^6" + "friendsofphp/php-cs-fixer": "^3.17", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpstan/extension-installer": "^1.3", + "phpunit/phpunit" : "^9.6" }, - "config" : { - "bin-dir" : "bin/" + "scripts": { + "phpstan": [ + "phpstan analyse lib tests" + ], + "cs-fixer": [ + "php-cs-fixer fix" + ], + "phpunit": [ + "phpunit --configuration tests/phpunit.xml" + ], + "test": [ + "composer phpstan", + "composer cs-fixer", + "composer phpunit" + ] + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } } } diff --git a/php-sabre-uri2.spec b/php-sabre-uri2.spec index 9dc98b4..6a3c086 100644 --- a/php-sabre-uri2.spec +++ b/php-sabre-uri2.spec @@ -1,13 +1,16 @@ # remirepo/fedora spec file for php-sabre-uri2 # -# Copyright (c) 2016-2019 Remi Collet +# Copyright (c) 2016-2022 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # + +%bcond_without tests + # Github -%global gh_commit 18f454324f371cbcabdad3d0d3755b4b0182095d +%global gh_commit 7e0e7dfd0b7e14346a27eabd66e843a6e7f1812b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sabre-io %global gh_project uri @@ -18,33 +21,38 @@ %global ns_vendor Sabre %global ns_project Uri %global major 2 -%global with_tests 0%{!?_without_tests:1} Name: php-%{pk_vendor}-%{pk_project}%{major} Summary: Functions for making sense out of URIs -Version: 2.1.3 +Version: 2.3.3 Release: 1%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} -License: BSD +License: BSD-3-Clause # Git snapshot with tests, because of .gitattributes Source0: %{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh BuildArch: noarch -%if %{with_tests} -BuildRequires: php(language) >= 7 +%if %{with tests} +BuildRequires: php(language) >= 7.4 # From composer.json, "require-dev": { -# "phpunit/phpunit" : "^6" +# "friendsofphp/php-cs-fixer": "^3.17", +# "phpstan/phpstan": "^1.10", +# "phpstan/phpstan-phpunit": "^1.3", +# "phpstan/phpstan-strict-rules": "^1.5", +# "phpstan/extension-installer": "^1.3", +# "phpunit/phpunit" : "^9.6" BuildRequires: php-pcre -BuildRequires: phpunit6 +BuildRequires: phpunit9 >= 9.6 +%global phpunit %{_bindir}/phpunit9 %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer.json, "require" : { -# "php": ">=7" -Requires: php(language) > 7 +# "php": "^7.4 || ^8.0" +Requires: php(language) > 7.4 # From phpcompatinfo report for version 2.1.2 Requires: php-pcre # Autoloader @@ -95,16 +103,23 @@ cp -pr lib %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} %check -%if %{with_tests} +: Check version +php -r ' +require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php"; +echo Sabre\Uri\Version::VERSION . "\n"; +exit (Sabre\Uri\Version::VERSION === "%{version}" ? 0 : 1); +' + +%if %{with tests} : Run upstream test suite against installed library mkdir vendor ln -s %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php vendor/autoload.php cd tests -for cmd in php php71 php72 php73 php74 -do - if which $cmd; then - $cmd %{_bindir}/phpunit6 --verbose || ret=1 +for cmdarg in "php %{phpunit}" php80 php81 php82 php83; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit9} --verbose || ret=1 fi done exit $ret @@ -124,6 +139,33 @@ exit $ret %changelog +* Mon Jun 12 2023 Remi Collet <remi@remirepo.net> - 2.3.3-1 +- update to 2.3.3 + +* Mon Sep 19 2022 Remi Collet <remi@remirepo.net> - 2.3.2-1 +- update to 2.3.2 + +* Mon Sep 12 2022 Remi Collet <remi@remirepo.net> - 2.3.1-1 +- update to 2.3.1 + +* Thu Aug 18 2022 Remi Collet <remi@remirepo.net> - 2.3.0-1 +- update to 2.3.0 + +* Thu Aug 18 2022 Remi Collet <remi@remirepo.net> - 2.2.3-1 +- update to 2.2.3 + +* Thu Nov 4 2021 Remi Collet <remi@remirepo.net> - 2.2.2-1 +- update to 2.2.2 + +* Mon Oct 5 2020 Remi Collet <remi@remirepo.net> - 2.2.1-1 +- update to 2.2.1 +- switch to phpunit9 + +* Sat Feb 1 2020 Remi Collet <remi@remirepo.net> - 2.2.0-1 +- update to 2.2.0 +- raise dependency on PHP 7.1 +- switch to phpunit8 + * Tue Sep 10 2019 Remi Collet <remi@remirepo.net> - 2.1.3-1 - update to 2.1.3 |