blob: bc6dd1353fa18bf7ea4cdd518aaa14e6bd6394fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
# remirepo/fedora spec file for php-swaggest-json-diff
#
# Copyright (c) 2019-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%bcond_without tests
# Github
%global gh_commit c55d38a3cb372753b5d5ee4c9b7d8470e486e6a5
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner swaggest
%global gh_project json-diff
# Packagist
%global pk_vendor %{gh_owner}
%global pk_project %{gh_project}
# Namespace
%global ns_vendor Swaggest
%global ns_project JsonDiff
%global major %nil
Name: php-%{pk_vendor}-%{pk_project}%{major}
Version: 3.11.0
Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist}
Summary: JSON diff/rearrange/patch/pointer library for PHP
License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{?gh_short}.tgz
Source1: makesrc.sh
BuildArch: noarch
%if %{with tests}
BuildRequires: php-json
# For tests, from composer.json "require-dev": {
# "phpunit/phpunit": "4.8.37"
BuildRequires: phpunit9
%global phpunit %{_bindir}/phpunit9
BuildRequires: php-filter
BuildRequires: php-pcre
# For autoloader
BuildRequires: php-fedora-autoloader-devel
%endif
# From composer.json, "require": {
# "ext-json": "*"
Requires: php-json
# From phpcompatinfo report for 3.7.0
Requires: php-filter
Requires: php-pcre
# For generated autoloader
Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
%description
A PHP implementation for finding unordered diff between two JSON documents.
Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%build
: Create autoloader
%{_bindir}/phpab -t fedora -o src/autoload.php src
%install
: Library
mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}
%check
%if %{with tests}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\Tests\\', dirname(__DIR__).'/tests');
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\Testcase {
function setExpectedException($e, $m) {
$this->expectException($e);
$this->expectExceptionMessage($m);
}
}
EOF
ret=0
for cmd in php php81 php82 php83; do
if which $cmd; then
$cmd %{phpunit} --no-coverage || ret=1
fi
done
exit $ret
%else
: Test suite disabled
%endif
%files
%license LICENSE
%doc composer.json
%doc README.md
%doc CHANGELOG.md
%dir %{_datadir}/php/%{ns_vendor}
%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}
%changelog
* Wed Jul 3 2024 Remi Collet <remi@remirepo.net> - 3.11.0-1
- update to 3.11.0
* Fri Nov 17 2023 Remi Collet <remi@remirepo.net> - 3.10.5-1
- update to 3.10.5
* Fri Oct 6 2023 Remi Collet <remi@remirepo.net> - 3.10.4-4
- switch to phpunit9
* Thu Nov 10 2022 Remi Collet <remi@remirepo.net> - 3.10.4-1
- update to 3.10.4
* Tue Nov 8 2022 Remi Collet <remi@remirepo.net> - 3.10.3-1
- update to 3.10.3
* Tue Oct 25 2022 Remi Collet <remi@remirepo.net> - 3.10.1-1
- update to 3.10.1
* Fri Oct 21 2022 Remi Collet <remi@remirepo.net> - 3.10.0-1
- update to 3.10.0
* Mon Sep 12 2022 Remi Collet <remi@remirepo.net> - 3.9.0-1
- update to 3.9.0
* Mon Sep 27 2021 Remi Collet <remi@remirepo.net> - 3.8.3-1
- update to 3.8.3
* Wed Sep 22 2021 Remi Collet <remi@remirepo.net> - 3.8.2-1
- update to 3.8.2
* Mon Sep 28 2020 Remi Collet <remi@remirepo.net> - 3.8.1-1
- update to 3.8.1
* Fri Sep 25 2020 Remi Collet <remi@remirepo.net> - 3.8.0-1
- update to 3.8.0
* Wed May 27 2020 Remi Collet <remi@remirepo.net> - 3.7.5-1
- update to 3.7.5
* Mon Jan 27 2020 Remi Collet <remi@remirepo.net> - 3.7.4-1
- update to 3.7.4
* Wed Oct 23 2019 Remi Collet <remi@remirepo.net> - 3.7.2-1
- update to 3.7.2 (no change)
* Thu Sep 26 2019 Remi Collet <remi@remirepo.net> - 3.7.1-1
- update to 3.7.1
* Thu Sep 12 2019 Remi Collet <remi@remirepo.net> - 3.7.0-1
- initial package
|