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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
|
# spec file for php-pear-PHP-CodeSniffer
#
# Copyright (c) 2013-2024 Remi Collet
# Copyright (c) 2009-2013 Christof Damian
# Copyright (c) 2006-2009 Konstantin Ryabitsev
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#
# remirepo:2
# For compatibility with SCL
%undefine __brp_mangle_shebangs
%bcond_without tests
%global gh_commit 19473c30efe4f7b3cd42522d0b2e6e7f243c6f87
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_date 2024-11-16
%global gh_owner PHPCSStandards
%global gh_project PHP_CodeSniffer
# keep in old PEAR tree
%global pear_phpdir %{_datadir}/pear
Name: php-pear-PHP-CodeSniffer
Version: 3.11.1
Release: 1%{?dist}
Summary: PHP coding standards enforcement tool
License: BSD-3-Clause
URL: https://github.com/%{gh_owner}/%{gh_project}
# git snapshot to retrieve test suite
Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
# RPM installation path
Patch0: %{name}-rpm.patch
BuildArch: noarch
BuildRequires: php(language) >= 5.4
BuildRequires: php-tokenizer
BuildRequires: php-xmlwriter
BuildRequires: php-simplexml
BuildRequires: php-dom
BuildRequires: php-iconv
BuildRequires: php-intl
%if %{with tests}
# to run test suite, from composer.json "require-dev"
# "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
%global phpunit %{_bindir}/phpunit9
BuildRequires: phpunit9 >= 9.3.4
%endif
# from composer.json "require": {
# "php": ">=5.4.0",
# "ext-tokenizer": "*",
# "ext-xmlwriter": "*",
# "ext-simplexml": "*"
Requires: php(language) >= 5.4
Requires: php-tokenizer
Requires: php-xmlwriter
Requires: php-simplexml
# From phpcompatinfo report for version 3.8.0
Requires: php-dom
Requires: php-iconv
Requires: php-intl
Provides: php-pear(%{gh_project}) = %{version}
Provides: php-composer(squizlabs/php_codesniffer) = %{version}
Provides: phpcs = %{version}
Obsoletes: phpcs < %{version}
%description
PHP_CodeSniffer provides functionality to verify that code conforms to
certain standards, such as PEAR, or user-defined.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch -P0 -p1 -b .rpm
%build
# Empty build section,
%install
: Install the library
mkdir -p %{buildroot}%{pear_phpdir}/PHP/CodeSniffer
cp -pr src %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/src/
cp -pr autoload.php %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/
cp -p phpcs.xml.dist %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/
cp -p phpcs.xsd %{buildroot}%{pear_phpdir}/PHP/CodeSniffer/
: Cleanup
find %{buildroot}%{pear_phpdir}/PHP/CodeSniffer -depth -type d -name Tests -exec rm -r {} \; -print
: Install the commands
install -Dpm 755 bin/phpcs %{buildroot}%{_bindir}/phpcs
install -Dpm 755 bin/phpcbf %{buildroot}%{_bindir}/phpcbf
%if %{with tests}
%check
# fails with js: Couldn't read source file
rm src/Standards/Generic/Tests/Debug/JSHintUnitTest.*
# Fix current date
YEAR=$(date +%Y)
sed -e "/@copyright/s/2021/${YEAR}/" \
-i src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.*.fixed
# Version 3.9.0: Tests: 2276, Assertions: 10969, Warnings: 4, Skipped: 12.
ret=0
for cmdarg in "php %{phpunit}" php81 php82 php83 php84; do
if which $cmdarg; then
set $cmdarg
$1 -d memory_limit=-1 ${2:-%{_bindir}/phpunit9} \
|| ret=1
fi
done
exit $ret
%endif
%post
# no more from pear channel
if [ -x %{_bindir}/pear ]; then
%{_bindir}/pear uninstall --nodeps --ignore-errors --register-only %{gh_project} >/dev/null || :
fi
%files
%{!?_licensedir:%global license %%doc}
%license licence.txt
%doc *.md
%{pear_phpdir}/PHP
%{_bindir}/phpcbf
%{_bindir}/phpcs
%changelog
* Mon Nov 18 2024 Remi Collet <remi@remirepo.net> - 3.11.1-1
- update to 3.11.1
* Tue Nov 12 2024 Remi Collet <remi@remirepo.net> - 3.11.0-1
- update to 3.11.0
* Wed Sep 18 2024 Remi Collet <remi@remirepo.net> - 3.10.3-1
- update to 3.10.3
* Mon Jul 22 2024 Remi Collet <remi@remirepo.net> - 3.10.2-1
- update to 3.10.2
* Thu May 23 2024 Remi Collet <remi@remirepo.net> - 3.10.1-1
- update to 3.10.1
* Wed May 22 2024 Remi Collet <remi@remirepo.net> - 3.10.0-1
- update to 3.10.0
* Wed Apr 24 2024 Remi Collet <remi@remirepo.net> - 3.9.2-1
- update to 3.9.2
* Tue Apr 2 2024 Remi Collet <remi@remirepo.net> - 3.9.1-1
- update to 3.9.1
* Sat Feb 17 2024 Remi Collet <remi@remirepo.net> - 3.9.0-1
- update to 3.9.0
- drop patch merged upstream
* Fri Jan 12 2024 Remi Collet <remi@remirepo.net> - 3.8.1-1
- update to 3.8.1
- add patch for test suite from
https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/256
* Mon Dec 11 2023 Remi Collet <remi@remirepo.net> - 3.8.0-1
- update to 3.8.0
- sources from github instead or pear channel
* Thu Feb 23 2023 Remi Collet <remi@remirepo.net> - 3.7.2-1
- update to 3.7.2
* Mon Jun 20 2022 Remi Collet <remi@remirepo.net> - 3.7.1-1
- update to 3.7.1
* Mon Jun 13 2022 Remi Collet <remi@remirepo.net> - 3.7.0-1
- update to 3.7.0
* Thu Jan 27 2022 Remi Collet <remi@remirepo.net> - 3.6.2-2
- fix new year in test suite, FBTFS #2046828
* Tue Dec 14 2021 Remi Collet <remi@remirepo.net> - 3.6.2-1
- update to 3.6.2
* Mon Oct 11 2021 Remi Collet <remi@remirepo.net> - 3.6.1-1
- update to 3.6.1
* Fri Apr 9 2021 Remi Collet <remi@remirepo.net> - 3.6.0-1
- update to 3.6.0
* Fri Feb 5 2021 Remi Collet <remi@remirepo.net> - 3.5.8-2
- fix test relying on current year, fix FTBFS #1923570
* Fri Oct 23 2020 Remi Collet <remi@remirepo.net> - 3.5.8-1
- update to 3.5.8
* Tue Aug 11 2020 Remi Collet <remi@remirepo.net> - 3.5.6-1
- update to 3.5.6
* Mon Apr 20 2020 Remi Collet <remi@remirepo.net> - 3.5.5-1
- update to 3.5.5
* Fri Jan 31 2020 Remi Collet <remi@remirepo.net> - 3.5.4-1
- update to 3.5.4
- fix test suite from
https://github.com/squizlabs/PHP_CodeSniffer/pull/2846
https://github.com/squizlabs/PHP_CodeSniffer/pull/2847
* Wed Dec 4 2019 Remi Collet <remi@remirepo.net> - 3.5.3-1
- update to 3.5.3
* Mon Oct 28 2019 Remi Collet <remi@remirepo.net> - 3.5.2-1
- update to 3.5.2
* Thu Oct 17 2019 Remi Collet <remi@remirepo.net> - 3.5.1-1
- update to 3.5.1
* Fri Sep 27 2019 Remi Collet <remi@remirepo.net> - 3.5.0-1
- update to 3.5.0
* Thu Apr 11 2019 Remi Collet <remi@remirepo.net> - 3.4.2-1
- update to 3.4.2
* Tue Mar 19 2019 Remi Collet <remi@remirepo.net> - 3.4.1-1
- update to 3.4.1
* Thu Dec 20 2018 Remi Collet <remi@remirepo.net> - 3.4.0-1
- update to 3.4.0
* Mon Sep 24 2018 Remi Collet <remi@remirepo.net> - 3.3.2-1
- update to 3.3.2
* Fri Jul 27 2018 Remi Collet <remi@remirepo.net> - 3.3.1-1
- update to 3.3.1
* Thu Jun 7 2018 Remi Collet <remi@remirepo.net> - 3.3.0-1
- update to 3.3.0
* Wed Feb 21 2018 Remi Collet <remi@remirepo.net> - 3.2.3-1
- Update to 3.2.3
- use phpunit7 on F28+
* Wed Dec 20 2017 Remi Collet <remi@remirepo.net> - 3.2.2-1
- Update to 3.2.2
* Mon Dec 18 2017 Remi Collet <remi@remirepo.net> - 3.2.1-1
- Update to 3.2.1
* Wed Dec 13 2017 Remi Collet <remi@remirepo.net> - 3.2.0-1
- Update to 3.2.0
* Tue Oct 17 2017 Remi Collet <remi@remirepo.net> - 3.1.1-1
- Update to 3.1.1
* Wed Sep 20 2017 Remi Collet <remi@remirepo.net> - 3.1.0-1
- Update to 3.1.0
- use phpunit6 on F26+
* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 3.0.2-1
- Update to 3.0.2
* Wed Jun 14 2017 Remi Collet <remi@remirepo.net> - 3.0.1-1
- Update to 3.0.1
* Thu May 4 2017 Remi Collet <remi@remirepo.net> - 3.0.0-1
- Update to 3.0.0
- raise dependency on PHP >= 5.4
- drop phpcs-svn-pre-commit command
* Thu Mar 02 2017 Remi Collet <remi@remirepo.net> - 2.8.1-1
- Update to 2.8.1
* Thu Feb 02 2017 Remi Collet <remi@fedoraproject.org> - 2.8.0-1
- Update to 2.8.0
* Wed Nov 30 2016 Remi Collet <remi@fedoraproject.org> - 2.7.1-1
- Update to 2.7.1
* Fri Sep 02 2016 Remi Collet <remi@fedoraproject.org> - 2.7.0-1
- Update to 2.7.0
* Mon Jul 18 2016 Remi Collet <remi@fedoraproject.org> - 2.6.2-1
- Update to 2.6.2
* Tue May 31 2016 Remi Collet <remi@fedoraproject.org> - 2.6.1-1
- Update to 2.6.1
* Mon Apr 04 2016 Remi Collet <remi@fedoraproject.org> - 2.6.0-1
- Update to 2.6.0
* Wed Jan 20 2016 Remi Collet <remi@fedoraproject.org> - 2.5.1-1
- Update to 2.5.1 (stable)
* Fri Dec 11 2015 Remi Collet <remi@fedoraproject.org> - 2.5.0-1
- Update to 2.5.0 (stable)
* Wed Nov 25 2015 Remi Collet <remi@fedoraproject.org> - 2.4.0-1
- Update to 2.4.0 (stable)
- run test suite with both PHP 5 and 7 when available
* Wed Sep 9 2015 Remi Collet <remi@fedoraproject.org> - 2.3.4-1
- Update to 2.3.4 (stable)
* Wed Jun 24 2015 Remi Collet <remi@fedoraproject.org> - 2.3.3-1
- Update to 2.3.3 (stable)
* Wed Apr 29 2015 Remi Collet <remi@fedoraproject.org> - 2.3.2-1
- Update to 2.3.2 (stable)
* Thu Apr 23 2015 Remi Collet <remi@fedoraproject.org> - 2.3.1-1
- Update to 2.3.1 (stable)
* Wed Mar 04 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
- Update to 2.3.0 (stable)
* Thu Jan 22 2015 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
- Update to 2.2.0 (stable)
* Thu Dec 18 2014 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
- Update to 2.1.0 (stable)
* Fri Dec 05 2014 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- Update to 2.0.0 (stable)
- add phpcbf and phpcs-svn-pre-commit commands
* Fri Sep 26 2014 Remi Collet <remi@fedoraproject.org> - 1.5.5-1
- Update to 1.5.5 (stable)
- provide php-composer(squizlabs/php_codesniffer)
* Mon Aug 11 2014 Remi Collet <remi@fedoraproject.org> - 1.5.4-1
- Update to 1.5.4 (stable)
* Sat May 03 2014 Remi Collet <remi@fedoraproject.org> - 1.5.3-1
- Update to 1.5.3 (stable)
* Tue Feb 11 2014 Remi Collet <remi@fedoraproject.org> - 1.5.2-1
- Update to 1.5.2 (stable)
* Thu Dec 12 2013 Remi Collet <remi@fedoraproject.org> - 1.5.1-1
- Update to 1.5.1 (stable)
* Thu Nov 28 2013 Remi Collet <remi@fedoraproject.org> - 1.5.0-1
- Update to 1.5.0 (stable)
* Tue Nov 26 2013 Remi Collet <remi@fedoraproject.org> - 1.4.8-1
- Update to 1.4.8 (stable)
- add explicity dependencies from phpcompatinfo report
* Thu Sep 26 2013 Remi Collet <remi@fedoraproject.org> - 1.4.7-1
- Update to 1.4.7
* Thu Jul 25 2013 Remi Collet <remi@fedoraproject.org> - 1.4.6-1
- Update to 1.4.6
* Thu Apr 04 2013 Remi Collet <remi@fedoraproject.org> - 1.4.5-1
- Update to 1.4.5
* Thu Feb 07 2013 Remi Collet <remi@fedoraproject.org> - 1.4.4-1
- Update to 1.4.4
* Tue Dec 4 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.4.3-1
- upstream 1.4.3
* Fri Nov 9 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.4.2-1
- upstream 1.4.2
* Fri Nov 2 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.4.1-1
- upstream 1.4.1
* Sun Oct 7 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.4.0-1
- upstream 1.4.0
* Sun Aug 19 2012 Remi Collet <remi@fedoraproject.org> - 1.3.6-1.2
- rebuilt for new pear_datadir
* Wed Aug 15 2012 Remi Collet <remi@fedoraproject.org> - 1.3.6-1.1
- rebuilt for new pear_testdir
* Tue Jul 17 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.6-1
- upstream 1.3.6
* Tue Jul 17 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.5-1
- upstream 1.3.5, backport for remi repo
* Fri Jul 13 2012 Christof Damian <christof@damian.net> - 1.3.5-1
- upstream 1.3.5
* Sun May 20 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.4-1
- upstream 1.3.4
* Sat May 19 2012 Christof Damian <christof@damian.net> - 1.3.4-1
- upstream 1.3.4
* Fri Mar 2 2012 Christof Damian <christof@damian.net> - 1.3.3-1
- upstream 1.3.3
* Thu Feb 23 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.3-1
- upstream 1.3.3
* Fri Nov 04 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.3.1-2
- run test suite in %%check
- remove license as not provided by upstream
* Fri Nov 04 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.3.1-1
- upstream 1.3.1, rebuild for remi repository
* Thu Nov 3 2011 Christof Damian <christof@damian.net> - 1.3.1-1
- upstream 1.3.1
* Thu Mar 24 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.3.0final-1
- rebuild for remi repository
* Fri Mar 18 2011 Christof Damian <christof@damian.net> - 1.3.0final-1
- fix my version foo until 1.3.1
* Fri Mar 18 2011 Christof Damian <christof@damian.net> - 1.3.0-1
- upstream 1.3.0 final
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3.RC1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Dec 5 2010 Remi Collet <RPMS@FamilleCollet.com> - 1.3.0-2.RC1
- rebuild for remi repository
* Sat Dec 4 2010 Christof Damian <christof@damian.net> - 1.3.0-2.RC1
- fix version number
- fix timezone warnings
* Fri Sep 3 2010 Christof Damian <christof@damian.net> - 1.3.0RC1-1
- upstream 1.3.0RC1
* Thu Jul 15 2010 Christof Damian <christof@damian.net> - 1.3.0a1-1
- upstream 1.3.0a1
* Fri Jan 29 2010 Remi Collet <RPMS@FamilleCollet.com> - 1.2.2-1
- rebuild for remi repository
* Wed Jan 27 2010 Christof Damian <christof@damian.net> 1.2.2-1
- upstream 1.2.2 ( bug:559170 )
- move phpcs into main package ( bug: 517775 )
- add php-common version requirement
* Wed Nov 18 2009 Remi Collet <RPMS@FamilleCollet.com> - 1.2.1-1
- rebuild for remi repository
* Tue Nov 17 2009 Christof Damian <christof@damian.net> - 1.2.1-1
- Upstream 1.2.1
* Sat Sep 26 2009 Remi Collet <RPMS@FamilleCollet.com> - 1.2.0-1
- rebuild for remi repository
* Sat Sep 19 2009 Christof Damian <christof@damian.net> - 1.2.0-1
- Upstream 1.2.0
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sun Jul 19 2009 Remi Collet <RPMS@FamilleCollet.com> - 1.1.0-1
- rebuild for remi repository
* Thu Mar 05 2009 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.1.0-1
- Belatedly update to 1.1.0 final.
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-0.2.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Jun 30 2008 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.1.0-0.1.RC2
- Upstream 1.1.0RC2
* Sun Feb 17 2008 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.0.1-1
- Upstream 1.0.1
- Move sample config into docs
* Fri Aug 17 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.8.0-1
- Upstream 0.8.0
* Mon Jun 11 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.7.0-1
- Upstream 0.7.0
- Drop Requirement on php-common (php-pear pulls that in)
* Mon Jun 11 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6.0-1
- Upstream 0.6.0
- Fix owner on phpcs
* Tue Apr 17 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.5.0-1
- Upstream 0.5.0
* Tue Feb 20 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.4.0-1
- Upstream 0.4.0
* Mon Jan 29 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.3.0-1
- Rename to php-pear-PHP-CodeSniffer
- Own all dirs we create
- Require php-common > 5.1.0
* Mon Jan 29 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.3.0-1
- Split phpcs into a separate package (so we don't require php-cli)
* Fri Jan 12 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.3.0-0.1
- Upstream 0.3.0
* Mon Oct 23 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.2.0-0.1
- Upstream 0.2.0
* Mon Sep 25 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.1.1-0.1
- Upstream update.
* Fri Sep 22 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.1.0-0.1
- Initial packaging.
|