diff options
-rw-r--r-- | composer.json | 26 | ||||
-rw-r--r-- | php-pragmarx-google2fa8.spec | 69 |
2 files changed, 47 insertions, 48 deletions
diff --git a/composer.json b/composer.json index a24231f..2a1f9e6 100644 --- a/composer.json +++ b/composer.json @@ -16,25 +16,27 @@ } ], "require": { - "php": ">=5.4", - "paragonie/constant_time_encoding": "~1.0|~2.0", - "paragonie/random_compat": ">=1", - "symfony/polyfill-php56": "~1.2" + "php": "^7.1|^8.0", + "paragonie/constant_time_encoding": "^1.0|^2.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5|~6" + "phpunit/phpunit": "^7.5.15|^8.5|^9.0", + "phpstan/phpstan": "^0.12.18" }, "autoload": { "psr-4": { - "PragmaRX\\Google2FA\\": "src/", - "PragmaRX\\Google2FA\\Tests\\": "tests/" + "PragmaRX\\Google2FA\\": "src/" } }, - "extra": { - "component": "package", - "branch-alias": { - "dev-master": "2.0-dev" - } + "autoload-dev": { + "psr-4": { + "PragmaRX\\Google2FA\\Tests\\": "tests/" + }, + "files": ["tests/helpers.php"] + }, + "scripts": { + "test": "bash ./tests/tools/test.sh", + "analyse": "bash ./tests/tools/analyse.sh" }, "minimum-stability": "dev", "prefer-stable": true diff --git a/php-pragmarx-google2fa8.spec b/php-pragmarx-google2fa8.spec index 7d9c99a..c9d0ade 100644 --- a/php-pragmarx-google2fa8.spec +++ b/php-pragmarx-google2fa8.spec @@ -1,4 +1,4 @@ -# remirepo/fedora spec file for php-pragmarx-google2fa5 +# remirepo/fedora spec file for php-pragmarx-google2fa8 # # Copyright (c) 2018-2021 Remi Collet # License: CC-BY-SA @@ -7,9 +7,10 @@ # Please, preserve the changelog entries # -%global with_tests 0%{!?_without_tests:1} +%bcond_without tests + # Github -%global gh_commit 17c969c82f427dd916afe4be50bafc6299aef1b4 +%global gh_commit 26c4c5cf30a2844ba121760fd7301f8ad240100b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner antonioribeiro %global gh_project google2fa @@ -19,64 +20,52 @@ # Namespace %global ns_vendor PragmaRX %global ns_project Google2FA -%global major 5 +%global major 8 Name: php-%{pk_vendor}-%{pk_project}%{major} -Version: 5.0.0 -Release: 5%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} -Summary: Google Two-Factor Authentication for PHP Package +Version: 8.0.0 +Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} +Summary: Google Two-Factor Authentication for PHP, version %{major} License: MIT 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 +# git snapshot to retrieve test suite +Source0: %{name}-%{version}-%{?gh_short}.tgz +Source1: makesrc.sh BuildArch: noarch -%if %{with_tests} -BuildRequires: php(language) >= 5.6 +%if %{with tests} +BuildRequires: php(language) >= 7.1 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(paragonie/constant_time_encoding) >= 1.0 with php-composer(paragonie/constant_time_encoding) < 3) -BuildRequires: (php-composer(paragonie/random_compat) >= 2.0 with php-composer(paragonie/random_compat) < 3) -# remirepo:4 +# remirepo:3 %else BuildRequires: php-paragonie-constant-time-encoding -BuildRequires: php-paragonie-random-compat %endif BuildRequires: php-date BuildRequires: php-hash BuildRequires: php-pcre # For tests, from composer.json "require-dev": { -# "phpunit/phpunit": "~4|~5|~6" -# remirepo:1 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: phpunit7 -%global phpunit %{_bindir}/phpunit7 -# remirepo:4 -%else -BuildRequires: php-composer(phpunit/phpunit) -%global phpunit %{_bindir}/phpunit -%endif +# "phpunit/phpunit": "^7.5.15|^8.5|^9.0", +# "phpstan/phpstan": "^0.12.18" +BuildRequires: phpunit9 +%global phpunit %{_bindir}/phpunit9 # For autoloader BuildRequires: php-composer(fedora/autoloader) %endif # From composer.json, "require": { -# "php": ">=5.4", +# "php": "^7.1|^8.0", # "paragonie/constant_time_encoding": "~1.0|~2.0", -# "paragonie/random_compat": ">=1", -# "symfony/polyfill-php56": "~1.2" -# Use 5.6 and avoid polyfill -Requires: php(language) >= 5.6 +Requires: php(language) >= 7.1 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 # Only use constant_time_encoding v1 available in Fedora for autoloader path Requires: (php-composer(paragonie/constant_time_encoding) >= 1.0 with php-composer(paragonie/constant_time_encoding) < 3) -# Only use random_compat v2 available in Fedora for autoloader path -Requires: (php-composer(paragonie/random_compat) >= 2.0 with php-composer(paragonie/random_compat) < 3) -# remirepo:4 +# remirepo:3 %else Requires: php-paragonie-constant-time-encoding -Requires: php-paragonie-random-compat %endif # From phpcompatinfo report for 5.0.0 Requires: php-hash @@ -109,7 +98,6 @@ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\', __DIR__); \Fedora\Autoloader\Dependencies::required([ '%{_datadir}/php/ParagonIE/ConstantTime/autoload.php', - '%{_datadir}/php/random_compat/autoload.php', ]); AUTOLOAD @@ -125,19 +113,22 @@ cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} %check -%if %{with_tests} +%if %{with tests} mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\Tests\\', dirname(__DIR__).'/tests'); +\Fedora\Autoloader\Dependencies::required([ + dirname(__DIR__) . '/tests/helpers.php', +]); EOF ret=0 for cmdarg in "php %{phpunit}" php73 php74 php80; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit7} --no-coverage --verbose || ret=1 + $1 ${2:-%{_bindir}/phpunit9} --no-coverage --verbose || ret=1 fi done exit $ret @@ -151,12 +142,18 @@ exit $ret %{!?_licensedir:%global license %%doc} %license LICENSE.md RELICENSED.md %doc composer.json -%doc README.md changelog.md +%doc README.md CHANGELOG.md %dir %{_datadir}/php/%{ns_vendor} %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} %changelog +* Thu Apr 1 2021 Remi Collet <remi@remirepo.net> - 8.0.0-1 +- update to 8.0.0 +- rename to php-pragmarx-google2fa8 +- raise dependency on PHP 7.1 +- drop dependency on paragonie/random_compat + * Wed Mar 24 2021 Remi Collet <remi@remirepo.net> - 5.0.0-5 - switch to phpunit7 |