From 8b3fce2ce5e1b3adec223b63cc1a4f61334abdec Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 28 Apr 2026 10:23:00 +0200 Subject: update to 4.1.0 raise dependency on PHP 8.2 --- composer.json | 19 +++++++++++++++---- makesrc.sh | 31 +++++++++++++++---------------- php-sabre-xml4.spec | 39 ++++++++++++++++++++------------------- 3 files changed, 50 insertions(+), 39 deletions(-) diff --git a/composer.json b/composer.json index 94d631c..c6aa5da 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage" : "https://sabre.io/xml/", "license" : "BSD-3-Clause", "require" : { - "php" : "^7.4 || ^8.0", + "php" : "^8.2", "ext-xmlwriter" : "*", "ext-xmlreader" : "*", "ext-dom" : "*", @@ -44,10 +44,13 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.94", + "friendsofphp/php-cs-fixer": "^3.95", "phpstan/phpstan": "^2.1", - "phpunit/phpunit": "^9.6", - "rector/rector": "^2.3" + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpstan/extension-installer": "^1.4", + "phpunit/phpunit": "^10.5", + "rector/rector": "^2.4" }, "scripts": { "phpstan": [ @@ -73,5 +76,13 @@ "composer cs-fixer", "composer phpunit" ] + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + }, + "platform": { + "php": "8.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-sabre-xml4.spec b/php-sabre-xml4.spec index 755160b..3eaca5b 100644 --- a/php-sabre-xml4.spec +++ b/php-sabre-xml4.spec @@ -10,8 +10,6 @@ %bcond_without tests # Github -%global gh_commit 53db7bad0953949fb61037fbf9b13b421492395c -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sabre-io %global gh_project xml # Packagist @@ -24,52 +22,51 @@ Name: php-%{pk_vendor}-%{pk_project}%{major} Summary: XML library that you may not hate -Version: 4.0.7 +Version: 4.1.0 Release: 1%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} License: BSD-3-Clause # Git snapshot with tests, because of .gitattributes -Source0: %{name}-%{version}-%{gh_short}.tgz +Source0: %{name}-%{version}.tgz Source1: makesrc.sh BuildArch: noarch %if %{with tests} -BuildRequires: php(language) >= 7.4 +BuildRequires: php(language) >= 8.2 BuildRequires: php-xmlwriter BuildRequires: php-xmlreader BuildRequires: php-dom BuildRequires: (php-composer(sabre/uri) >= 2.0 with php-composer(sabre/uri) < 4) BuildRequires: php-libxml -BuildRequires: php-pcre -BuildRequires: php-spl # From composer.json, "require-dev": { -# "friendsofphp/php-cs-fixer": "^3.94", +# "friendsofphp/php-cs-fixer": "^3.95", # "phpstan/phpstan": "^2.1", -# "phpunit/phpunit": "^9.6", -# "rector/rector": "^2.3" -BuildRequires: phpunit9 >= 9.6 -%global phpunit %{_bindir}/phpunit9 +# "phpstan/phpstan-phpunit": "^2.0", +# "phpstan/phpstan-strict-rules": "^2.0", +# "phpstan/extension-installer": "^1.4", +# "phpunit/phpunit": "^10.5", +# "rector/rector": "^2.4" +BuildRequires: phpunit10 >= 10.5 +%global phpunit %{_bindir}/phpunit10 %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer.json, "require" : { -# "php" : "^7.4 || ^8.0", +# "php" : "^8.2", # "ext-xmlwriter" : "*", # "ext-xmlreader" : "*", # "ext-dom" : "*", # "lib-libxml" : ">=2.6.20", -# "sabre/uri" : ">=2.0,<3.0.0" -Requires: php(language) >= 7.4 +# "sabre/uri" : ">=2.0,<4.0.0" +Requires: php(language) >= 8.2 Requires: php-xmlwriter Requires: php-xmlreader Requires: php-dom Requires: (php-composer(sabre/uri) >= 2.0 with php-composer(sabre/uri) < 4) # From phpcompatinfo report for version 2.1.2 Requires: php-libxml -Requires: php-pcre -Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) @@ -83,7 +80,7 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %prep -%setup -q -n %{gh_project}-%{gh_commit} +%setup -q -n %{gh_project}-%{version} phpab -t fedora -o lib/autoload.php lib cat << 'EOF' | tee -a lib/autoload.php @@ -137,7 +134,7 @@ ret=0 for cmdarg in "php %{phpunit}" php82 php83 php84 php85; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit9} || ret=1 + $1 ${2:-%{_bindir}/phpunit10} || ret=1 fi done exit $ret @@ -154,6 +151,10 @@ exit $ret %changelog +* Tue Apr 28 2026 Remi Collet - 4.1.0-1 +- update to 4.1.0 +- raise dependency on PHP 8.2 + * Thu Apr 2 2026 Remi Collet - 4.0.7-1 - update to 4.0.7 -- cgit