diff options
-rw-r--r-- | composer.json | 15 | ||||
-rw-r--r-- | php-pragmarx-google2fa5.spec | 64 |
2 files changed, 41 insertions, 38 deletions
diff --git a/composer.json b/composer.json index 780fa55..a24231f 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "pragmarx/google2fa", "description": "A One Time Password Authentication package, compatible with Google Authenticator.", - "keywords": ["authentication", "two factor authentication", "google2fa", "laravel", "2fa"], + "keywords": [ + "authentication", + "two factor authentication", + "google2fa", + "2fa" + ], "license": "MIT", "authors": [ { @@ -17,8 +22,7 @@ "symfony/polyfill-php56": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4|~5|~6", - "bacon/bacon-qr-code": "~1.0" + "phpunit/phpunit": "~4|~5|~6" }, "autoload": { "psr-4": { @@ -29,12 +33,9 @@ "extra": { "component": "package", "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.0-dev" } }, - "suggest": { - "bacon/bacon-qr-code": "Required to generate inline QR Codes." - }, "minimum-stability": "dev", "prefer-stable": true } diff --git a/php-pragmarx-google2fa5.spec b/php-pragmarx-google2fa5.spec index 0b249d0..73046aa 100644 --- a/php-pragmarx-google2fa5.spec +++ b/php-pragmarx-google2fa5.spec @@ -1,6 +1,6 @@ -# remirepo/fedora spec file for php-pragmarx-google2fa +# remirepo/fedora spec file for php-pragmarx-google2fa5 # -# Copyright (c) 2018 Remi Collet +# Copyright (c) 2018-2019 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -9,7 +9,7 @@ %global with_tests 0%{!?_without_tests:1} # Github -%global gh_commit 6949226739e4424f40031e6f1c96b1fd64047335 +%global gh_commit 17c969c82f427dd916afe4be50bafc6299aef1b4 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner antonioribeiro %global gh_project google2fa @@ -19,9 +19,10 @@ # Namespace %global ns_vendor PragmaRX %global ns_project Google2FA +%global major 5 -Name: php-%{pk_vendor}-%{pk_project} -Version: 3.0.3 +Name: php-%{pk_vendor}-%{pk_project}%{major} +Version: 5.0.0 Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} Summary: Google Two-Factor Authentication for PHP Package @@ -32,9 +33,11 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit BuildArch: noarch %if %{with_tests} BuildRequires: php(language) >= 5.6 +# 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 %else BuildRequires: php-paragonie-constant-time-encoding BuildRequires: php-paragonie-random-compat @@ -43,13 +46,15 @@ BuildRequires: php-date BuildRequires: php-hash BuildRequires: php-pcre # For tests, from composer.json "require-dev": { -# "phpunit/phpunit": "~4|~5|~6", -# "bacon/bacon-qr-code": "~1.0" -BuildRequires: php-composer(phpunit/phpunit) +# "phpunit/phpunit": "~4|~5|~6" +# remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: (php-composer(bacon/bacon-qr-code) >= 1.0 with php-composer(bacon/bacon-qr-code) < 2) +BuildRequires: phpunit6 +%global phpunit %{_bindir}/phpunit6 +# remirepo:4 %else -BuildRequires: php-bacon-qr-code +BuildRequires: php-composer(phpunit/phpunit) +%global phpunit %{_bindir}/phpunit %endif # For autoloader BuildRequires: php-composer(fedora/autoloader) @@ -62,23 +67,20 @@ BuildRequires: php-composer(fedora/autoloader) # "symfony/polyfill-php56": "~1.2" # Use 5.6 and avoid polyfill Requires: php(language) >= 5.6 +# 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 %else Requires: php-paragonie-constant-time-encoding Requires: php-paragonie-random-compat %endif -# From phpcompatinfo report for 2.0.7 +# From phpcompatinfo report for 5.0.0 Requires: php-hash Requires: php-pcre -# From composer.json, "suggest": { -# "bacon/bacon-qr-code": "Required to generate inline QR Codes." -%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 -Recommends: php-composer(bacon/bacon-qr-code) -%endif # For generated autoloader Requires: php-composer(fedora/autoloader) @@ -92,7 +94,7 @@ Module, supporting the HMAC-Based One-time Password (HOTP) algorithm specified in RFC 4226 and the Time-based One-time Password (TOTP) algorithm specified in RFC 6238. -Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php +Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %prep @@ -109,9 +111,6 @@ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; '%{_datadir}/php/ParagonIE/ConstantTime/autoload.php', '%{_datadir}/php/random_compat/autoload.php', ]); -\Fedora\Autoloader\Dependencies::optional([ - '%{_datadir}/php/BaconQrCode/autoload.php', -]); AUTOLOAD @@ -122,7 +121,7 @@ AUTOLOAD %install : Library mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} -cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project} +cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} %check @@ -130,19 +129,15 @@ cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project} mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php -require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php'; +require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\Tests\\', dirname(__DIR__).'/tests'); EOF -# TODO investigate test_qrcode_inline failing with php < 7.2 (both images seems ok) ret=0 -for cmd in php php70 php71 php72 php73; do - if which $cmd; then - if [ $($cmd -r 'echo PHP_VERSION_ID;') -lt 70200 ]; then - $cmd %{_bindir}/phpunit --no-coverage --verbose --filter '^((?!(testQrcodeInline)).)*$' || ret=1 - else - $cmd %{_bindir}/phpunit --no-coverage --verbose || ret=1 - fi +for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit" php71 php72 php73 php74; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit6} --no-coverage --verbose || ret=1 fi done exit $ret @@ -152,15 +147,22 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE.md RELICENSED.md %doc composer.json %doc README.md changelog.md %dir %{_datadir}/php/%{ns_vendor} - %{_datadir}/php/%{ns_vendor}/%{ns_project} + %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} %changelog +* Tue Sep 10 2019 Remi Collet <remi@remirepo.net> - 5.0.0-1 +- update to 5.0.0 +- rename to php-pragmarx-google2fa5 +- move to /usr/share/php/PragmaRX/Google2FA5 +- drop dependency on bacon/bacon-qr-code + * Wed Aug 29 2018 Remi Collet <remi@remirepo.net> - 3.0.3-1 - update to 3.0.3 (no change) |