diff --git a/.gitignore b/.gitignore index ab552b3..a2a3b80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,29 @@ /phpunit10-10.2.7-a215d9e.tgz /phpunit10-10.3.0-c87ae28.tgz /phpunit10-10.3.1-d442ce7.tgz +/phpunit10-10.3.2-0dafb11.tgz +/phpunit10-10.3.3-241ed4d.tgz +/phpunit10-10.3.4-b8d5947.tgz +/phpunit10-10.3.5-747c3b2.tgz +/phpunit10-10.4.0-9784e87.tgz +/phpunit10-10.4.1-62bd7af.tgz +/phpunit10-10.4.2-cacd8b9.tgz +/phpunit10-10.5.0-80cab18.tgz +/phpunit10-10.5.1-d5d9dca.tgz +/phpunit10-10.5.2-5aedff4.tgz +/phpunit10-10.5.3-6fce887.tgz +/phpunit10-10.5.5-ed21115.tgz +/phpunit10-10.5.7-e5c5b39.tgz +/phpunit10-10.5.8-08f4fa7.tgz +/phpunit10-10.5.9-0bd6637.tgz +/phpunit10-10.5.10-50b8e31.tgz +/phpunit10-10.5.11-0d968f6.tgz +/phpunit10-10.5.12-41a9886.tgz +/phpunit10-10.5.13-20a63fc.tgz +/phpunit10-10.5.14-4cf8824.tgz +/phpunit10-10.5.15-86376e0.tgz +/phpunit10-10.5.16-18f8d4a.tgz +/phpunit10-10.5.17-c1f736a.tgz +/phpunit10-10.5.18-835df17.tgz +/phpunit10-10.5.19-c726f0d.tgz +/phpunit10-10.5.20-547d314.tgz diff --git a/makesrc.sh b/makesrc.sh index 3580b58..04ad6a0 100755 --- a/makesrc.sh +++ b/makesrc.sh @@ -1,24 +1,29 @@ #!/bin/bash NAME=$(basename $PWD) +DATE=$(sed -n '/^%global gh_date/{s/.* //;p}' $NAME.spec) OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) VERSION=$(sed -n '/^%global upstream_version/{s/.* //;p}' $NAME.spec) +MAJOR=$(sed -n '/^%global ver_major/{s/.* //;p}' $NAME.spec) +MINOR=$(sed -n '/^%global ver_minor/{s/.* //;p}' $NAME.spec) COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) SHORT=${COMMIT:0:7} +DATE=$(date -d "$DATE -1 week" +%Y-%m-%d) + if [ -f $NAME-$VERSION-$SHORT.tgz ]; then echo "$NAME-$VERSION-$SHORT.tgz already there" else - echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Date=$DATE\n" echo "Cloning..." rm -rf $PROJECT-$COMMIT - git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + git clone --branch $MAJOR.$MINOR --shallow-since=$DATE https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT || exit 1 echo "Getting commit..." pushd $PROJECT-$COMMIT - git checkout $COMMIT || exit1 + git checkout $COMMIT || exit 1 cp composer.json ../composer.json popd diff --git a/phpunit10-rpm.patch b/phpunit10-rpm.patch index 2e82286..fa07a47 100644 --- a/phpunit10-rpm.patch +++ b/phpunit10-rpm.patch @@ -1,7 +1,7 @@ diff -up ./phpunit.rpm ./phpunit ---- ./phpunit.rpm 2023-04-14 10:47:29.000000000 +0200 -+++ ./phpunit 2023-04-14 10:49:23.217236377 +0200 -@@ -71,29 +71,25 @@ if (isset($GLOBALS['_composer_autoload_p +--- ./phpunit.rpm 2024-03-21 10:34:01.000000000 +0100 ++++ ./phpunit 2024-03-21 14:02:24.892294049 +0100 +@@ -46,27 +46,13 @@ if (isset($GLOBALS['_composer_autoload_p define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']); unset($GLOBALS['_composer_autoload_path']); @@ -13,10 +13,10 @@ diff -up ./phpunit.rpm ./phpunit - break; - } - } -- + - unset($file); -} - +- -if (!defined('PHPUNIT_COMPOSER_INSTALL')) { - fwrite( - STDERR, @@ -34,9 +34,11 @@ diff -up ./phpunit.rpm ./phpunit } require PHPUNIT_COMPOSER_INSTALL; +@@ -101,4 +87,13 @@ if ([] !== $unavailableExtensions) { + + unset($requiredExtensions, $unavailableExtensions); -exit((new PHPUnit\TextUI\Application)->run($_SERVER['argv'])); -+ +if (class_exists('PHPUnit\\TextUI\\Application')) { + // PHPUnit v10 or newer + exit((new PHPUnit\TextUI\Application)->run($_SERVER['argv'])); @@ -47,10 +49,47 @@ diff -up ./phpunit.rpm ./phpunit + // PHPUnit v6 to v9 + PHPUnit\TextUI\Command::main(); +} +diff -up ./src/TextUI/Command/Commands/VersionCheckCommand.php.rpm ./src/TextUI/Command/Commands/VersionCheckCommand.php +--- ./src/TextUI/Command/Commands/VersionCheckCommand.php.rpm 2024-03-21 10:34:01.000000000 +0100 ++++ ./src/TextUI/Command/Commands/VersionCheckCommand.php 2024-03-21 14:02:53.539493026 +0100 +@@ -24,7 +24,7 @@ final class VersionCheckCommand implemen + public function execute(): Result + { + $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit'); +- $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . Version::majorVersionNumber()); ++ $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . $major=Version::majorVersionNumber()); + + $notLatest = version_compare($latestVersion, Version::id(), '>'); + $notLatestCompatible = version_compare($latestCompatibleVersion, Version::id(), '>'); +@@ -35,7 +35,7 @@ final class VersionCheckCommand implemen + ); + } + +- $buffer = 'You are not using the latest version of PHPUnit.' . PHP_EOL; ++ $buffer = 'You are not using the latest version of PHPUnit.' . PHP_EOL . PHP_EOL; + + if ($notLatestCompatible) { + $buffer .= sprintf( +@@ -43,6 +43,7 @@ final class VersionCheckCommand implemen + Version::id(), + $latestCompatibleVersion, + ); ++ $buffer .= sprintf('Try a system update for new phpunit%s package.' . PHP_EOL . PHP_EOL, $major); + } + + if ($notLatest) { +@@ -50,6 +51,7 @@ final class VersionCheckCommand implemen + 'The latest version is PHPUnit %s.' . PHP_EOL, + $latestVersion, + ); ++ $buffer .= sprintf('Try to install and use the phpunit%s command.' . PHP_EOL . PHP_EOL, explode('.', $latestVersion)[0]); + } + + return Result::from($buffer); diff -up ./src/TextUI/Configuration/Xml/SchemaFinder.php.rpm ./src/TextUI/Configuration/Xml/SchemaFinder.php ---- ./src/TextUI/Configuration/Xml/SchemaFinder.php.rpm 2023-04-14 10:51:13.796036447 +0200 -+++ ./src/TextUI/Configuration/Xml/SchemaFinder.php 2023-04-14 10:53:03.227838557 +0200 -@@ -48,6 +48,6 @@ final class SchemaFinder +--- ./src/TextUI/Configuration/Xml/SchemaFinder.php.rpm 2024-03-21 10:34:01.000000000 +0100 ++++ ./src/TextUI/Configuration/Xml/SchemaFinder.php 2024-03-21 14:02:24.893294091 +0100 +@@ -75,6 +75,6 @@ final class SchemaFinder return __PHPUNIT_PHAR_ROOT__ . '/'; } @@ -59,8 +98,8 @@ diff -up ./src/TextUI/Configuration/Xml/SchemaFinder.php.rpm ./src/TextUI/Config } } diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php ---- ./tests/bootstrap.php.rpm 2023-04-14 10:47:29.000000000 +0200 -+++ ./tests/bootstrap.php 2023-04-14 10:49:23.217236377 +0200 +--- ./tests/bootstrap.php.rpm 2024-03-21 10:34:01.000000000 +0100 ++++ ./tests/bootstrap.php 2024-03-21 14:02:24.893294091 +0100 @@ -11,8 +11,8 @@ if (!defined('TEST_FILES_PATH')) { define('TEST_FILES_PATH', __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR); } diff --git a/phpunit10.spec b/phpunit10.spec index 833ad5e..7b1de60 100644 --- a/phpunit10.spec +++ b/phpunit10.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for phpunit10 # -# Copyright (c) 2010-2023 Remi Collet +# Copyright (c) 2010-2024 Remi Collet # # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ @@ -11,8 +11,14 @@ %bcond_without tests -%global gh_commit d442ce7c4104d5683c12e67e4dcb5058159e9804 -#global gh_date 20150927 +%if 0%{?fedora} == 39 +%bcond_without defcmd +%else +%bcond_with defcmd +%endif + +%global gh_commit 547d314dc24ec1e177720d45c6263fb226cc2ae3 +%global gh_date 2024-04-24 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sebastianbergmann %global gh_project phpunit @@ -23,9 +29,9 @@ %global ns_vendor PHPUnit10 %global php_home %{_datadir}/php %global ver_major 10 -%global ver_minor 3 +%global ver_minor 5 -%global upstream_version 10.3.1 +%global upstream_version 10.5.20 #global upstream_prever dev Name: %{pk_project}%{ver_major} @@ -35,6 +41,7 @@ Summary: The PHP Unit Testing framework version %{ver_major} License: BSD-3-Clause URL: https://github.com/%{gh_owner}/%{gh_project} +# run makesrc.sh to create a git snapshot with test suite Source0: %{name}-%{upstream_version}-%{gh_short}.tgz Source1: makesrc.sh @@ -43,11 +50,10 @@ Patch0: %{name}-rpm.patch BuildArch: noarch BuildRequires: php(language) >= 8.1 -BuildRequires: (php-composer(doctrine/instantiator) >= 1.3.1 with php-composer(doctrine/instantiator) < 3) BuildRequires: (php-composer(myclabs/deep-copy) >= 1.10.1 with php-composer(myclabs/deep-copy) < 2) BuildRequires: (php-composer(phar-io/manifest) >= 2.0.3 with php-composer(phar-io/manifest) < 3) BuildRequires: (php-composer(phar-io/version) >= 3.0.2 with php-composer(phar-io/version) < 4) -BuildRequires: (php-composer(phpunit/php-code-coverage) >= 10.1.1 with php-composer(phpunit/php-code-coverage) < 11) +BuildRequires: (php-composer(phpunit/php-code-coverage) >= 10.1.5 with php-composer(phpunit/php-code-coverage) < 11) BuildRequires: (php-composer(phpunit/php-file-iterator) >= 4.0 with php-composer(phpunit/php-file-iterator) < 5) BuildRequires: (php-composer(phpunit/php-invoker) >= 4.0 with php-composer(phpunit/php-invoker) < 5) BuildRequires: (php-composer(phpunit/php-text-template) >= 3.0 with php-composer(phpunit/php-text-template) < 4) @@ -57,7 +63,7 @@ BuildRequires: (php-composer(sebastian/code-unit) >= 2.0 with php-c BuildRequires: (php-composer(sebastian/comparator) >= 5.0 with php-composer(sebastian/comparator) < 6) BuildRequires: (php-composer(sebastian/diff) >= 5.0 with php-composer(sebastian/diff) < 6) BuildRequires: (php-composer(sebastian/environment) >= 6.0 with php-composer(sebastian/environment) < 7) -BuildRequires: (php-composer(sebastian/exporter) >= 5.0 with php-composer(sebastian/exporter) < 6) +BuildRequires: (php-composer(sebastian/exporter) >= 5.1 with php-composer(sebastian/exporter) < 6) BuildRequires: (php-composer(sebastian/global-state) >= 6.0.1 with php-composer(sebastian/global-state) < 7) BuildRequires: (php-composer(sebastian/object-enumerator) >= 5.0 with php-composer(sebastian/object-enumerator) < 6) BuildRequires: (php-composer(sebastian/recursion-context) >= 5.0 with php-composer(sebastian/recursion-context) < 6) @@ -83,7 +89,7 @@ BuildRequires: php-fedora-autoloader-devel >= 1.0.0 # "myclabs/deep-copy": "^1.10.1", # "phar-io/manifest": "^2.0.3", # "phar-io/version": "^3.0.2", -# "phpunit/php-code-coverage": "^10.1.1", +# "phpunit/php-code-coverage": "^10.1.5", # "phpunit/php-file-iterator": "^4.0", # "phpunit/php-invoker": "^4.0", # "phpunit/php-text-template": "^3.0", @@ -93,7 +99,7 @@ BuildRequires: php-fedora-autoloader-devel >= 1.0.0 # "sebastian/comparator": "^5.0", # "sebastian/diff": "^5.0", # "sebastian/environment": "^6.0", -# "sebastian/exporter": "^5.0", +# "sebastian/exporter": "^5.1", # "sebastian/global-state": "^6.0.1", # "sebastian/object-enumerator": "^5.0", # "sebastian/recursion-context": "^5.0", @@ -110,7 +116,7 @@ Requires: php-xmlwriter Requires: (php-composer(myclabs/deep-copy) >= 1.10.1 with php-composer(myclabs/deep-copy) < 2) Requires: (php-composer(phar-io/manifest) >= 2.0.3 with php-composer(phar-io/manifest) < 3) Requires: (php-composer(phar-io/version) >= 3.0.2 with php-composer(phar-io/version) < 4) -Requires: (php-composer(phpunit/php-code-coverage) >= 10.1.1 with php-composer(phpunit/php-code-coverage) < 11) +Requires: (php-composer(phpunit/php-code-coverage) >= 10.1.5 with php-composer(phpunit/php-code-coverage) < 11) Requires: (php-composer(phpunit/php-file-iterator) >= 4.0 with php-composer(phpunit/php-file-iterator) < 5) Requires: (php-composer(phpunit/php-invoker) >= 4.0 with php-composer(phpunit/php-invoker) < 5) Requires: (php-composer(phpunit/php-text-template) >= 3.0 with php-composer(phpunit/php-text-template) < 4) @@ -120,7 +126,7 @@ Requires: (php-composer(sebastian/code-unit) >= 2.0 with php-c Requires: (php-composer(sebastian/comparator) >= 5.0 with php-composer(sebastian/comparator) < 6) Requires: (php-composer(sebastian/diff) >= 5.0 with php-composer(sebastian/diff) < 6) Requires: (php-composer(sebastian/environment) >= 6.0 with php-composer(sebastian/environment) < 7) -Requires: (php-composer(sebastian/exporter) >= 5.0 with php-composer(sebastian/exporter) < 6) +Requires: (php-composer(sebastian/exporter) >= 5.1 with php-composer(sebastian/exporter) < 6) Requires: (php-composer(sebastian/global-state) >= 6.0.1 with php-composer(sebastian/global-state) < 7) Requires: (php-composer(sebastian/object-enumerator) >= 5.0 with php-composer(sebastian/object-enumerator) < 6) Requires: (php-composer(sebastian/recursion-context) >= 5.0 with php-composer(sebastian/recursion-context) < 6) @@ -130,7 +136,10 @@ Requires: (php-composer(sebastian/version) >= 4.0 with php-c # "ext-soap": "*", Suggests: php-soap # recommends latest versions -# none yet +# Fedora 38+ only until 8.1 EOL +%if 0%{?fedora} >= 38 +Recommends: phpunit11 +%endif # Autoloader Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 10.0.0 @@ -141,6 +150,11 @@ Requires: php-pcre Requires: php-phar Requires: php-spl +%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10 +Provides: php-composer(phpunit/phpunit) = %{version} +Provides: phpunit = %{version}-%{release} +%endif + %description PHPUnit is a programmer-oriented testing framework for PHP. @@ -222,6 +236,10 @@ mkdir %{buildroot}%{php_home}/%{ns_vendor}/Extensions install -D -p -m 755 phpunit %{buildroot}%{_bindir}/%{name} install -p -m 644 phpunit.xsd %{buildroot}%{php_home}/%{ns_vendor}/phpunit.xsd +%if %{with defcmd} +ln -s %{name} %{buildroot}%{_bindir}/phpunit +%endif + %if %{with tests} %check @@ -245,10 +263,91 @@ exit $ret %doc README.md ChangeLog-%{ver_major}.%{ver_minor}.md %doc composer.json %{_bindir}/%{name} +%if %{with defcmd} +%{_bindir}/phpunit +%endif %{php_home}/%{ns_vendor} %changelog +* Wed Apr 24 2024 Remi Collet - 10.5.20-1 +- update to 10.5.20 + +* Thu Apr 18 2024 Remi Collet - 10.5.19-1 +- update to 10.5.19 + +* Mon Apr 15 2024 Remi Collet - 10.5.18-1 +- update to 10.5.18 + +* Thu Mar 28 2024 Remi Collet - 10.5.16-1 +- update to 10.5.16 + +* Fri Mar 22 2024 Remi Collet - 10.5.15-1 +- update to 10.5.15 + +* Thu Mar 21 2024 Remi Collet - 10.5.14-1 +- update to 10.5.14 + +* Wed Mar 13 2024 Remi Collet - 10.5.13-1 +- update to 10.5.13 + +* Sat Mar 9 2024 Remi Collet - 10.5.12-1 +- update to 10.5.12 + +* Mon Feb 26 2024 Remi Collet - 10.5.11-1 +- update to 10.5.11 + +* Mon Feb 5 2024 Remi Collet - 10.5.10-1 +- update to 10.5.10 + +* Tue Jan 23 2024 Remi Collet - 10.5.9-1 +- update to 10.5.9 + +* Fri Jan 19 2024 Remi Collet - 10.5.8-1 +- update to 10.5.8 + +* Mon Jan 15 2024 Remi Collet - 10.5.7-1 +- update to 10.5.7 + +* Thu Dec 28 2023 Remi Collet - 10.5.5-1 +- update to 10.5.5 + +* Wed Dec 13 2023 Remi Collet - 10.5.3-1 +- update to 10.5.3 + +* Wed Dec 6 2023 Remi Collet - 10.5.2-1 +- update to 10.5.2 + +* Sat Dec 2 2023 Remi Collet - 10.5.1-1 +- update to 10.5.1 + +* Fri Dec 1 2023 Remi Collet - 10.5.0-1 +- update to 10.5.0 +- provide phpunit command + +* Thu Oct 26 2023 Remi Collet - 10.4.2-1 +- update to 10.4.2 + +* Sun Oct 8 2023 Remi Collet - 10.4.1-1 +- update to 10.4.1 + +* Fri Oct 6 2023 Remi Collet - 10.4.0-1 +- update to 10.4.0 + +* Tue Sep 19 2023 Remi Collet - 10.3.5-1 +- update to 10.3.5 +- raise dependency on sebastian/exporter 5 + +* Wed Sep 13 2023 Remi Collet - 10.3.4-1 +- update to 10.3.4 +- raise dependency on phpunit/php-code-coverage 10.1.5 + +* Tue Sep 5 2023 Remi Collet - 10.3.3-1 +- update to 10.3.3 + +* Fri Aug 18 2023 Remi Collet - 10.3.2-1 +- update to 10.3.2 + * Fri Aug 4 2023 Remi Collet - 10.3.1-1 - update to 10.3.1 diff --git a/sources b/sources index 19b0e96..c82920f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (phpunit10-10.3.1-d442ce7.tgz) = f1a7f77baef4ad4b20192b2397af4d3fee4ed9be9dfb2710ce8975ad2e51c822e85e7ca5f7bd211bc97de65b56762547a0d62d25f228a886d72a6261b4440003 +SHA512 (phpunit10-10.5.20-547d314.tgz) = 49366edfde85452b203e63a8463613386a7015e9e3a57a524cd97ae536dd6003183057818e52aa4058dd874c7a9e66657db7e437ab6e692150921faa6a4ec978