summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json7
-rw-r--r--php-myclabs-deep-copy-autoload.php8
-rw-r--r--php-myclabs-deep-copy.spec29
3 files changed, 28 insertions, 16 deletions
diff --git a/composer.json b/composer.json
index d5d3a77..4108a23 100644
--- a/composer.json
+++ b/composer.json
@@ -21,12 +21,15 @@
},
"require": {
- "php": "^5.6 || ^7.0"
+ "php": "^7.1"
},
"require-dev": {
"doctrine/collections": "^1.0",
"doctrine/common": "^2.6",
- "phpunit/phpunit": "^4.1"
+ "phpunit/phpunit": "^7.1"
+ },
+ "replace": {
+ "myclabs/deep-copy": "self.version"
},
"config": {
diff --git a/php-myclabs-deep-copy-autoload.php b/php-myclabs-deep-copy-autoload.php
index 7392447..26343f0 100644
--- a/php-myclabs-deep-copy-autoload.php
+++ b/php-myclabs-deep-copy-autoload.php
@@ -1,8 +1,10 @@
<?php
/* Autoloader for myclabs/deep-copy and its dependencies */
-require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-require_once __DIR__ . '/deep_copy.php';
+if (!function_exists("DeepCopy\\deep_copy")) {
+ require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
+ require_once __DIR__ . '/deep_copy.php';
-\Fedora\Autoloader\Autoload::addPsr4('DeepCopy\\', __DIR__);
+ \Fedora\Autoloader\Autoload::addPsr4('DeepCopy\\', __DIR__);
+}
diff --git a/php-myclabs-deep-copy.spec b/php-myclabs-deep-copy.spec
index cad1057..6d676b3 100644
--- a/php-myclabs-deep-copy.spec
+++ b/php-myclabs-deep-copy.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e
+%global gh_commit 478465659fd987669df0bd8a9bf22a8710e5f1b6
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner myclabs
%global gh_project DeepCopy
@@ -15,8 +15,8 @@
%global with_tests 0%{!?_without_tests:1}
Name: php-myclabs-deep-copy
-Version: 1.7.0
-Release: 1%{?dist}
+Version: 1.8.0
+Release: 0%{?dist}
Summary: Create deep copies (clones) of your objects
Group: Development/Libraries
@@ -30,25 +30,25 @@ Source2: %{name}-autoload.php
BuildArch: noarch
%if %{with_tests}
# For tests
-BuildRequires: php(language) >= 5.6
+BuildRequires: php(language) >= 7.1
BuildRequires: php-reflection
BuildRequires: php-spl
# From composer.json, "require-dev": {
# "doctrine/collections": "^1.0",
# "doctrine/common": "^2.6",
-# "phpunit/phpunit": "^4.1"
+# "phpunit/phpunit": "^7.1"
BuildRequires: php-composer(doctrine/collections) < 2
BuildRequires: php-composer(doctrine/collections) >= 1.0
BuildRequires: php-composer(doctrine/common) < 3
BuildRequires: php-composer(doctrine/common) >= 2.6
-BuildRequires: php-composer(phpunit/phpunit) >= 4.1
+BuildRequires: phpunit6
# Required by autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
-# "php": "^5.6 || ^7.0"
-Requires: php(language) >= 5.6
+# "php": "^7.1"
+Requires: php(language) >= 7.1
# From phpcompatinfo report for version 1.3.0
Requires: php-reflection
Requires: php-spl
@@ -92,10 +92,11 @@ require_once '%{php_home}/Doctrine/Common/autoload.php';
EOF
ret=0
-for cmd in php php56 php70 php71 php72; do
+for cmd in php php71 php72; do
if which $cmd; then
- $cmd -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
- %{_bindir}/phpunit --verbose || ret=1
+ $cmd -d auto_prepend_file=%{buildroot}%{php_home}/%{gh_project}/autoload.php \
+ -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
+ %{_bindir}/phpunit6 --verbose || ret=1
fi
done
exit $ret
@@ -113,9 +114,15 @@ exit $ret
%changelog
+* Wed May 30 2018 Remi Collet <remi@remirepo.net> - 1.8.0-0
+- update to 1.8.0 (no change)
+- boostrap build using phpunit6 (rely on include_path)
+- fix autoloader to avoid duplicate definition
+
* Fri Oct 20 2017 Remi Collet <remi@remirepo.net> - 1.7.0-1
- Update to 1.7.0
- raise dependency on PHP 5.6
+
* Thu Apr 13 2017 Remi Collet <remi@remirepo.net> - 1.6.1-1
- Update to 1.6.1