diff options
-rw-r--r-- | composer.json | 13 | ||||
-rw-r--r-- | php-sabre-vobject4-autoload.php | 10 | ||||
-rw-r--r-- | php-sabre-vobject4-bin.patch | 20 | ||||
-rw-r--r-- | php-sabre-vobject4.spec | 63 |
4 files changed, 57 insertions, 49 deletions
diff --git a/composer.json b/composer.json index b745b1f..3816d54 100644 --- a/composer.json +++ b/composer.json @@ -32,15 +32,16 @@ "homepage" : "http://sabre.io/vobject/", "license" : "BSD-3-Clause", "require" : { - "php" : "^7.1 || ^8.0", + "php" : "^7.4 || ^8.0", "ext-mbstring" : "*", - "sabre/xml" : "^2.1" + "ext-json" : "*", + "sabre/xml" : "^3.0 || ^4.0" }, "require-dev" : { - "friendsofphp/php-cs-fixer": "~2.17.1", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", + "friendsofphp/php-cs-fixer": "^3.10.0", + "phpunit/phpunit" : "^9.0", "phpunit/php-invoker" : "^2.0 || ^3.1", - "phpstan/phpstan": "^0.12" + "phpstan/phpstan": "^1.8" }, "suggest" : { "hoa/bench" : "If you would like to run the benchmark scripts" @@ -90,7 +91,7 @@ }, "scripts": { "phpstan": [ - "phpstan analyse lib tests" + "phpstan analyse lib tests --memory-limit 1G" ], "cs-fixer": [ "php-cs-fixer fix" diff --git a/php-sabre-vobject4-autoload.php b/php-sabre-vobject4-autoload.php deleted file mode 100644 index 57829aa..0000000 --- a/php-sabre-vobject4-autoload.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/* Autoloader for sabre/vobject v4 and its dependencies */ - -require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; - -\Fedora\Autoloader\Autoload::addPsr4('Sabre\\VObject\\', __DIR__); -\Fedora\Autoloader\Dependencies::required([ - '/usr/share/php/Sabre/Xml2/autoload.php', -]); - diff --git a/php-sabre-vobject4-bin.patch b/php-sabre-vobject4-bin.patch index 1a6b2ac..fb6e219 100644 --- a/php-sabre-vobject4-bin.patch +++ b/php-sabre-vobject4-bin.patch @@ -1,9 +1,9 @@ diff -up ./bin/generate_vcards.rpm ./bin/generate_vcards ---- ./bin/generate_vcards.rpm 2020-01-31 19:50:58.000000000 +0100 -+++ ./bin/generate_vcards 2020-02-01 07:56:20.162307853 +0100 +--- ./bin/generate_vcards.rpm 2023-01-20 16:04:01.000000000 +0100 ++++ ./bin/generate_vcards 2023-01-20 16:38:01.726680132 +0100 @@ -6,8 +6,7 @@ namespace Sabre\VObject; - // This sucks.. we have to try to find the composer autoloader. But chances - // are, we can't find it this way. So we'll do our bestest + // This sucks. we have to try to find the composer autoloader. But chances + // are, we can't find it this way. So we'll do our best. $paths = [ - __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly - __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency. @@ -21,11 +21,11 @@ diff -up ./bin/generate_vcards.rpm ./bin/generate_vcards } diff -up ./bin/vobject.rpm ./bin/vobject ---- ./bin/vobject.rpm 2020-01-31 19:50:58.000000000 +0100 -+++ ./bin/vobject 2020-02-01 07:56:20.162307853 +0100 +--- ./bin/vobject.rpm 2023-01-20 16:04:01.000000000 +0100 ++++ ./bin/vobject 2023-01-20 16:38:22.388583223 +0100 @@ -6,8 +6,7 @@ namespace Sabre\VObject; - // This sucks.. we have to try to find the composer autoloader. But chances - // are, we can't find it this way. So we'll do our bestest + // This sucks. We have to try to find the composer autoloader. But chances + // are, we can't find it this way. So we'll do our best. $paths = [ - __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly - __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency. @@ -43,8 +43,8 @@ diff -up ./bin/vobject.rpm ./bin/vobject } diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php ---- ./tests/bootstrap.php.rpm 2020-01-31 19:50:58.000000000 +0100 -+++ ./tests/bootstrap.php 2020-02-01 07:57:56.802761882 +0100 +--- ./tests/bootstrap.php.rpm 2023-01-20 16:04:01.000000000 +0100 ++++ ./tests/bootstrap.php 2023-01-20 16:29:07.591185382 +0100 @@ -3,8 +3,7 @@ date_default_timezone_set('UTC'); diff --git a/php-sabre-vobject4.spec b/php-sabre-vobject4.spec index f391906..7aba02c 100644 --- a/php-sabre-vobject4.spec +++ b/php-sabre-vobject4.spec @@ -1,7 +1,7 @@ # remirepo/fedora spec file for php-sabre-vobject4 # -# Copyright (c) 2013-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2013-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -12,7 +12,7 @@ # For compatibility with SCL %undefine __brp_mangle_shebangs -%global gh_commit 1f836740c88bac483f3b572a332eb8fd1cd04981 +%global gh_commit 5f6665f08b8c4c6b47a5cf94bf14f6f6bea30530 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sabre-io %global gh_project vobject @@ -25,13 +25,12 @@ Name: php-sabre-vobject4 Summary: Library to parse and manipulate iCalendar and vCard objects -Version: 4.5.1 +Version: 4.5.2 Release: 1%{?dist} URL: http://sabre.io/vobject/ -License: BSD +License: BSD-3-Clause Source0: %{name}-%{version}-%{gh_short}.tgz -Source1: %{name}-autoload.php Source2: makesrc.sh # replace composer autloader @@ -39,51 +38,52 @@ Patch0: %{name}-bin.patch BuildArch: noarch %if %{with tests} -BuildRequires: php(language) >= 7.1 +BuildRequires: php(language) >= 7.4 +BuildRequires: php-json BuildRequires: php-mbstring # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: (php-composer(sabre/xml) >= 2.1 with php-composer(sabre/xml) < 3) +BuildRequires: (php-composer(sabre/xml) >= 3.0 with php-composer(sabre/xml) < 5) # remirepo:3 %else -BuildRequires: php-sabre-xml2 >= 2.1 +BuildRequires: php-sabre-xml4 %endif BuildRequires: php-date -BuildRequires: php-json BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-xml # From composer.json, "require-dev" -# "friendsofphp/php-cs-fixer": "~2.17.1", -# "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", +# "friendsofphp/php-cs-fixer": "^3.10.0", +# "phpunit/phpunit" : "^9.0", # "phpunit/php-invoker" : "^2.0 || ^3.1", -# "phpstan/phpstan": "^0.12" +# "phpstan/phpstan": "^1.8" BuildRequires: phpunit9 %global phpunit %{_bindir}/phpunit9 -# Autoloader -BuildRequires: php-composer(fedora/autoloader) %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer.json, "require" -# "php" : "^7.1 || ^8.0", +# "php" : "^7.4 || ^8.0", # "ext-mbstring" : "*", -# "sabre/xml" : "^2.1" -Requires: php(language) >= 7.1 +# "ext-json" : "*", +# "sabre/xml" : "^3.0 || ^4.0" +Requires: php(language) >= 7.4 +Requires: php-json Requires: php-mbstring # # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(sabre/xml) >= 2.1 with php-composer(sabre/xml) < 3) +Requires: (php-composer(sabre/xml) >= 3.0 with php-composer(sabre/xml) < 5) # remirepo:3 %else -Requires: php-sabre-xml2 >= 2.1 +Requires: php-sabre-xml4 %endif # From phpcompatinfo report for version 4.1.2 %if %{with_cmd} Requires: php-cli %endif Requires: php-date -Requires: php-json Requires: php-pcre Requires: php-spl Requires: php-xml @@ -109,7 +109,18 @@ Autoloader: %{_datadir}/php/Sabre/VObject4/autoload.php %patch0 -p1 -b .rpm -cp %{SOURCE1} lib/autoload.php +phpab -t fedora -o lib/autoload.php lib + +cat << 'EOF' | tee -a lib/autoload.php + +// Dependencies +\Fedora\Autoloader\Dependencies::required([ + [ + '%{_datadir}/php/Sabre/Xml4/autoload.php', + '%{_datadir}/php/Sabre/Xml3/autoload.php', + ], +]); +EOF %build @@ -151,7 +162,7 @@ fi : Run upstream test suite against installed library ret=0 -for cmdarg in "php %{phpunit}" php74 php80 php81 php82; do +for cmdarg in "php %{phpunit}" php80 php81 php82; do if which $cmdarg; then set $cmdarg $1 ${2:-%{_bindir}/phpunit9} $opt || ret=1 @@ -176,6 +187,12 @@ exit $ret %endif %changelog +* Fri Jan 20 2023 Remi Collet <remi@remirepo.net> - 4.5.2-1 +- update to 4.5.2 +- raise dependency on PHP 7.4 +- raise dependency on sabre/xml v3 or v4 +- switch to classmap autoloader + * Mon Oct 10 2022 Remi Collet <remi@remirepo.net> - 4.5.1-1 - update to 4.5.1 |