From 771eda1c8d76c964f83e943216cf05070a7240fc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 4 Nov 2020 14:12:35 +0100 Subject: v1.1.1 --- makesrc.sh | 1 + php-react-event-loop-get-source.sh | 74 ++++++++++++++++++++++++++++++++++++++ php-react-event-loop.spec | 23 +++++++----- 3 files changed, 90 insertions(+), 8 deletions(-) create mode 120000 makesrc.sh create mode 100755 php-react-event-loop-get-source.sh diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..85cdad7 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-react-event-loop-get-source.sh \ No newline at end of file diff --git a/php-react-event-loop-get-source.sh b/php-react-event-loop-get-source.sh new file mode 100755 index 0000000..8b02c4f --- /dev/null +++ b/php-react-event-loop-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}/ + 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-event-loop.spec b/php-react-event-loop.spec index ae3f2b6..9e123a9 100644 --- a/php-react-event-loop.spec +++ b/php-react-event-loop.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-react-event-loop # -# Copyright (c) 2017-2019 Shawn Iwinski +# Copyright (c) 2017-2020 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner reactphp %global github_name event-loop -%global github_version 1.1.0 -%global github_commit a0ecac955c67b57c40fe4a1b88a7cca1b58c982d +%global github_version 1.1.1 +%global github_commit 6d24de090cd59cfc830263cfba965be77b563c13 %global composer_vendor react %global composer_project event-loop @@ -22,7 +22,7 @@ %global php_min_ver 5.4.0 # Build using "--without tests" to disable tests -%global with_tests 0%{!?_without_tests:1} +%bcond_without tests %{!?phpdir: %global phpdir %{_datadir}/php} @@ -33,11 +33,15 @@ Summary: Event loop abstraction layer that libraries can use for evented I License: MIT URL: https://reactphp.org/event-loop/ -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-event-loop-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} +%if %{with tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: phpunit7 @@ -115,7 +119,7 @@ find %{buildroot}%{phpdir}/React/EventLoop | sed 's#%{buildroot}##' | sort %check -%if %{with_tests} +%if %{with tests} : Create tests bootstrap cat <<'BOOTSTRAP' | tee bootstrap.php - 1.1.1-1 +- update to 1.1.1 + * Sat Dec 14 2019 Shawn Iwinski - 1.1.0-1 - Update to 1.1.0 (RHBZ #1599719) - Use PHPUnit 7 -- cgit