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
|
# remirepo spec file for php-phpmd-PHP-PMD, from
#
# Fedora spec file for php-phpmd-PHP-PMD
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#
%global gh_commit dad0228156856b3ad959992f9748514fa943f3e3
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner phpmd
%global gh_project phpmd
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name PHP_PMD
%global pear_channel pear.phpmd.org
%global php_home %{_datadir}/php/PHPMD
%global with_tests 0%{!?_without_tests:1}
Name: php-phpmd-PHP-PMD
Version: 2.13.0
Release: 1%{?dist}
Summary: PHPMD - PHP Mess Detector
License: BSD
URL: http://phpmd.org/
# git snashop to get upstream test suite
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
# Autoloader
Patch0: %{name}-rpm.patch
BuildArch: noarch
%if %{with_tests}
# For tests
# From composer.json, "require-dev": {
# "phpunit/phpunit": "^4.8.36 || ^5.7.27",
# "squizlabs/php_codesniffer": "^2.0",
# "mikey179/vfsstream": "^1.6.4",
# "gregwar/rst": "^1.0",
# "ext-simplexml": "*",
# "ext-json": "*",
# "easy-doc/easy-doc": "0.0.0 || ^1.3.2"
BuildRequires: php-composer(phpunit/phpunit) >= 4.8.36
BuildRequires: php(language) >= 5.3.9
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(pdepend/pdepend) >= 2.12.1 with php-composer(pdepend/pdepend) < 3)
BuildRequires: (php-composer(composer/xdebug-handler) >= 1.0 with php-composer(composer/xdebug-handler) < 4)
BuildRequires: (php-composer(mikey179/vfsstream) >= 1.6.8 with php-composer(mikey179/vfsstream) < 2)
# remirepo:8
%else
BuildRequires: php-composer(pdepend/pdepend) < 3
BuildRequires: php-composer(pdepend/pdepend) >= 2.12.1
BuildRequires: php-composer(composer/xdebug-handler) < 4
BuildRequires: php-composer(composer/xdebug-handler) >= 1.0
BuildRequires: php-composer(mikey179/vfsstream) < 2
BuildRequires: php-composer(mikey179/vfsstream) >= 1.6.8
%endif
BuildRequires: php-reflection
BuildRequires: php-date
BuildRequires: php-json
BuildRequires: php-libxml
BuildRequires: php-pcre
BuildRequires: php-simplexml
BuildRequires: php-spl
# Autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
# "php": ">=5.3.9",
# "pdepend/pdepend": "^2.12.1",
# "ext-xml": "*",
# "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0"
Requires: php(language) >= 5.3.9
Requires: php-xml
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(pdepend/pdepend) >= 2.12.1 with php-composer(pdepend/pdepend) < 3)
Requires: (php-composer(composer/xdebug-handler) >= 1.0 with php-composer(composer/xdebug-handler) < 4)
# remirepo:6
%else
Requires: php-composer(pdepend/pdepend) < 3
Requires: php-composer(pdepend/pdepend) >= 2.12.1
Requires: php-composer(composer/xdebug-handler) < 4
Requires: php-composer(composer/xdebug-handler) >= 1.0
%endif
# From phpcompatinfo report for version 2.9.0
Requires: php-reflection
Requires: php-date
Requires: php-json
Requires: php-libxml
Requires: php-pcre
Requires: php-simplexml
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
# Single package in this channel
Obsoletes: php-channel-phpmd <= 1.3
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
%description
This is the project site of PHPMD. It is a spin-off project of PHP Depend
and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can
be seen as an user friendly front-end application for the raw metrics
stream measured by PHP Depend.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p0 -b .rpm
find . -name \*.rpm -delete
cat << 'EOF' | tee src/main/php/PHPMD/autoload.php
<?php
/* Autoloader for pdepend/pdepend and its dependencies */
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('PHPMD\\', __DIR__);
\Fedora\Autoloader\Dependencies::required([
'/usr/share/php/PDepend/autoload.php',
[
'/usr/share/php/Composer/XdebugHandler3/autoload.php',
'/usr/share/php/Composer/XdebugHandler2/autoload.php',
'/usr/share/php/Composer/XdebugHandler/autoload.php',
],
]);
EOF
find src/main/php -name \*php -exec sed -e 's:@package_version@:%{version}:' -i {} \;
find src/test -type f -exec sed -e 's:@package_version@:%{version}:' -i {} \;
sed -e '/project.version/s/2.8.1/%{version}/' -i build.properties
%build
# Empty build section, most likely nothing required.
%install
: Library
mkdir -p $(dirname %{buildroot}%{php_home})
cp -pr src/main/php/PHPMD %{buildroot}%{php_home}
: Resources
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr src/main/resources %{buildroot}%{_datadir}/%{name}/resources
: Command
install -Dpm 0755 src/bin/phpmd %{buildroot}%{_bindir}/phpmd
%check
%if %{with_tests}
cat << 'EOF' | tee src/test/php/bootstrap.php
<?php
require '%{buildroot}%{php_home}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('PHPMD\\', __DIR__ . '/PHPMD');
\Fedora\Autoloader\Dependencies::required([
'%{_datadir}/php/org/bovigo/vfs/autoload.php',
]);
EOF
ret=0
for cmd in php php74 php80 php81 php82; do
if which $cmd; then
$cmd %{_bindir}/phpunit --columns max --verbose || ret=1
fi
done
exit $ret
%else
: Test suite disabled
%endif
%pre
if [ -x %{_bindir}/pear ]; then
%{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
%{pear_channel}/%{pear_name} >/dev/null || :
fi
%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
%doc README.rst AUTHORS.rst
%doc CHANGELOG
%{php_home}
%{_datadir}/%{name}
%{_bindir}/phpmd
%changelog
* Mon Sep 12 2022 Remi Collet <remi@remirepo.net> - 2.13.0-1
- update to 2.13.0
- raise dependency on pdepend 2.12.1
* Mon Mar 28 2022 Remi Collet <remi@remirepo.net> - 2.12.0-1
- update to 2.12.0
- raise dependency on pdepend 2.10.2
- allow version 3.0 of the composer/xdebug-handler
* Mon Dec 20 2021 Remi Collet <remi@remirepo.net> - 2.11.1-1
- update to 2.11.1
* Tue Nov 30 2021 Remi Collet <remi@remirepo.net> - 2.11.0-1
- update to 2.11.0
- raise dependency on pdepend 2.10.2
* Thu Jul 22 2021 Remi Collet <remi@remirepo.net> - 2.10.2-1
- update to 2.10.2
- raise dependency on pdepend 2.10
* Wed May 12 2021 Remi Collet <remi@remirepo.net> - 2.10.1-1
- update to 2.10.1
- allow version 2.0 of the composer/xdebug-handler
* Thu Apr 29 2021 Remi Collet <remi@remirepo.net> - 2.10.0-1
- update to 2.10.0
- raise dependency on pdepend/pdepend version 2.9.1
* Thu Sep 24 2020 Remi Collet <remi@remirepo.net> - 2.9.1-1
- update to 2.9.1
* Wed Sep 2 2020 Remi Collet <remi@remirepo.net> - 2.9.0-1
- update to 2.9.0
* Tue Feb 25 2020 Remi Collet <remi@remirepo.net> - 2.8.2-1
- update to 2.8.2
- raise dependency on pdepend/pdepend version 2.7.1
* Tue Jan 7 2020 Remi Collet <remi@remirepo.net> - 2.8.1-1
- update to 2.8.1
- raise dependency on pdepend/pdepend version 2.6
- add dependency on composer/xdebug-handler
* Fri Aug 2 2019 Remi Collet <remi@remirepo.net> - 2.7.0-1
- update to 2.7.0
* Mon Jul 15 2019 Remi Collet <remi@remirepo.net> - 2.6.1-1
- update to 2.6.1
- use range dependencies
* Fri Jan 20 2017 Remi Collet <remi@fedoraproject.org> - 2.6.0-1
- update to 2.6.0
- raise dependency on pdepend/pdepend version 2.5
* Thu Nov 24 2016 Remi Collet <remi@fedoraproject.org> - 2.5.0-1
- update to 2.5.0
* Tue Nov 22 2016 Remi Collet <remi@fedoraproject.org> - 2.4.4-1
- update to 2.4.4
- raise dependency on PHP 5.3.9
- switch to fedora/autoloader
* Thu Apr 21 2016 Remi Collet <remi@fedoraproject.org> - 2.4.3-1
- update to 2.4.3
* Fri Mar 11 2016 Remi Collet <remi@fedoraproject.org> - 2.4.2-1
- update to 2.4.2
* Wed Mar 9 2016 Remi Collet <remi@fedoraproject.org> - 2.4.1-1
- update to 2.4.1
* Tue Mar 8 2016 Remi Collet <remi@fedoraproject.org> - 2.3.3-1
- update to 2.3.3
* Fri Sep 25 2015 Remi Collet <remi@fedoraproject.org> - 2.3.2-1
- update to 2.3.2
- drop dependency on symfony
* Tue Sep 22 2015 Remi Collet <remi@fedoraproject.org> - 2.3.1-1
- update to 2.3.1
* Tue Sep 22 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
- update to 2.3.0
* Thu Jul 2 2015 Remi Collet <remi@fedoraproject.org> - 2.2.3-1
- update to 2.2.3
- switch from pear channel to git snapshot sources
- run upstream test suite during build
* Fri Jul 26 2013 Remi Collet <remi@fedoraproject.org> - 1.5.0-1
- Update to 1.5.0
* Fri Dec 14 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.4.1-1
- upstream 1.4.1 for remi repo
- spec cleanups
* Sat Sep 8 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.4.0-1
- upstream 1.4.0
* Sat Mar 03 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.3-1
- upstream 1.3.3
* Tue Feb 28 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.2-1
- upstream 1.3.2
* Thu Feb 23 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.1-1
- upstream 1.3.1
* Sat Feb 11 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.3.0-1
- upstream 1.3.0, rebuild for remi repository
* Thu Feb 9 2012 Christof Damian <christof@damian.net> - 1.3.0-1
- upstream 1.3.0
* Tue Nov 01 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.0-1
- upstream 1.2.0, rebuild for remi repository
- doc in /usr/share/doc/pear
* Fri Oct 28 2011 Christof Damian <christof@damian.net> - 1.2.0-1
- upstream 1.2.0
* Sat Jul 16 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.1.1-1
- rebuild for remi repository
* Fri Jul 15 2011 Christof Damian <christof@damian.net> - 1.1.1-1
- upstream 1.1.1
* Fri Mar 25 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.1.0-1
- rebuild for remi repository
* Thu Mar 24 2011 Christof Damian <christof@damian.net> - 1.1.0-1
- upstream 1.1.0
* Wed Feb 16 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.0.1-1
- upstream 1.0.1 - bugfixes
- rebuild for remi repository
* Tue Feb 15 2011 Christof Damian <christof@damian.net> - 1.0.1-1
- upstream 1.0.1 - bugfixes
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Feb 07 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.0.0-1
- upstream stable release 1.0.0
- rebuild for remi repository
* Sun Feb 6 2011 Christof Damian <christof@damian.net> - 1.0.0-1
- upstream stable release 1.0.0
* Sun Oct 3 2010 Remi Collet <RPMS@FamilleCollet.com> - 0.2.7-1
- new upstream
- rebuild for remi repository
* Sat Oct 2 2010 Christof Damian <christof@damian.net> - 0.2.7-1
- new upstream
* Mon Jul 5 2010 Remi Collet <RPMS@FamilleCollet.com> - 0.2.6-1
- rebuild for remi repository
* Sun Jul 4 2010 Christof Damian <christof@damian.net> - 0.2.6-1
- upstream 0.2.6
* Mon Apr 5 2010 Remi Collet <RPMS@FamilleCollet.com> - 0.2.5-1
- rebuild for remi repository
* Sun Apr 4 2010 Christof Damian <christof@damian.net> - 0.2.5-1
- upsteam 0.2.5: bugfixes
* Tue Mar 9 2010 Remi Collet <RPMS@FamilleCollet.com> - 0.2.4-1
- rebuild for remi repository
* Tue Mar 9 2010 Christof Damian <christof@damian.net> - 0.2.4-1
- upstream 0.2.4 : Small bugfix release which closes an E_NOTICE issue introduced with release 0.2.3
* Sat Mar 6 2010 Remi Collet <RPMS@FamilleCollet.com> - 0.2.3-1
- rebuild for remi repository
* Thu Mar 4 2010 Christof Damian <christof@damian.net> - 0.2.3-1
- upstream 0.2.3
- increased php and pdepend requirements
* Mon Feb 01 2010 Remi Collet <RPMS@FamilleCollet.com> - 0.2.2-2
- rebuild for remi repository
* Sun Jan 31 2010 Christof Damian <christof@damian.net> - 0.2.2-2
- use pear_datadir in filesection
* Sat Jan 30 2010 Christof Damian <christof@damian.net> 0.2.2-1
- upstream 0.2.2
- changed define to global
- moved docs to /usr/share/doc
- use channel macro in postun
* Tue Jan 12 2010 Christof Damian <christof@damian.net> - 0.2.1-1
- upstream 0.2.1
* Fri Jan 1 2010 Christof Damian <christof@damian.net> 0.2.0-1
- initial release
|