From 0513bb9698d88018ddae7b87870085890dcc4b1f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 22 Jan 2018 11:56:36 +0100 Subject: Update to 4.2.0 rename to php-phpdocumentor-reflection-docblock4 move to /usr/share/php/phpDocumentor/Reflection/DocBlock4 raise dependency on PHP 7.0 raise dependency on phpdocumentor/type-resolver 0.4.0 use phpunit6 and php-mockery for test suite --- Makefile | 4 ++ composer.json | 16 +++-- ...phpdocumentor-reflection-docblock-get-source.sh | 71 ------------------ ...hpdocumentor-reflection-docblock4-get-source.sh | 71 ++++++++++++++++++ php-phpdocumentor-reflection-docblock4.spec | 84 +++++++++++++++------- 5 files changed, 144 insertions(+), 102 deletions(-) create mode 100644 Makefile delete mode 100755 php-phpdocumentor-reflection-docblock-get-source.sh create mode 100755 php-phpdocumentor-reflection-docblock4-get-source.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/composer.json b/composer.json index 558046c..e3dc38a 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ } ], "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "autoload": { @@ -22,7 +22,13 @@ "psr-4": {"phpDocumentor\\Reflection\\": ["tests/unit"]} }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4", + "doctrine/instantiator": "~1.0.5" + }, + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } } } diff --git a/php-phpdocumentor-reflection-docblock-get-source.sh b/php-phpdocumentor-reflection-docblock-get-source.sh deleted file mode 100755 index 8cf51f1..0000000 --- a/php-phpdocumentor-reflection-docblock-get-source.sh +++ /dev/null @@ -1,71 +0,0 @@ -#/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 - -NAME=`echo $SPEC | sed 's#\.spec##'` -VERSION=`egrep '^Version:' $SPEC | awk '{print $2}'` - -print "SPEC = $SPEC" -print "NAME = $NAME" - -GIT_OWNER=`egrep '%global\s*gh_owner' $SPEC | awk '{print $3}'` -GIT_NAME=`egrep '%global\s*gh_project' $SPEC | awk '{print $3}'` -GIT_COMMIT=`egrep '%global\s*gh_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) -TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz -CMP_FILE=$PWD/composer.json - -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 $CMP_FILE - popd - - TAR_DIR=${GIT_NAME}-${GIT_COMMIT} - print "TAR_DIR = $TAR_DIR" - - mv $GIT_DIR $TAR_DIR - - 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-phpdocumentor-reflection-docblock4-get-source.sh b/php-phpdocumentor-reflection-docblock4-get-source.sh new file mode 100755 index 0000000..8cf51f1 --- /dev/null +++ b/php-phpdocumentor-reflection-docblock4-get-source.sh @@ -0,0 +1,71 @@ +#/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 + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '^Version:' $SPEC | awk '{print $2}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*gh_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*gh_project' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*gh_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) +TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz +CMP_FILE=$PWD/composer.json + +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 $CMP_FILE + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + 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-phpdocumentor-reflection-docblock4.spec b/php-phpdocumentor-reflection-docblock4.spec index 779e09d..4d391d7 100644 --- a/php-phpdocumentor-reflection-docblock4.spec +++ b/php-phpdocumentor-reflection-docblock4.spec @@ -1,6 +1,6 @@ -# Fedora/remirepo spec file for php-phpdocumentor-reflection-docblock +# Fedora/remirepo spec file for php-phpdocumentor-reflection-docblock4 # -# Copyright (c) 2017 Remi Collet, Shawn Iwinski +# Copyright (c) 2017-2018 Remi Collet, Shawn Iwinski # 2014-2015 Remi Collet # # License: CC-BY-SA @@ -8,14 +8,15 @@ # # Please, preserve the changelog entries # -%global gh_commit 4aada1f93c72c35e22fb1383b47fee43b8f1d157 +%global gh_commit 66465776cfc249844bde6d117abff1d22e06c2da %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpDocumentor %global gh_project ReflectionDocBlock +%global major 4 %global with_tests %{?_without_tests:0}%{!?_without_tests:1} -Name: php-phpdocumentor-reflection-docblock -Version: 3.2.2 +Name: php-phpdocumentor-reflection-docblock%{major} +Version: 4.2.0 Release: 1%{?dist} Summary: DocBlock parser @@ -31,19 +32,31 @@ Source1: %{name}-get-source.sh BuildArch: noarch BuildRequires: php-fedora-autoloader-devel %if %{with_tests} -BuildRequires: php(language) >= 5.5 +BuildRequires: php(language) >= 7.0 +%if 0%{?fedora} >= 27 +BuildRequires: (php-composer(phpdocumentor/reflection-common) >= 1.0 with php-composer(phpdocumentor/reflection-common) < 2) +BuildRequires: (php-composer(phpdocumentor/type-resolver) >= 0.4.0 with php-composer(phpdocumentor/type-resolver) < 1.0) +BuildRequires: (php-composer(webmozart/assert) >= 1.0 with php-composer(webmozart/assert) < 2) +%else BuildRequires: php-composer(phpdocumentor/reflection-common) < 2 BuildRequires: php-composer(phpdocumentor/reflection-common) >= 1.0 BuildRequires: php-composer(phpdocumentor/type-resolver) < 1.0 -BuildRequires: php-composer(phpdocumentor/type-resolver) >= 0.3.0 -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: php-composer(phpdocumentor/type-resolver) >= 0.4.0 BuildRequires: php-composer(webmozart/assert) < 2 BuildRequires: php-composer(webmozart/assert) >= 1.0 +%endif # From composer.json, require-dev -# "mockery/mockery": "^0.9.4" -BuildRequires: php-composer(mockery/mockery) < 1 -BuildRequires: php-composer(mockery/mockery) >= 0.9.4 -# From phpcompatinfo report for 3.2.1 +# "mockery/mockery": "^1.0", +# "phpunit/phpunit": "^6.4", +# "doctrine/instantiator": "~1.0.5" +%if 0%{?fedora} >= 27 +BuildRequires: (php-composer(mockery/mockery) >= 1.0 with php-composer(mockery/mockery) < 2) +%else +BuildRequires: php-composer(mockery/mockery) < 2 +BuildRequires: php-composer(mockery/mockery) >= 1.0 +%endif +BuildRequires: phpunit6 >= 6.4 +# From phpcompatinfo report for 4.2.0 BuildRequires: php-filter BuildRequires: php-pcre BuildRequires: php-reflection @@ -51,17 +64,23 @@ BuildRequires: php-spl %endif # From composer.json, require -# "php": ">=5.5" -# "phpdocumentor/reflection-common": "^1.0@dev", -# "phpdocumentor/type-resolver": "^0.3.0", +# "php": ">=7.0" +# "phpdocumentor/reflection-common": "^1.0.0", +# "phpdocumentor/type-resolver": "^0.4.0", # "webmozart/assert": "^1.0" -Requires: php(language) >= 5.5 +Requires: php(language) >= 7.0 +%if 0%{?fedora} >= 27 +Requires: (php-composer(phpdocumentor/reflection-common) >= 1.0 with php-composer(phpdocumentor/reflection-common) < 2) +Requires: (php-composer(phpdocumentor/type-resolver) >= 0.4.0 with php-composer(phpdocumentor/type-resolver) < 1.0) +Requires: (php-composer(webmozart/assert) >= 1.0 with php-composer(webmozart/assert) < 2) +%else Requires: php-composer(phpdocumentor/reflection-common) < 2 Requires: php-composer(phpdocumentor/reflection-common) >= 1.0 Requires: php-composer(phpdocumentor/type-resolver) < 1 -Requires: php-composer(phpdocumentor/type-resolver) >= 0.3.0 +Requires: php-composer(phpdocumentor/type-resolver) >= 0.4.0 Requires: php-composer(webmozart/assert) < 2 Requires: php-composer(webmozart/assert) >= 1.0 +%endif # From phpcompatinfo report for 3.2.1 Requires: php-filter Requires: php-pcre @@ -86,13 +105,18 @@ parser that is fully compatible with the PHPDoc standard. With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock. +Autoloader: %{_datadir}/php/phpDocumentor/Reflection/DocBlock%{major}/autoload.php + %prep %setup -q -n %{gh_project}-%{gh_commit} -sed 's#vendor/mockery/mockery/library#%{_datadir}/php#' phpunit.xml.dist \ +sed 's#vendor/mockery/mockery/library/Mockery#%{_datadir}/php/Mockery1#' phpunit.xml.dist \ > phpunit.xml +# single directory tree +mv src/*php src/DocBlock/ + %build phpab \ @@ -111,8 +135,8 @@ AUTOLOAD %install -mkdir -p %{buildroot}%{_datadir}/php/phpDocumentor -cp -pr src %{buildroot}%{_datadir}/php/phpDocumentor/Reflection +mkdir -p %{buildroot}%{_datadir}/php/phpDocumentor/Reflection +cp -pr src/DocBlock %{buildroot}%{_datadir}/php/phpDocumentor/Reflection/DocBlock%{major} %check @@ -127,19 +151,19 @@ phpab \ cat < - 4.2.0-1 +- Update to 4.2.0 +- rename to php-phpdocumentor-reflection-docblock4 +- move to /usr/share/php/phpDocumentor/Reflection/DocBlock4 +- raise dependency on PHP 7.0 +- raise dependency on phpdocumentor/type-resolver 0.4.0 +- use phpunit6 and php-mockery for test suite + * Tue Aug 8 2017 Remi Collet - 3.2.2-1 - Update to 3.2.2 -- cgit