diff options
| l--------- | makesrc.sh | 1 | ||||
| -rwxr-xr-x | php-react-event-loop-get-source.sh | 74 | ||||
| -rw-r--r-- | php-react-event-loop.spec | 23 | 
3 files changed, 90 insertions, 8 deletions
| 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 <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      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  <?php @@ -126,7 +130,7 @@ BOOTSTRAP  : Upstream tests  RETURN_CODE=0  PHPUNIT=$(which phpunit7) -for PHP_EXEC in "" php71 php72 php73 php74; do +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 @@ -148,6 +152,9 @@ exit $RETURN_CODE  %changelog +* Wed Nov  4 2020 Remi Collet <remi@remirepo.net> - 1.1.1-1 +- update to 1.1.1 +  * Sat Dec 14 2019 Shawn Iwinski <shawn@iwin.ski> - 1.1.0-1  - Update to 1.1.0 (RHBZ #1599719)  - Use PHPUnit 7 | 
