summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json2
-rw-r--r--php-composer-spdx-licenses-autoload.php9
-rw-r--r--php-composer-spdx-licenses.spec60
3 files changed, 33 insertions, 38 deletions
diff --git a/composer.json b/composer.json
index 2b5fed6..50b5763 100644
--- a/composer.json
+++ b/composer.json
@@ -33,7 +33,7 @@
"php": "^5.3.2 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.5 || ^5.0.5",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
"phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
},
"autoload": {
diff --git a/php-composer-spdx-licenses-autoload.php b/php-composer-spdx-licenses-autoload.php
deleted file mode 100644
index 35fd2c8..0000000
--- a/php-composer-spdx-licenses-autoload.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-/* Autoloader for composer/spdx-licenses and its dependencies */
-
-if (!class_exists('Fedora\\Autoloader\\Autoload', false)) {
- require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-}
-
-\Fedora\Autoloader\Autoload::addPsr4('Composer\\Spdx\\', __DIR__);
-
diff --git a/php-composer-spdx-licenses.spec b/php-composer-spdx-licenses.spec
index 8d54696..ffd9bdd 100644
--- a/php-composer-spdx-licenses.spec
+++ b/php-composer-spdx-licenses.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 2603a0d7ddc00a015deb576fa5297ca43dee6b1c
+%global gh_commit 2d899e9b33023c631854f36c39ef9f8317a7ab33
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20150717
%global gh_owner composer
@@ -15,7 +15,7 @@
%global with_tests 0%{!?_without_tests:1}
Name: php-composer-spdx-licenses
-Version: 1.1.6
+Version: 1.2.0
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}
Summary: SPDX licenses list and validation library
@@ -25,7 +25,6 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
# git snapshot to get upstream test suite
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-Source2: %{name}-autoload.php
# Resources path
Patch0: %{name}-rpm.patch
@@ -38,10 +37,16 @@ BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-spl
# From composer.json, "require-dev": {
-# "phpunit/phpunit": "phpunit/phpunit": "^4.5 || ^5.0.5",
+# "phpunit/phpunit": "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
# "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
-BuildRequires: php-composer(phpunit/phpunit) >= 4.5
-BuildRequires: php-composer(phpunit/phpunit-mock-objects) >= 2.3
+%if 0%{?fedora} >= 26
+%global phpunit %{_bindir}/phpunit6
+# ignore min version, test suite passes with 6.4
+BuildRequires: phpunit6 >= 6.4
+%else
+%global phpunit %{_bindir}/phpunit
+BuildRequires: php-phpunit-PHPUnit >= 4.8.35
+%endif
# Autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
@@ -49,7 +54,7 @@ BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require": {
# "php": "^5.3.2 || ^7.0",
Requires: php(language) >= 5.3.2
-# From phpcompatinfo report for version 1.0.0 (SpdxLicenses.php only)
+# From phpcompatinfo report for version 1.6.0 (SpdxLicenses.php only)
Requires: php-json
Requires: php-pcre
Requires: php-spl
@@ -70,11 +75,17 @@ now extracted and made available as a stand-alone library.
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p0
-cp %{SOURCE2} src/autoload.php
%build
-# Empty build section, most likely nothing required.
+: Create autoloader
+cat <<'AUTOLOAD' | tee src/autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('Composer\\Spdx\\', __DIR__);
+AUTOLOAD
%install
@@ -99,27 +110,16 @@ rm tests/SpdxLicensesUpdaterTest.php
export BUILDROOT_SPDX=%{buildroot}
-# remirepo:15
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit \
- --bootstrap %{buildroot}%{php_home}/Composer/Spdx/autoload.php \
- --verbose
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit \
+for cmd in "php %{phpunit}" "php56 %{_bindir}/phpunit" php70 php71 php72; do
+ if which $cmd; then
+ set $cmd
+ $1 -d memory_limit=1G ${2:-%{_bindir}/phpunit6} \
--bootstrap %{buildroot}%{php_home}/Composer/Spdx/autoload.php \
- --verbose
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit \
- --bootstrap %{buildroot}%{php_home}/Composer/Spdx/autoload.php \
- --verbose
-# remirepo:2
-fi
+ --no-coverage \
+ --verbose || ret=1
+ fi
+done
exit $ret
%else
: Test suite disabled
@@ -137,6 +137,10 @@ exit $ret
%changelog
+* Thu Jan 4 2018 Remi Collet <remi@remirepo.net> - 1.2.0-1
+- Update to 1.2.0
+- use phpunit6 on Fedora
+
* Tue Apr 4 2017 Remi Collet <remi@remirepo.net> - 1.1.6-1
- Update to 1.1.6