update to 2.7.4

drop patch merged upstream
switch to phpunit8
This commit is contained in:
Remi Collet 2021-03-17 16:03:16 +01:00
commit 35239019ab
5 changed files with 102 additions and 35 deletions

View file

@ -1,7 +1,7 @@
#
# Fedora spec file for php-masterminds-html5
#
# Copyright (c) 2015-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
# Copyright (c) 2015-2021 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@ -11,8 +11,8 @@
%global github_owner Masterminds
%global github_name html5-php
%global github_version 2.7.0
%global github_commit 104443ad663d15981225f99532ba73c2f1d6b6f2
%global github_version 2.7.4
%global github_commit 9227822783c75406cfe400984b2f095cdf03d417
%global composer_vendor masterminds
%global composer_project html5
@ -27,14 +27,15 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
Release: 4%{?dist}
Release: 1%{?dist}
Summary: An HTML5 parser and serializer
License: MIT
URL: http://masterminds.github.io/html5-php
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
Patch0: https://patch-diff.githubusercontent.com/raw/Masterminds/html5-php/pull/170.patch
# GitHub export does not include tests.
# Run php-league-container-get-source.sh to create full source.
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
BuildArch: noarch
# Autoload generation
@ -43,7 +44,7 @@ BuildRequires: %{_bindir}/phpab
%if %{with_tests}
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit) >= 4.8.35
BuildRequires: phpunit8
BuildRequires: php-ctype
BuildRequires: php-dom
## phpcompatinfo (computed from version 2.7.0)
@ -84,7 +85,6 @@ refactoring work, we began a new parser.
%prep
%setup -qn %{github_name}-%{github_commit}
%patch0 -p1 -b .pr170
: Docs
mkdir -p docs/{Parser,Serializer}
@ -120,10 +120,23 @@ require '%{buildroot}%{phpdir}/Masterminds/HTML5/autoload.php';
require __DIR__ . '/../test/autoload.php';
AUTOLOAD
: fix for phpunit8
find test \
-name \*.php \
-exec sed \
-e 's/function setUp()/function setUp():void/' \
-i {} \;
sed -e 's/assertContains(/assertStringContainsString(/' \
-i test/HTML5/Html5Test.php
grep -v blacklist < phpunit.xml.dist | \
grep -v '<file' > phpunit.xml
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
for PHP_EXEC in "" %{?rhel:php54 php55 php56 php70} php71 php72 php73 php74; do
PHPUNIT=$(which phpunit8)
for PHP_EXEC in "" php72 php73 php74 php80; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC $PHPUNIT --verbose || RETURN_CODE=1
fi
@ -142,6 +155,11 @@ exit $RETURN_CODE
%changelog
* Wed Mar 17 2021 Remi Collet <remi@remirepo.net> - 2.7.4-1
- update to 2.7.4
- drop patch merged upstream
- switch to phpunit8
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild