From 4a5e9c0cbfe97371940ee2e9ae79f76c602d84f5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 8 Jun 2020 14:00:24 +0200 Subject: v2.8.0 from Fedora --- composer.json | 4 +-- makesrc.sh | 1 + php-react-promise-get-source.sh | 74 +++++++++++++++++++++++++++++++++++++++++ php-react-promise.spec | 26 ++++++++++----- 4 files changed, 94 insertions(+), 11 deletions(-) create mode 120000 makesrc.sh create mode 100755 php-react-promise-get-source.sh diff --git a/composer.json b/composer.json index 2fc4809..b3e723a 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" }, "autoload": { "psr-4": { @@ -19,7 +19,7 @@ }, "autoload-dev": { "psr-4": { - "React\\Promise\\": "tests/fixtures" + "React\\Promise\\": ["tests", "tests/fixtures"] } }, "keywords": [ diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..ed1a0af --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-react-promise-get-source.sh \ No newline at end of file diff --git a/php-react-promise-get-source.sh b/php-react-promise-get-source.sh new file mode 100755 index 0000000..3947de4 --- /dev/null +++ b/php-react-promise-get-source.sh @@ -0,0 +1,74 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +SPEC_DIR=`pwd` + +print "SPEC_DIR = $SPEC_DIR" + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + cp composer.json ${SPEC_DIR}/composer.json + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + TAR_FILE=${SPEC_DIR}/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-react-promise.spec b/php-react-promise.spec index 404a0b6..c3d7da5 100644 --- a/php-react-promise.spec +++ b/php-react-promise.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-react-promise # -# Copyright (c) 2014-2019 Shawn Iwinski +# Copyright (c) 2014-2020 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner reactphp %global github_name promise -%global github_version 2.7.1 -%global github_commit 31ffa96f8d2ed0341a57848cbb84d88b89dd664d +%global github_version 2.8.0 +%global github_commit f3cff96a19736714524ca0dd1d4130de73dbbbc4 %global composer_vendor react %global composer_project promise @@ -33,15 +33,19 @@ Summary: A lightweight implementation of CommonJS Promises/A for PHP License: MIT URL: https://reactphp.org/promise/ -Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +# GitHub export does not include tests +# Run php-react-promise-get-source.sh to create full source +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildArch: noarch # Tests %if %{with_tests} -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: phpunit7 ## composer.json BuildRequires: php(language) >= %{php_min_ver} -## phpcompatinfo (computed from version 2.7.1) +## phpcompatinfo (computed from version 2.8.0) BuildRequires: php-json BuildRequires: php-reflection BuildRequires: php-spl @@ -51,7 +55,7 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 2.7.1) +# phpcompatinfo (computed from version 2.8.0) Requires: php-json Requires: php-reflection Requires: php-spl @@ -110,8 +114,8 @@ BOOTSTRAP : Upstream tests RETURN_CODE=0 -PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php55 php70} php71 php72 php73 php74; do +PHPUNIT=$(which phpunit7) +for PHP_EXEC in "" php72 php73 php74 php80; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ || RETURN_CODE=1 @@ -133,6 +137,10 @@ exit $RETURN_CODE %changelog +* Sat Jun 06 2020 Shawn Iwinski - 2.8.0-1 +- Update to 2.8.0 (RHBZ #1835048) +- Use PHPUnit 7 + * Sat Dec 14 2019 Shawn Iwinski - 2.7.1-1 - Update to 2.7.1 -- cgit