summaryrefslogtreecommitdiffstats
path: root/php-egulias-email-validator2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-06-17 08:45:31 +0200
committerRemi Collet <remi@remirepo.net>2020-06-17 08:45:31 +0200
commit28ede9a2187ab4a8e3ffc7eadd3959f8c88a2369 (patch)
tree41e838cc3944c109f431304e421201f424b3d5cd /php-egulias-email-validator2.spec
parentc4a9460d04df5417a00cd7e34c16983c110728e0 (diff)
update to 2.1.18
open https://github.com/egulias/EmailValidator/pull/244 fix tests path switch to classmap autoloader
Diffstat (limited to 'php-egulias-email-validator2.spec')
-rw-r--r--php-egulias-email-validator2.spec59
1 files changed, 31 insertions, 28 deletions
diff --git a/php-egulias-email-validator2.spec b/php-egulias-email-validator2.spec
index 61dcb10..a679a10 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.17
-%global github_commit ade6887fd9bd74177769645ab5c474824f8a418a
+%global github_version 2.1.18
+%global github_commit cfa3d44471c7f5bfb684ac2b0da7114283d78441
%global github_short %(c=%{github_commit}; echo ${c:0:7})
%global major 2
@@ -25,7 +25,7 @@
%global doctrine_lexer_max_ver 2.0
# Build using "--without tests" to disable tests
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -41,22 +41,20 @@ Source1: makesrc.sh
BuildArch: noarch
# Tests
-%if %{with_tests}
+%if %{with tests}
## composer.json (require-dev)
-# "satooshi/php-coveralls": "^1.0.1",
+# "dominicsayers/isemail": "^3.0.7",
# "phpunit/phpunit": "^4.8.36|^7.5.15",
-# "dominicsayers/isemail": "^3.0.7"
+# "satooshi/php-coveralls": "^1.0.1"
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: phpunit7 >= 7.5.15
-%global phpunit %{_bindir}/phpunit6
BuildRequires: (php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} with php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver})
-# remirepo:5
+# remirepo:3
%else
-BuildRequires: php-phpunit-PHPUnit >= 4.8.36
-%global phpunit %{_bindir}/phpunit
BuildRequires: php-doctrine-lexer >= %{doctrine_lexer_min_ver}
%endif
+BuildRequires: phpunit7 >= 7.5.15
+%global phpunit %{_bindir}/phpunit6
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
## phpcompatinfo (computed from version 2.1.2)
@@ -66,7 +64,7 @@ BuildRequires: php-intl
BuildRequires: php-pcre
BuildRequires: php-spl
## Autoloader
-BuildRequires: php-composer(fedora/autoloader)
+BuildRequires: php-fedora-autoloader-devel
%endif
# composer.json
@@ -99,16 +97,12 @@ Autoloader: %{phpdir}/Egulias/EmailValidator%{major}/autoload.php
%build
-
: Create autoloader
-cat <<'AUTOLOAD' | tee EmailValidator/autoload.php
-<?php
-/**
- * Autoloader for %{name} and its' dependencies
- */
-require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
+phpab --template fedora \
+ --output src/autoload.php \
+ src
-\Fedora\Autoloader\Autoload::addPsr4('Egulias\\EmailValidator\\', __DIR__);
+cat <<'AUTOLOAD' | tee -a src/autoload.php
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Doctrine/Common/Lexer/autoload.php',
@@ -118,29 +112,32 @@ AUTOLOAD
%install
mkdir -p %{buildroot}%{phpdir}/Egulias
-cp -rp EmailValidator %{buildroot}%{phpdir}/Egulias/EmailValidator%{major}
+cp -rp src %{buildroot}%{phpdir}/Egulias/EmailValidator%{major}
%check
-%if %{with_tests}
+%if %{with tests}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require_once "%{buildroot}%{phpdir}/Egulias/EmailValidator%{major}/autoload.php";
-\Fedora\Autoloader\Autoload::addPsr4('Egulias\\Tests\\', dirname(__DIR__) . "/Tests");
+\Fedora\Autoloader\Autoload::addPsr4('Egulias\\Tests\\', dirname(__DIR__) . "/tests");
EOF
+# See https://github.com/egulias/EmailValidator/pull/244
+sed -e 's/Tests/tests/' phpunit.xml.dist >phpunit.xml
+
: Skip online tests
-rm Tests/EmailValidator/Validation/DNSCheckValidationTest.php
-rm Tests/EmailValidator/Validation/SpoofCheckValidationTest.php
+rm tests/EmailValidator/Validation/DNSCheckValidationTest.php
+rm tests/EmailValidator/Validation/SpoofCheckValidationTest.php
: Upstream tests
ret=0
-for cmdarg in "php %{phpunit}" php71 php72 php73 php74; do
+for cmdarg in "php %{phpunit}" php72 php73 php74 php80; do
if which $cmdarg; then
set $cmdarg
- $1 ${2:-%{_bindir}/phpunit6} \
- --verbose|| ret=1
+ $1 ${2:-%{_bindir}/phpunit7} \
+ --verbose || ret=1
fi
done
exit $ret
@@ -160,6 +157,12 @@ exit $ret
%changelog
+* Wed Jun 17 2020 Remi Collet <remi@remirepo.net> - 2.1.18-1
+- update to 2.1.18
+- open https://github.com/egulias/EmailValidator/pull/244
+ fix tests path
+- switch to classmap autoloader
+
* Fri Feb 14 2020 Remi Collet <remi@remirepo.net> - 2.1.17-1
- update to 2.1.17