diff options
author | Remi Collet <remi@remirepo.net> | 2020-06-08 14:11:28 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-06-08 14:11:28 +0200 |
commit | a7f43b14dca4a4557216a69bf7735b5c7c4a55ea (patch) | |
tree | da5afdb6f64f996f084f8b80da37e0dd5becc71f | |
parent | 6d42b3c05fa8e5927aa9a17242fb8bd1a6a6b2e8 (diff) |
v0.8.6 from Fedora
-rw-r--r-- | composer.json | 2 | ||||
l--------- | makesrc.sh | 1 | ||||
-rwxr-xr-x | php-react-http-get-source.sh | 74 | ||||
-rw-r--r-- | php-react-http.spec | 37 |
4 files changed, 102 insertions, 12 deletions
diff --git a/composer.json b/composer.json index c3d46a9..ab26ee8 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,6 @@ }, "require-dev": { "clue/block-react": "^1.1", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" } } diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..b4c71e1 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-react-http-get-source.sh
\ No newline at end of file diff --git a/php-react-http-get-source.sh b/php-react-http-get-source.sh new file mode 100755 index 0000000..3947de4 --- /dev/null +++ b/php-react-http-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-http.spec b/php-react-http.spec index b9023da..911e649 100644 --- a/php-react-http.spec +++ b/php-react-http.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-react-http # -# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2017-2020 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner reactphp %global github_name http -%global github_version 0.8.5 -%global github_commit 5f2ce4da6d30779ab1e6b95a0afac3e0e5595f64 +%global github_version 0.8.6 +%global github_commit 248202e57195d06a4375f6d2f5c5b9ff9da3ea9e %global composer_vendor react %global composer_project http @@ -45,6 +45,13 @@ # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} +# Range dependencies supported? +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global with_range_dependencies 1 +%else +%global with_range_dependencies 0 +%endif + %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} @@ -54,15 +61,19 @@ Summary: Library for building an evented http server License: MIT URL: https://reactphp.org/http/ -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-http-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} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: phpunit6 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: phpunit7 +%if %{with_range_dependencies} BuildRequires: (php-composer(clue/block-react) >= %{clue_block_react_min_ver} with php-composer(clue/block-react) < %{clue_block_react_max_ver}) BuildRequires: (php-composer(evenement/evenement) >= %{evenement_min_ver} with php-composer(evenement/evenement) < %{evenement_max_ver}) BuildRequires: (php-composer(react/promise-stream) >= %{react_promise_stream_min_ver} with php-composer(react/promise-stream) < %{react_promise_stream_max_ver}) @@ -86,7 +97,7 @@ BuildRequires: php-composer(react/stream) >= %{react_stream_min_ver} BuildRequires: php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver} BuildRequires: php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver} %endif -## phpcompatinfo (computed from version 0.8.5) +## phpcompatinfo (computed from version 0.8.6) BuildRequires: php-date BuildRequires: php-json BuildRequires: php-pcre @@ -97,7 +108,7 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%if %{with_range_dependencies} Requires: (php-composer(evenement/evenement) >= %{evenement_min_ver} with php-composer(evenement/evenement) < %{evenement_max_ver}) Requires: (php-composer(react/promise-stream) >= %{react_promise_stream_min_ver} with php-composer(react/promise-stream) < %{react_promise_stream_max_ver}) Requires: (php-composer(react/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver}) @@ -118,7 +129,7 @@ Requires: php-composer(react/stream) >= %{react_stream_min_ver} Requires: php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver} Requires: php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver} %endif -# phpcompatinfo (computed from version 0.8.5) +# phpcompatinfo (computed from version 0.8.6) Requires: php-date Requires: php-pcre Requires: php-spl @@ -192,8 +203,8 @@ BOOTSTRAP : Upstream tests RETURN_CODE=0 -PHPUNIT=$(which phpunit6) -for PHP_EXEC in "" php71 php72 php73 php74; do +PHPUNIT=$(which phpunit7) +for PHP_EXEC in "" php72 php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ || RETURN_CODE=1 @@ -214,6 +225,10 @@ exit $RETURN_CODE %changelog +* Sat Jun 06 2020 Shawn Iwinski <shawn@iwin.ski> - 0.8.6-1 +- Update to 0.8.6 (RHBZ #1790302) +- Use PHPUnit 7 + * Sat Dec 14 2019 Shawn Iwinski <shawn@iwin.ski> - 0.8.5-1 - Update to 0.8.5 (RHBZ #1767189) - Use PHPUnit 6 |