From 034e36d2ef1dfb468f5f3799802aa6821c33082a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 9 Jul 2026 15:11:09 +0200 Subject: update to 1.17.0 re-license spec file to CECILL-2.1 fix test suite using patch from https://github.com/thephpleague/mime-type-detection/pull/42 --- composer.json | 2 +- makesrc.sh | 31 +++++++++++++++---------------- php-league-mime-type-detection.spec | 35 ++++++++++++++++++++--------------- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/composer.json b/composer.json index cd75bee..1afe644 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "ext-fileinfo": "*" }, "require-dev": { - "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0 || ^11.0 || ^12.0", "phpstan/phpstan": "^0.12.68", "friendsofphp/php-cs-fixer": "^3.2" }, diff --git a/makesrc.sh b/makesrc.sh index 37cb6a2..f2a2aed 100755 --- a/makesrc.sh +++ b/makesrc.sh @@ -4,25 +4,24 @@ NAME=$(basename $PWD) OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) -COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) -SHORT=${COMMIT:0:7} -echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" +if [ -f $NAME-$VERSION.tgz ]; then + echo "$NAME-$VERSION.tgz already there" +else + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION \n" -echo "Cloning..." -rm -rf $PROJECT-$COMMIT -git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + echo "Cloning..." + rm -rf $PROJECT-$VERSION + git clone https://github.com/$OWNER/$PROJECT.git --depth 1 --branch $VERSION $PROJECT-$VERSION || exit 1 -echo "Getting commit..." -pushd $PROJECT-$COMMIT -git checkout $COMMIT -cp composer.json ../composer.json -popd + echo "Getting composer..." + cp $PROJECT-$VERSION/composer.json composer.json -echo "Archiving..." -tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $PROJECT-$COMMIT + echo "Archiving..." + tar czf $NAME-$VERSION.tgz --exclude-vcs $PROJECT-$VERSION -echo "Cleaning..." -rm -rf $PROJECT-$COMMIT + echo "Cleaning..." + rm -rf $PROJECT-$VERSION -echo "Done." + echo "Done." +fi diff --git a/php-league-mime-type-detection.spec b/php-league-mime-type-detection.spec index 33932e4..0d26fa9 100644 --- a/php-league-mime-type-detection.spec +++ b/php-league-mime-type-detection.spec @@ -1,14 +1,12 @@ # remirepo/fedora spec file for php-league-mime-type-detection # -# Copyright (c) 2020-2024 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2020-2026 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # # Github -%global gh_commit 2d6702ff215bf922936ccc1ad31007edc76451b9 -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner thephpleague %global gh_project mime-type-detection # Packagist @@ -19,27 +17,29 @@ %global ns_project MimeTypeDetection Name: php-%{pk_vendor}-%{pk_name} -Version: 1.16.0 +Version: 1.17.0 Release: 1%{?dist} Summary: Mime-type detection for Flysystem License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: %{name}-%{version}-%{gh_short}.tgz +Source0: %{name}-%{version}.tgz # Create git snapshot as tests are excluded from official tarball Source1: makesrc.sh +Patch0: %{name}-tests.patch + BuildArch: noarch BuildRequires: php(language) >= 7.4 BuildRequires: php-fileinfo BuildRequires: php-json # From composer.json, "require-dev": { -# "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0", +# "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0 || ^11.0 || ^12.0", # "phpstan/phpstan": "^0.12.68", # "friendsofphp/php-cs-fixer": "^3.2" -BuildRequires: phpunit10 -%global phpunit %{_bindir}/phpunit10 +BuildRequires: phpunit11 +%global phpunit %{_bindir}/phpunit11 # Autoloader BuildRequires: php-fedora-autoloader-devel @@ -64,7 +64,8 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php %prep -%setup -q -n %{gh_project}-%{gh_commit} +%setup -q -n %{gh_project}-%{version} +%patch -P0 -p1 %build @@ -96,10 +97,10 @@ sed -e 's/PHPStan\\Testing\\TestCase/PHPUnit\\Framework\\TestCase/' -i src/Overr : Run upstream test suite # the_generated_map_should_be_up_to_date is online ret=0 -for cmdarg in "php %{phpunit}" php81 php82 php83 php84; do +for cmdarg in "php %{phpunit}" php82 php83 php84 php85 php86; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit10} \ + $1 ${2:-%{_bindir}/phpunit11} \ --filter '^((?!(the_generated_map_should_be_up_to_date)).)*$' \ --no-coverage \ || ret=1 @@ -109,8 +110,6 @@ exit $ret %files -# remirepo:1 -%{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md %doc composer.json @@ -119,6 +118,12 @@ exit $ret %changelog +* Thu Jul 9 2026 Remi Collet - 1.17.0-1 +- update to 1.17.0 +- re-license spec file to CECILL-2.1 +- fix test suite using patch from + https://github.com/thephpleague/mime-type-detection/pull/42 + * Mon Sep 23 2024 Remi Collet - 1.16.0-1 - update to 1.16.0 -- cgit