From 0a7dbbf5f3894ef5cbab36aec8fafbf36a3808f4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 5 May 2017 07:55:52 +0200 Subject: v3.0.1 --- composer.json | 2 +- php-phpdocumentor-reflection.spec | 84 ++++++++++++++++----------------------- 2 files changed, 36 insertions(+), 50 deletions(-) diff --git a/composer.json b/composer.json index b716148..b444592 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": ">=5.3.3", "psr/log": "~1.0", - "nikic/php-parser": "~0.9.4", + "nikic/php-parser": "^1.0", "phpdocumentor/reflection-docblock": "~2.0" }, "suggests": { diff --git a/php-phpdocumentor-reflection.spec b/php-phpdocumentor-reflection.spec index ea4027c..137f7a7 100644 --- a/php-phpdocumentor-reflection.spec +++ b/php-phpdocumentor-reflection.spec @@ -1,23 +1,22 @@ -# spec file for php-phpdocumentor-reflection +# Fedora/remirepo spec file for php-phpdocumentor-reflection # -# Copyright (c) 2016 Remi Collet -# 2017 Remi Collet, Shawn Iwinski +# Copyright (c) 2017 Remi Collet, Shawn Iwinski +# 2016 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%global gh_commit fc40c3f604ac2287eb5c314174d5109b2c699372 +%global gh_commit 793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpDocumentor %global gh_project Reflection %global with_tests 0%{!?_without_tests:1} -%global with_php_parser 1 Name: php-phpdocumentor-reflection -Version: 1.0.7 -Release: 3%{?dist} +Version: 3.0.1 +Release: 1%{?dist} Summary: Reflection library to do Static Analysis for PHP Projects Group: Development/Libraries @@ -25,30 +24,19 @@ License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz -%if %{with_php_parser} -# Temporary, bundled nikik/php-parser 0.9.4 -%global php_parser_owner nikic -%global php_parser_project PHP-Parser -%global php_parser_commit 1e5e280ae88a27effa2ae4aa2bd088494ed8594f -%global php_parser_version 0.9.4 -Source1: https://github.com/%{php_parser_owner}/%{php_parser_project}/archive/%{php_parser_commit}/%{php_parser_project}-%{php_parser_version}.tar.gz -Provides: bundled(nikic/php-parser) = %{php_parser_version} -%endif - # Temporary, missing in old versions Source2: https://raw.githubusercontent.com/phpDocumentor/Reflection/develop/LICENSE BuildArch: noarch -BuildRequires: php-theseer-autoload +# Autoloader +BuildRequires: php-fedora-autoloader-devel # For tests %if %{with_tests} BuildRequires: php(language) >= 5.3.3 BuildRequires: php-composer(psr/log) >= 1.0 BuildRequires: php-composer(psr/log) < 2 -%if ! %{with_php_parser} -BuildRequires: php-composer(nikic/php-parser) >= 0.9.4 -BuildRequires: php-composer(nikic/php-parser) < 0.10 -%endif +BuildRequires: php-composer(nikic/php-parser) >= 1.0 +BuildRequires: php-composer(nikic/php-parser) < 2 BuildRequires: php-composer(phpdocumentor/reflection-docblock) >= 2.0 BuildRequires: php-composer(phpdocumentor/reflection-docblock) < 3 # From composer.json, "require-dev": { @@ -63,15 +51,13 @@ BuildRequires: php-composer(mockery/mockery) < 1 # From composer.json, require # "php": ">=5.3.3", # "psr/log": "~1.0", -# "nikic/php-parser": "~0.9.4", +# "nikic/php-parser": "^1.0", # "phpdocumentor/reflection-docblock": "~2.0" Requires: php(language) >= 5.3.3 Requires: php-composer(psr/log) >= 1.0 Requires: php-composer(psr/log) < 2 -%if ! %{with_php_parser} -Requires: php-composer(nikic/php-parser) >= 0.9.4 -Requires: php-composer(nikic/php-parser) < 0.10 -%endif +Requires: php-composer(nikic/php-parser) >= 1.0 +Requires: php-composer(nikic/php-parser) < 2 Requires: php-composer(phpdocumentor/reflection-docblock) >= 2.0 Requires: php-composer(phpdocumentor/reflection-docblock) < 3 # For autoloader @@ -79,6 +65,8 @@ Requires: php-PsrLog >= 1.0.0-8 # From phpcompatinfo report for 2.0.3 Requires: php-pcre Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) Provides: php-composer(phpdocumentor/reflection) = %{version} @@ -113,14 +101,7 @@ Autoloader: %{_datadir}/php/phpDocumentor/Reflection/autoload.php %prep -%setup -q -n %{gh_project}-%{gh_commit} -a 1 - -%if %{with_php_parser} -# Include PHPParser in this library, as old deprecated version required -mv %{php_parser_project}-%{php_parser_commit}/lib/PHPParser \ - src/phpDocumentor/Reflection/PHPParser -mv %{php_parser_project}-%{php_parser_commit}/LICENSE LICENSE-PHPParser -%endif +%setup -q -n %{gh_project}-%{gh_commit} cp %{SOURCE2} LICENSE @@ -128,20 +109,20 @@ cp %{SOURCE2} LICENSE %build : Generate library autoloader %{_bindir}/phpab \ + --template fedora \ --output src/phpDocumentor/Reflection/autoload.php \ src/phpDocumentor/Reflection cat << 'EOF' | tee -a src/phpDocumentor/Reflection/autoload.php // Dependencies -require_once '%{_datadir}/php/Psr/Log/autoload.php'; -if (file_exists('%{_datadir}/php/phpDocumentor/Reflection/DocBlock2/autoload.php')) { - require_once '%{_datadir}/php/phpDocumentor/Reflection/DocBlock2/autoload.php'; -} else { - require_once '%{_datadir}/php/phpDocumentor/Reflection/DocBlock/autoload.php'; -} -%if ! %{with_php_parser} -require_once '%{_datadir}/php/PhpParser/autoload.php'; -%endif +\Fedora\Autoloader\Dependencies::required(array( + '%{_datadir}/php/Psr/Log/autoload.php', + array( + '%{_datadir}/php/phpDocumentor/Reflection/DocBlock2/autoload.php', + '%{_datadir}/php/phpDocumentor/Reflection/DocBlock/autoload.php', + ), + '%{_datadir}/php/PhpParser/autoload.php', +)); EOF @@ -165,11 +146,11 @@ require_once '%{_datadir}/php/Mockery/autoload.php'; require_once '%{buildroot}%{_datadir}/php/phpDocumentor/Reflection/autoload.php'; EOF -%{_bindir}/phpunit --verbose - -if which php70; then - php70 %{_bindir}/phpunit --verbose -fi +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose + fi +done %else : Test suite disabled %endif @@ -184,6 +165,11 @@ fi %changelog +* Fri May 5 2017 Remi Collet - 3.0.1-1 +- Update to 3.0.1 +- switch to fedora/autoloader +- use system nikic/php-parser version 1 + * Thu Apr 13 2017 Shawn Iwinski - 1.0.7-3 - Add max versions to BuildRequires - Prepare for php-phpdocumentor-reflection-docblock => -- cgit