summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json7
-rw-r--r--php-myclabs-deep-copy-autoload.php7
-rw-r--r--php-myclabs-deep-copy.spec41
3 files changed, 32 insertions, 23 deletions
diff --git a/composer.json b/composer.json
index 66fb34a..f115fff 100644
--- a/composer.json
+++ b/composer.json
@@ -16,11 +16,12 @@
"require-dev": {
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpspec/prophecy": "^1.10",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"conflict": {
"doctrine/collections": "<1.6.8",
- "doctrine/common": "<2.13.3 || >=3,<3.2.2"
+ "doctrine/common": "<2.13.3 || >=3 <3.2.2"
},
"autoload": {
"psr-4": {
@@ -32,8 +33,8 @@
},
"autoload-dev": {
"psr-4": {
- "DeepCopy\\": "fixtures/",
- "DeepCopyTest\\": "tests/DeepCopyTest/"
+ "DeepCopyTest\\": "tests/DeepCopyTest/",
+ "DeepCopy\\": "fixtures/"
}
},
"config": {
diff --git a/php-myclabs-deep-copy-autoload.php b/php-myclabs-deep-copy-autoload.php
deleted file mode 100644
index 3ed49e9..0000000
--- a/php-myclabs-deep-copy-autoload.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-/* Autoloader for myclabs/deep-copy and its dependencies */
-
-require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-require_once __DIR__ . '/deep_copy.php';
-
-\Fedora\Autoloader\Autoload::addPsr4('DeepCopy\\', __DIR__);
diff --git a/php-myclabs-deep-copy.spec b/php-myclabs-deep-copy.spec
index 114e34e..f1a8524 100644
--- a/php-myclabs-deep-copy.spec
+++ b/php-myclabs-deep-copy.spec
@@ -1,23 +1,29 @@
# remirepo/fedora spec file for php-myclabs-deep-copy
#
-# Copyright (c) 2015-2023 Remi Collet
+# Copyright (c) 2015-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit 7284c22080590fb39f2ffa3e9057f10a4ddd0e0c
+%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
+# Disabled as missing doctrine packages
+%bcond_with tests
+%else
+%bcond_without tests
+%endif
+
+%global gh_commit 3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner myclabs
%global gh_project DeepCopy
%global c_project deep-copy
%global major %nil
%global php_home %{_datadir}/php
-%bcond_without tests
Name: php-myclabs-deep-copy%{major}
-Version: 1.11.1
-Release: 1%{?dist}
+Version: 1.12.0
+Release: 2%{?dist}
Summary: Create deep copies (clones) of your objects
@@ -26,7 +32,6 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
# git snashop to get upstream test suite
Source0: php-myclabs-deep-copy-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-Source2: php-myclabs-deep-copy-autoload.php
BuildArch: noarch
%if %{with tests}
@@ -37,20 +42,23 @@ BuildRequires: php-spl
# From composer.json, "require-dev": {
# "doctrine/collections": "^1.6.8",
# "doctrine/common": "^2.13.3 || ^3.2.2",
+# "phpspec/prophecy": "^1.10",
# "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(doctrine/collections) >= 1.6.8 with php-composer(doctrine/collections) < 2)
BuildRequires: (php-composer(doctrine/common) >= 3.2.2 with php-composer(doctrine/common) < 4)
-# remirepo:4
+BuildRequires: (php-composer(phpspec/prophecy) >= 1.10 with php-composer(phpspec/prophecy) < 2)
+# remirepo:5
%else
BuildRequires: php-doctrine-collections >= 1.6.8
BuildRequires: php-doctrine-common3 >= 3.2.2
+BuildRequires: php-phpspec-prophecy >= 1.10
%endif
BuildRequires: phpunit9 >= 9.5.13
-# Required by autoloader
-BuildRequires: php-composer(fedora/autoloader)
%endif
+# For autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
# "php": "^7.1 || ^8.0"
@@ -76,11 +84,12 @@ It is designed to handle cycles in the association graph.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-cp %{SOURCE2} src/%{gh_project}/autoload.php
-
%build
-# Empty build section, most likely nothing required.
+phpab --template fedora --output src/%{gh_project}/autoload.php src/%{gh_project}
+cat << 'EOF' | tee -a src/%{gh_project}/autoload.php
+require_once __DIR__ . '/deep_copy.php';
+EOF
%install
@@ -100,11 +109,12 @@ require '%{buildroot}%{php_home}/%{gh_project}%{major}/autoload.php';
\Fedora\Autoloader\Dependencies::required([
'%{php_home}/Doctrine/Common/Collections/autoload.php',
'%{php_home}/Doctrine/Common3/autoload.php',
+ '%{php_home}/Prophecy/autoload.php',
]);
EOF
ret=0
-for cmd in php php80 php81 php82; do
+for cmd in php php81 php82 php83; do
if which $cmd; then
$cmd -d auto_prepend_file=vendor/autoload.php \
%{_bindir}/phpunit9 --verbose || ret=1
@@ -126,6 +136,11 @@ exit $ret
%changelog
+* Thu Jun 13 2024 Remi Collet <remi@remirepo.net> - 1.12.0-2
+- update to 1.12.0
+- disable test suite
+- use classmap autoloader
+
* Wed Mar 8 2023 Remi Collet <remi@remirepo.net> - 1.11.1-1
- update to 1.11.1