summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json2
-rw-r--r--php-ocramius-code-generator-utils.spec38
2 files changed, 27 insertions, 13 deletions
diff --git a/composer.json b/composer.json
index e74f4b5..dd7fd57 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
],
"require": {
"php": "~7.0",
- "nikic/php-parser": "~2.0"
+ "nikic/php-parser": "~2.0|~3.0"
},
"require-dev": {
"phpunit/phpunit": "~5.0",
diff --git a/php-ocramius-code-generator-utils.spec b/php-ocramius-code-generator-utils.spec
index 8dae7c0..80867ad 100644
--- a/php-ocramius-code-generator-utils.spec
+++ b/php-ocramius-code-generator-utils.spec
@@ -12,17 +12,17 @@
%global github_owner Ocramius
%global github_name CodeGenerationUtils
-%global github_version 0.4.0
-%global github_commit 7dc0be1dec3376d95ba094688f0d84f7cf95f300
+%global github_version 0.4.1
+%global github_commit 862c03de42475fe039e7d0f47966c25ac40a58a8
%global composer_vendor ocramius
%global composer_project code-generator-utils
# "php": "~7.0"
%global php_min_ver 7.0
-# "nikic/php-parser": "~2.0"
+# "nikic/php-parser": "~2.0|~3.0"
%global php_parser_min_ver 2.0
-%global php_parser_max_ver 3
+%global php_parser_max_ver 4
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -31,7 +31,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: A set of code generator utilities built on top of PHP-Parsers
Group: Development/Libraries
@@ -44,7 +44,8 @@ BuildArch: noarch
%if %{with_tests}
# composer.json
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-nikic-php-parser
+BuildRequires: php-composer(nikic/php-parser) < %{php_parser_max_ver}
+BuildRequires: php-composer(nikic/php-parser) >= %{php_parser_min_ver}
BuildRequires: php-composer(phpunit/phpunit) >= 5.0
# phpcompatinfo (computed from version 0.4.0)
BuildRequires: php-pcre
@@ -56,8 +57,8 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
-# workaround for range version
-Requires: php-nikic-php-parser
+Requires: php-composer(nikic/php-parser) < %{php_parser_max_ver}
+Requires: php-composer(nikic/php-parser) >= %{php_parser_min_ver}
# phpcompatinfo (computed from version 0.4.0)
Requires: php-pcre
Requires: php-spl
@@ -92,9 +93,12 @@ cat <<'AUTOLOAD' | tee src/CodeGenerationUtils/autoload.php
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('CodeGenerationUtils\\', __DIR__);
-\Fedora\Autoloader\Dependencies::required(array(
- '%{phpdir}/PhpParser2/autoload.php',
-));
+\Fedora\Autoloader\Dependencies::required([
+ [
+ '%{phpdir}/PhpParser3/autoload.php',
+ '%{phpdir}/PhpParser2/autoload.php',
+ ],
+]);
AUTOLOAD
@@ -114,7 +118,13 @@ require '%{buildroot}%{phpdir}/CodeGenerationUtils/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('CodeGenerationUtilsTestAsset\\', __DIR__.'/tests/CodeGenerationUtilsTestAsset');
BOOTSTRAP
-%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
+ret=0
+for cmd in php php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --verbose --bootstrap bootstrap.php || ret=1
+ fi
+done
+exit $ret
%else
: Tests skipped
%endif
@@ -134,6 +144,10 @@ rm -rf %{buildroot}
%changelog
+* Fri Jun 23 2017 Remi Collet <remi@remirepo.net> - 0.4.1-1
+- Update to 0.4.1
+- allow nikic/php-parser version 2 and 3
+
* Wed Feb 22 2017 Remi Collet <remi@fedoraproject.org> - 0.4.0-3
- switch to fedora-autoloader