diff --git a/.gitignore b/.gitignore index 61203de..d9ec8a9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ /php-sabre-dav4-4.0.3-b793fb4.tar.gz /php-sabre-dav4-4.1.0-8f6f4d2.tar.gz /php-sabre-dav4-4.1.1-5736f94.tar.gz +/php-sabre-dav4-4.1.2-e1f617a.tar.gz +/php-sabre-dav4-4.1.3-b903eee.tar.gz +/php-sabre-dav4-4.1.4-4258420.tgz +/php-sabre-dav4-4.1.5-c1afdc7.tgz diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..f9982c6 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +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} + +if [ -f $NAME-$VERSION-$SHORT.tgz ]; then + echo "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 "Getting commit..." + pushd $PROJECT-$COMMIT + git checkout $COMMIT || exit 1 + cp composer.json ../composer.json + popd + + echo "Archiving..." + tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $PROJECT-$COMMIT + + echo "Cleaning..." + rm -rf $PROJECT-$COMMIT + + echo "Done." +fi diff --git a/php-sabre-dav4.spec b/php-sabre-dav4.spec index fa0e6ff..02e9ccc 100644 --- a/php-sabre-dav4.spec +++ b/php-sabre-dav4.spec @@ -1,13 +1,16 @@ # remirepo/fedora spec file for php-sabre-dav4 # -# Copyright (c) 2013-2020 Remi Collet +# Copyright (c) 2013-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # + +%bcond_without tests + # Github -%global gh_commit 5736f943c90d8d73d04cd8944d8c913811dc7360 +%global gh_commit c1afdc77a95efea6ee40c03c45f57c3c0c80ec22 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sabre-io %global gh_project dav @@ -18,18 +21,19 @@ %global ns_vendor Sabre %global ns_project DAV %global major 4 -%bcond_without tests Name: php-%{pk_vendor}-%{pk_project}%{major} Summary: WebDAV Framework for PHP -Version: 4.1.1 -Release: 2%{?dist} +Version: 4.1.5 +Release: 1%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} # sabre is BSD # assets/openiconic is MIT License: BSD and MIT -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz +Source0: %{name}-%{version}-%{gh_short}.tgz +# git snapshot to retrieve tests +Source1: makesrc.sh # replace composer autoloader Patch0: %{name}-autoload.patch @@ -58,20 +62,26 @@ BuildRequires: php-curl BuildRequires: php-pdo BuildRequires: php-json # From composer.json, "require-dev" : { -# "friendsofphp/php-cs-fixer": "~2.16.1", +# "friendsofphp/php-cs-fixer": "^2.17.1", # "phpstan/phpstan": "^0.12", # "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", # "evert/phpdoc-md" : "~0.1.0", # "squizlabs/php_codesniffer": "~1.5.3" # "monolog/monolog": "^1.18" -BuildRequires: phpunit8 >= 8.5 +%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9 +BuildRequires: phpunit9 +%global phpunit %{_bindir}/phpunit9 +%else +BuildRequires: phpunit8 +%global phpunit %{_bindir}/phpunit8 +%endif %endif # Autoloader BuildRequires: php-fedora-autoloader-devel BuildRequires: php-pdo_sqlite # From composer.json, "require": { -# "php": ">=7.1.0", +# "php": ">=7.1.0 || ^8.0", # "sabre/vobject": "^4.2.1", # "sabre/event" : "^5.0", # "sabre/xml" : "^2.0.1", @@ -188,15 +198,15 @@ cp -pr lib %{buildroot}%{_datadir}/php/%{ns_vendor} cd tests sed -e 's:@BUILDROOT@:%{buildroot}:' -i bootstrap.php -# TODO testDeliverInsignificantRequest fails locally, not in mock - : Run upstream test suite against installed library ret=0 -for cmd in php php72 php73 php74 php80; do - if which $cmd; then - $cmd %{_bindir}/phpunit8 \ - --filter '^((?!(testDeliverInsignificantRequest)).)*$' \ - || ret=1 +for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do + if which $cmdarg; then + set $cmdarg + for ts in sabre-dav sabre-davacl sabre-caldav sabre-carddav; do + $1 ${2:-%{_bindir}/phpunit9} \ + --testsuite $ts || ret=1 + done fi done exit $ret @@ -217,6 +227,17 @@ exit $ret %changelog +* Mon Feb 15 2021 Remi Collet - 4.1.5-1 +- update to 4.1.5 + +* Tue Jan 12 2021 Remi Collet - 4.1.4-1 +- update to 4.1.4 +- sources from git snapshot + +* Mon Nov 9 2020 Remi Collet - 4.1.3-1 +- update to 4.1.3 +- switch to phpunit9 + * Tue Jul 28 2020 Fedora Release Engineering - 4.1.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 728fa85..daf1e9b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-sabre-dav4-4.1.1-5736f94.tar.gz) = d650e5319184a1148134ba75669c4effd9c7e59718695ec08db6e2cd1f427cf41f709320caf0afa2626f7a3c2ee13b2dd02e67037615e5ee2f1aef2afc75064b +SHA512 (php-sabre-dav4-4.1.5-c1afdc7.tgz) = 3f21634ae7494e78dcc93b4878ca640e46d4cdc005b47a5594892ba0c3e93917973166a470696e954034756abf2b1e6c5d559104d75a5331a7d98b3c72f2083d