From 74fbb7e835392742b1b6722b7431dba1b1b7e464 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Apr 2018 07:38:31 +0200 Subject: update to 2.1.4 use range dependencies on F27+ use phpunit6 when available --- php-egulias-email-validator2.spec | 53 ++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'php-egulias-email-validator2.spec') diff --git a/php-egulias-email-validator2.spec b/php-egulias-email-validator2.spec index bf93e6c..8c8d446 100644 --- a/php-egulias-email-validator2.spec +++ b/php-egulias-email-validator2.spec @@ -10,8 +10,8 @@ %global github_owner egulias %global github_name EmailValidator -%global github_version 2.1.3 -%global github_commit 1bec00a10039b823cc94eef4eddd47dcd3b2ca04 +%global github_version 2.1.4 +%global github_commit 8790f594151ca6a2010c6218e09d96df67173ad3 %global github_short %(c=%{github_commit}; echo ${c:0:7}) %global major 2 @@ -34,7 +34,6 @@ Version: %{github_version} Release: 1%{?github_release}%{?dist} Summary: A library for validating emails -Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} Source0: %{name}-%{github_version}-%{github_short}.tgz @@ -43,11 +42,21 @@ Source1: makesrc.sh BuildArch: noarch # Tests %if %{with_tests} -BuildRequires: php-composer(phpunit/phpunit) +## composer.json (require-dev) +# "phpunit/phpunit": "^4.8.35||^5.7||^6.0", +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: phpunit6 +%global phpunit %{_bindir}/phpunit6 +BuildRequires: (php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} with php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}) +# remirepo:5 +%else +BuildRequires: php-phpunit-PHPUnit >= 5.7 +%global phpunit %{_bindir}/phpunit +BuildRequires: php-doctrine-lexer >= %{doctrine_lexer_min_ver} +%endif ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver} -BuildRequires: php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} ## phpcompatinfo (computed from version 2.1.2) BuildRequires: php-dom BuildRequires: php-filter @@ -60,8 +69,13 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} -Requires: php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} -Requires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver} +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} with php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}) +# remirepo:3 +%else +Requires: php-doctrine-lexer >= %{doctrine_lexer_min_ver} +%endif # phpcompatinfo (computed from version 2.1.2) Requires: php-intl Requires: php-pcre @@ -113,16 +127,16 @@ rm Tests/EmailValidator/Validation/DNSCheckValidationTest.php rm Tests/EmailValidator/Validation/SpoofCheckValidationTest.php : Upstream tests -RETURN_CODE=0 -PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do - if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then - $PHP_EXEC $PHPUNIT --verbose \ - --bootstrap %{buildroot}%{phpdir}/Egulias/EmailValidator%{major}/autoload.php \ - || RETURN_CODE=1 - fi +ret=0 +for cmdarg in "php %{phpunit}" php70 php71 php72; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit6} \ + --bootstrap %{buildroot}%{phpdir}/Egulias/EmailValidator%{major}/autoload.php \ + --verbose|| ret=1 + fi done -exit $RETURN_CODE +exit $ret %else : Tests skipped %endif @@ -138,6 +152,11 @@ exit $RETURN_CODE %changelog +* Thu Apr 12 2018 Remi Collet - 2.1.4-1 +- update to 2.1.4 +- use range dependencies on F27+ +- use phpunit6 when available + * Thu Nov 16 2017 Remi Collet - 2.1.3-1 - Update to 2.1.3 -- cgit