From 1dc113effd06d820d405420e88d5526404f8fe01 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 8 May 2020 07:50:14 +0200 Subject: update to 4.0.1 sources from git snapshot switch to phpunit9 --- composer.json | 2 +- makesrc.sh | 28 ++++++++++++++++++++++++++++ php-sebastian-diff4.spec | 28 +++++++++++++++++++--------- 3 files changed, 48 insertions(+), 10 deletions(-) create mode 100755 makesrc.sh diff --git a/composer.json b/composer.json index 10a3f33..de3abf0 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ }, "require-dev": { "phpunit/phpunit": "^9.0", - "symfony/process": "^4 || ^5" + "symfony/process": "^4.2 || ^5" }, "autoload": { "classmap": [ diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..4190c13 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,28 @@ +#!/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} + +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 +cp composer.json ../composer.json +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs --exclude tools $PROJECT-$COMMIT + +echo "Cleaning..." +rm -rf $PROJECT-$COMMIT + +echo "Done." diff --git a/php-sebastian-diff4.spec b/php-sebastian-diff4.spec index 3fd8fa4..4da1743 100644 --- a/php-sebastian-diff4.spec +++ b/php-sebastian-diff4.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # %global bootstrap 0 -%global gh_commit c0c26c9188b538bfa985ae10c9f05d278f12060d +%global gh_commit 3e523c576f29dacecff309f35e4cc5a5c168e78a %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sebastianbergmann %global gh_project diff @@ -27,13 +27,14 @@ %endif Name: php-%{pk_vendor}-%{pk_project}%{major} -Version: 4.0.0 +Version: 4.0.1 Release: 1%{?dist} Summary: Diff implementation License: BSD URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz +Source0: %{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh BuildArch: noarch BuildRequires: php-fedora-autoloader-devel @@ -43,9 +44,8 @@ BuildRequires: php-pcre BuildRequires: php-spl # from composer.json, "require-dev": { # "phpunit/phpunit": "^9.0", -# "symfony/process": "^4 || ^5" -# TODO test suite passes with v8, switch to v9 when available -BuildRequires: phpunit8 +# "symfony/process": "^4.2 || ^5" +BuildRequires: phpunit9 BuildRequires: php-symfony4-process %endif @@ -86,7 +86,12 @@ cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major} mkdir vendor %{_bindir}/phpab --output vendor/autoload.php tests cat << 'EOF' | tee -a vendor/autoload.php -\Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\Process', '%{php_home}/Symfony4/Component/Process'); +\Fedora\Autoloader\Dependencies::required([ + [ + '%{php_home}/Symfony5/Component/Process/autoload.php', + '%{php_home}/Symfony4/Component/Process/autoload.php', + ] +]); EOF # remirepo:5 @@ -98,10 +103,10 @@ rm tests/Utils/UnifiedDiffAssertTraitIntegrationTest.php : Run upstream test suite ret=0 -for cmd in php php73 php74; do +for cmd in php php73 php74 php80; do if which $cmd; then $cmd -d auto_prepend_file=%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php \ - %{_bindir}/phpunit8 --verbose || ret=1 + %{_bindir}/phpunit9 --verbose || ret=1 fi done exit $ret @@ -121,6 +126,11 @@ exit $ret %changelog +* Fri May 8 2020 Remi Collet - 4.0.1-1 +- update to 4.0.1 +- sources from git snapshot +- switch to phpunit9 + * Fri Feb 7 2020 Remi Collet - 4.0.0-1 - update to 4.0.0 - raise dependency on PHP 7.3 -- cgit