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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
# remirepo/fedora spec file for php-phpspec
#
# Copyright (c) 2015-2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# passes in local build, fails in mock
%bcond_with tests
# For compatibility with SCL
%undefine __brp_mangle_shebangs
%global gh_commit 28faa87d1151a15848166226f33de61cb7107d0d
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner phpspec
%global gh_project phpspec
#global prever beta3
# Only allow a single Symfony version
# to ensure components consistency
%global symfony_ns Symfony4
%global symfony_min 4.4
%global symfony_max 5
Name: php-phpspec
Version: 7.4.0
Release: 1%{?dist}
Summary: Specification-oriented BDD framework for PHP
License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}%{?prever}-%{gh_short}.tgz
Source1: %{gh_project}-autoload.php
# get git snapshot to retrieve tests
Source2: makesrc.sh
# Use our autoloader
Patch0: %{gh_project}-4-rpm.patch
BuildArch: noarch
BuildRequires: php(language) >= 7.3
%if %{with tests}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(phpspec/prophecy) >= 1.9 with php-composer(phpspec/prophecy) < 2)
BuildRequires: (php-composer(phpspec/php-diff) >= 1.0.0 with php-composer(phpspec/php-diff) < 2)
BuildRequires: (php-composer(sebastian/exporter) >= 3 with php-composer(sebastian/exporter) < 6)
BuildRequires: (php-composer(doctrine/instantiator) >= 1.0.5 with php-composer(doctrine/instantiator) < 3)
# remirepo:6
%else
BuildRequires: php-phpspec-prophecy >= 1.9
BuildRequires: php-phpspec-php-diff >= 1.0.0
BuildRequires: php-sebastian-exporter3 >= 3
BuildRequires: php-doctrine-instantiator >= 1.0.5
%endif
BuildRequires: php-symfony4-console >= %{symfony_min}
BuildRequires: php-symfony4-event-dispatcher >= %{symfony_min}
BuildRequires: php-symfony4-finder >= %{symfony_min}
BuildRequires: php-symfony4-process >= %{symfony_min}
BuildRequires: php-symfony4-yaml >= %{symfony_min}
# From composer.json, require-dev
# "behat/behat": "^3.3",
# "symfony/filesystem": "^3.4 || ^4.0 || ^5.0 || ^6.0",
# "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0",
# "vimeo/psalm": "^4.3 || ^5.2"
BuildRequires: php-symfony4-filesystem >= %{symfony_min}
# keep v9 for PHP 8.0 and until v10 approved
%global phpunit %{_bindir}/phpunit9
BuildRequires: %{phpunit}
%endif
# Autoloader
BuildRequires: php-composer(fedora/autoloader) >= 1
# From composer.json, require
# "php": "^7.3 || 8.0.* || 8.1.* || 8.2.*",
# "phpspec/prophecy": "^1.9",
# "phpspec/php-diff": "^1.0.0",
# "sebastian/exporter": "^3.0 || ^4.0 || ^5.0",
# "symfony/console": "^3.4 || ^4.4 || ^5.0 || ^6.0",
# "symfony/event-dispatcher": "^3.4 || ^4.4 || ^5.0 || ^6.0",
# "symfony/process": "^3.4 || ^4.4 || ^5.0 || ^6.0",
# "symfony/finder": "^3.4 || ^4.4 || ^5.0 || ^6.0",
# "symfony/yaml": "^3.4 || ^4.4 || ^5.0 || ^6.0",
# "doctrine/instantiator": "^1.0.5 || ^2"
# "ext-tokenizer": "*"
Requires: php(language) >= 7.3
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(phpspec/prophecy) >= 1.9 with php-composer(phpspec/prophecy) < 2)
Requires: (php-composer(phpspec/php-diff) >= 1.0.0 with php-composer(phpspec/php-diff) < 2)
Requires: (php-composer(sebastian/exporter) >= 3 with php-composer(sebastian/exporter) < 6)
Requires: (php-composer(doctrine/instantiator) >= 1.0.5 with php-composer(doctrine/instantiator) < 3)
# remirepo:6
%else
Requires: php-phpspec-prophecy >= 1.9
Requires: php-phpspec-php-diff >= 1.0.0
Requires: php-sebastian-exporter3 >= 3
Requires: php-doctrine-instantiator >= 1.0.5
%endif
Requires: php-symfony4-console >= %{symfony_min}
Requires: php-symfony4-event-dispatcher >= %{symfony_min}
Requires: php-symfony4-finder >= %{symfony_min}
Requires: php-symfony4-process >= %{symfony_min}
Requires: php-symfony4-yaml >= %{symfony_min}
Requires: php-tokenizer
# Autoloader
Requires: php-composer(fedora/autoloader) >= 1
# From phpcompatinfo report
Requires: php-json
Requires: php-pcntl
Requires: php-pcre
Requires: php-reflection
Requires: php-spl
# Composer
Provides: php-composer(phpspec/phpspec) = %{version}
# The application
Provides: phpspec = %{version}
%description
phpspec is a tool which can help you write clean and working PHP code
using behaviour driven development or BDD. BDD is a technique derived
from test-first development.
BDD is a technique used at story level and spec level. phpspec is a tool
for use at the spec level or SpecBDD. The technique is to first use a tool
like phpspec to describe the behaviour of an object you are about to write.
Next you write just enough code to meet that specification and finally you
refactor this code.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p0 -b .rpm
sed -e 's/@SYMFONY@/%{symfony_ns}/' \
%{SOURCE1} > src/PhpSpec/autoload.php
%build
# Nothing
%install
# No namespace, so use a package specific dir
mkdir -p %{buildroot}%{_datadir}/php
cp -pr src/PhpSpec %{buildroot}%{_datadir}/php/PhpSpec
install -Dpm755 bin/phpspec %{buildroot}%{_bindir}/phpspec
%check
%if %{with tests}
export LANG=C.UTF-8
# Ignore this test which use bossa/phpspec2-expect
rm spec/PhpSpec/Message/CurrentExampleTrackerSpec.php
# Ignore this test which rely on composer installation
rm spec/PhpSpec/NamespaceProvider/ComposerPsrNamespaceProviderSpec.php
for cmdarg in "php %{phpunit}" php80 php81 php82; do
if which $cmdarg; then
set $cmdarg
$1 -d memory_limit=1G -d include_path=.:%{buildroot}%{_datadir}/php \
bin/phpspec \
run --format pretty --no-ansi
$1 ${2:-%{_bindir}/phpunit9} \
--bootstrap %{buildroot}%{_datadir}/php/PhpSpec/autoload.php
fi
done
%endif
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.* CHANGES.*
%doc composer.json
%{_bindir}/phpspec
%{_datadir}/php/PhpSpec
%changelog
* Tue Apr 25 2023 Remi Collet <remi@remirepo.net> - 7.4.0-1
- update to 7.4.0
- allow sebastian/exporter 5
- allow doctrine/instantiator 2
* Thu Dec 15 2022 Remi Collet <remi@remirepo.net> - 7.3.0-1
- update to 7.3.0
* Mon Mar 14 2022 Remi Collet <remi@remirepo.net> - 7.2.0-1
- update to 7.2.0
* Mon Jun 21 2021 Remi Collet <remi@remirepo.net> - 7.1.0-1
- update to 7.1.0
* Wed Jan 6 2021 Remi Collet <remi@remirepo.net> - 7.0.1-1
- update to 7.0.1
* Tue Nov 3 2020 Remi Collet <remi@remirepo.net> - 7.0.0-1
- update to 7.0.0
- raise dependency on PHP 7.3
- raise dependency on Symfony 4.4
* Mon Nov 2 2020 Remi Collet <remi@remirepo.net> - 6.3.0-1
- update to 6.3.0
* Thu Oct 29 2020 Remi Collet <remi@remirepo.net> - 6.2.2-1
- update to 6.2.2
- switch to phpunit9
* Wed Jul 8 2020 Remi Collet <remi@remirepo.net> - 6.2.1-1
- update to 6.2.1
* Wed Jun 17 2020 Remi Collet <remi@remirepo.net> - 6.2.0-1
- update to 6.2.0
- allow sebastian/exporter 4
* Thu Dec 19 2019 Remi Collet <remi@remirepo.net> - 6.1.1-1
- update to 6.1.1
* Fri Nov 29 2019 Remi Collet <remi@remirepo.net> - 6.1.0-1
- update to 6.1.0
- raise dependency on phpspec/prophecy 1.9
- use phpunit7
* Wed Oct 2 2019 Remi Collet <remi@remirepo.net> - 6.0.0-1
- update to 6.0.0
- raise dependency to PHP 7.2
* Wed Oct 2 2019 Remi Collet <remi@remirepo.net> - 5.1.2-1
- update to 5.1.2
* Mon Aug 19 2019 Remi Collet <remi@remirepo.net> - 5.1.1-1
- update to 5.1.1
* Fri Feb 1 2019 Remi Collet <remi@remirepo.net> - 5.1.0-3
- use Symfony component autoloaders
* Tue Nov 20 2018 Remi Collet <remi@remirepo.net> - 5.1.0-2
- ignore failed test on 32-bit arch FTBFS #1651396
reported as https://github.com/phpspec/phpspec/issues/1234
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 5.1.0-2
- Use C.UTF-8 locale
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
* Mon Oct 29 2018 Remi Collet <remi@remirepo.net> - 5.1.0-1
- update to 5.1.0
* Mon Oct 1 2018 Remi Collet <remi@remirepo.net> - 5.0.3-1
- update to 5.0.3
* Mon Sep 24 2018 Remi Collet <remi@remirepo.net> - 5.0.2-1
- update to 5.0.2
* Tue Jul 17 2018 Remi Collet <remi@remirepo.net> - 5.0.1-1
- update to 5.0.1
* Mon Jul 16 2018 Remi Collet <remi@remirepo.net> - 5.0.0-2
- missing dependency on symfony/yaml
* Mon Jul 16 2018 Remi Collet <remi@remirepo.net> - 5.0.0-1
- update to 5.0.0
- raise dependency on PHP 7.1
- switch to Symfony 4
- raise dependency on phpspec/prophecy 1.7
- undefine __brp_mangle_shebangs
* Tue Jul 3 2018 Remi Collet <remi@remirepo.net> - 4.3.1-1
- update to 4.3.1
- use range dependencies on F27+
* Sat Dec 23 2017 Remi Collet <remi@remirepo.net> - 4.3.0-1
- Update to 4.3.0
* Thu Dec 7 2017 Remi Collet <remi@remirepo.net> - 4.2.5-1
- Update to 4.2.5
* Mon Nov 27 2017 Remi Collet <remi@remirepo.net> - 4.2.4-1
- Update to 4.2.4
* Sat Nov 18 2017 Remi Collet <remi@remirepo.net> - 4.2.2-1
- Update to 4.2.2
* Sat Nov 11 2017 Remi Collet <remi@remirepo.net> - 4.2.1-1
- Update to 4.2.1
* Tue Nov 7 2017 Remi Collet <remi@remirepo.net> - 4.2.0-2
- fix FTBFS from Koschei using symfony package names
* Sun Oct 29 2017 Remi Collet <remi@remirepo.net> - 4.2.0-1
- Update to 4.2.0
* Thu Oct 19 2017 Remi Collet <remi@remirepo.net> - 4.1.0-1
- Update to 4.1.0
* Sun Aug 27 2017 Remi Collet <remi@remirepo.net> - 4.0.3-1
- Update to 4.0.3
- raise memory_limit for test suite
* Mon Aug 7 2017 Remi Collet <remi@remirepo.net> - 4.0.2-1
- Update to 4.0.2
- raise dependency on symfony 3.2
- raise dependency on PHP 7.0
- switch to phpunit6
* Fri May 12 2017 Remi Collet <remi@remirepo.net> - 3.4.0-1
- Update to 3.4.0
* Thu May 11 2017 Remi Collet <remi@remirepo.net> - 3.3.0-3
- only allow a single Symfony version
* Mon May 8 2017 Remi Collet <remi@remirepo.net> - 3.3.0-2
- fix autoloader for Symfony 3
- always use symfony 3 during the build (per upstream)
* Thu Apr 27 2017 Remi Collet <remi@remirepo.net> - 3.3.0-1
- Update to 3.3.0
- use phpunit6 on F26+
* Fri Mar 3 2017 Remi Collet <remi@remirepo.net> - 3.2.3-3
- fix autoloader for dep. with multiple versions
* Sun Jan 29 2017 Remi Collet <remi@fedoraproject.org> - 3.2.3-1
- update to 3.2.3
* Tue Dec 6 2016 Remi Collet <remi@fedoraproject.org> - 3.2.2-1
- update to 3.2.2
* Mon Dec 5 2016 Remi Collet <remi@fedoraproject.org> - 3.2.1-1
- update to 3.2.1
* Mon Nov 28 2016 Remi Collet <remi@fedoraproject.org> - 3.2.0-1
- update to 3.2.0
* Tue Nov 22 2016 Remi Collet <remi@fedoraproject.org> - 3.1.1-2
- ignore sebastian/exporter max version
- switch to fedora/autoloader
* Tue Sep 27 2016 Remi Collet <remi@fedoraproject.org> - 3.1.1-1
- update to 3.1.1
* Mon Sep 19 2016 Remi Collet <remi@fedoraproject.org> - 3.1.0-1
- update to 3.1.0
* Mon Jul 18 2016 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
- update to 3.0.0
- raise dependency on php ^5.6 || ^7.0
- raise dependency on phpspec/prophecy ^1.5
- raise dependency on symfony/console ^2.7 || ^3.0
* Mon Jul 18 2016 Remi Collet <remi@fedoraproject.org> - 2.5.1-1
- update to 2.5.1
* Mon Mar 21 2016 Remi Collet <remi@fedoraproject.org> - 2.5.0-1
- update to 2.5.0
* Sat Jan 2 2016 Remi Collet <remi@fedoraproject.org> - 2.4.1-1
- update to 2.4.1
* Sun Nov 29 2015 Remi Collet <remi@fedoraproject.org> - 2.4.0-1
- update to 2.4.0
- allow to use symfony 3.0
* Wed Oct 28 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
- update to 2.3.0
* Thu Aug 13 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-0.1.beta1
- update to 2.3.0beta3
* Mon Jun 29 2015 Remi Collet <remi@fedoraproject.org> - 2.2.1-3
- switch to $fedoraClassLoader autoloader
- ensure /usr/share/php is in include_path
* Sat May 30 2015 Remi Collet <remi@fedoraproject.org> - 2.2.1-1
- update to 2.2.1
* Sun Apr 19 2015 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
- update to 2.2.0
- raise dependency on phpspec/prophecy 1.4
* Tue Feb 17 2015 Remi Collet <remi@fedoraproject.org> - 2.1.1-1
- initial package
|