summaryrefslogtreecommitdiffstats
path: root/php-phpunit-phploc.spec
blob: 74bdd26c021967179f402011336da814992a13bf (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
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
# remirepo/fedora spec file for php-phpunit-phploc
#
# Copyright (c) 2009-2020 Guillaume Kulakowski, Christof Damian, Remi Collet
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#

%bcond_without tests

# For compatibility with SCL
%undefine __brp_mangle_shebangs

%global gh_commit    af0d5fc84f3f7725513ba59cdcbe670ac2a4532a
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     sebastianbergmann
%global gh_project   phploc
%global php_home     %{_datadir}/php
%global pear_name    phploc
%global pear_channel pear.phpunit.de
# Namespace
%global ns_vendor    SebastianBergmann
%global ns_project   PHPLOC

Name:           php-phpunit-phploc
Version:        7.0.2
Release:        1%{?dist}
Summary:        A tool for quickly measuring the size of a PHP project

License:        BSD
URL:            https://github.com/%{gh_owner}/%{gh_project}
Source0:        %{name}-%{version}-%{gh_short}.tgz
Source1:        makesrc.sh

# Fix for RPM, use autoload
Patch0:         %{gh_project}-rpm.patch

BuildArch:      noarch
BuildRequires:  php(language) >= 7.3
BuildRequires:  php-fedora-autoloader-devel
%if %{with tests}
BuildRequires:  php-dom
BuildRequires:  php-json
BuildRequires:  php-spl
BuildRequires:  php-tokenizer
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires:  (php-composer(sebastian/cli-parser)      >= 1.0   with php-composer(sebastian/cli-parser)      < 2)
BuildRequires:  (php-composer(sebastian/version)         >= 3.0   with php-composer(sebastian/version)         < 4)
BuildRequires:  (php-composer(phpunit/php-file-iterator) >= 3.0   with php-composer(phpunit/php-file-iterator) < 4)
# remirepo:5
%else
BuildRequires:  php-sebastian-cli-parser
BuildRequires:  php-sebastian-version3
BuildRequires:  php-phpunit-php-file-iterator3
%endif
%global phpunit %{_bindir}/phpunit9
BuildRequires: %{phpunit}
%endif

# From composer.json, "require": {
#        "php": ">=7.3",
#        "ext-dom": "*",
#        "ext-json": "*",
#        "sebastian/finder-facade": "^2.0",
#        "sebastian/version": "^3.0",
#        "symfony/console": "^4.0 || ^5.0"
Requires:       php(language) >= 7.3
Requires:       php-cli
Requires:       php-dom
Requires:       php-json
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires:       (php-composer(sebastian/cli-parser)      >= 1.0   with php-composer(sebastian/cli-parser)      < 2)
Requires:       (php-composer(sebastian/version)         >= 3.0   with php-composer(sebastian/version)         < 4)
Requires:       (php-composer(phpunit/php-file-iterator) >= 3.0   with php-composer(phpunit/php-file-iterator) < 4)
# remirepo:5
%else
Requires:       php-sebastian-cli-parser
Requires:       php-sebastian-version3
Requires:       php-phpunit-php-file-iterator3
%endif
# From phpcompatinfo report for version 7.0.0
Requires:       php-spl
Requires:       php-tokenizer
# For our autoloader
Requires:       php-composer(fedora/autoloader)

Provides:       php-composer(phploc/phploc) = %{version}
# For compat
Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides:       phploc = %{version}


%description
phploc is a tool for quickly measuring the size of a PHP project.

The goal of phploc is not not to replace more sophisticated tools such as phpcs,
pdepend, or phpmd, but rather to provide an alternative to them when you just
need to get a quick understanding of a project's size.


%prep
%setup -q -n %{gh_project}-%{gh_commit}

%patch0 -p1 -b .rpm


%build
%{_bindir}/phpab \
  --output   src/autoload.php \
  --template fedora \
  src

cat << 'EOF' | tee -a src/autoload.php

\Fedora\Autoloader\Dependencies::required([
    '%{php_home}/%{ns_vendor}/CliParser/autoload.php',
    '%{php_home}/%{ns_vendor}/FileIterator3/autoload.php',
    '%{php_home}/%{ns_vendor}/Version3/autoload.php',
]);
EOF


%install
mkdir -p   %{buildroot}%{php_home}/%{ns_vendor}
cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}

install -D -p -m 755 phploc %{buildroot}%{_bindir}/phploc


%if %{with tests}
%check
mkdir vendor
ln -s %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php vendor/autoload.php

ret=0
for cmd in "php %{phpunit}" php73 php74 php80; do
  if which $cmd; then
    set $cmd
    $1 ${2:-%{_bindir}/phpunit9} \
      --verbose || ret=1
  fi
done
exit $ret
%endif


%post
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 README.md
%doc composer.json
%{php_home}/%{ns_vendor}/%{ns_project}
%{_bindir}/phploc


%changelog
* Mon Dec  7 2020 Remi Collet <remi@remirepo.net> - 7.0.2-1
- update to 7.0.2

* Tue Aug 18 2020 Remi Collet <remi@remirepo.net> - 7.0.1-1
- update to 7.0.1

* Thu Aug 13 2020 Remi Collet <remi@remirepo.net> - 7.0.0-1
- update to 7.0.0
- sources from git snapshot
- add dependency on sebastian/cli-parser
- add dependency on phpunit/php-file-iterator
- drop depency on sebastian/finder-facade
- drop depency on symfony/console

* Fri Feb 28 2020 Remi Collet <remi@remirepo.net> - 6.0.2-1
- update to 6.0.2

* Thu Feb 27 2020 Remi Collet <remi@remirepo.net> - 6.0.1-1
- update to 6.0.1

* Thu Feb 20 2020 Remi Collet <remi@remirepo.net> - 6.0.0-1
- update to 6.0.0
- raise depency on PHP 7.3
- raise depency on sebastian/finder-facade 2
- raise depency on sebastian/version 3
- allow symfony 5

* Sun Mar 17 2019 Remi Collet <remi@remirepo.net> - 5.0.0-1
- update to 5.0.0
- raise dependency on PHP 7.2
- add dependency on php-json
- only allow Symfony 4
- use phpunit8 for upstream test suite

* Mon Oct 15 2018 Remi Collet <remi@remirepo.net> - 4.0.1-4
- add patch for PHP 7.3

* Tue Feb  6 2018 Remi Collet <remi@remirepo.net> - 4.0.1-2
- use range dependencies on F27+
- undefine __brp_mangle_shebangs

* Sun Nov 19 2017 Remi Collet <remi@remirepo.net> - 4.0.1-1
- Update to 4.0.1
- allow Symfony 4

* Wed Jun  7 2017 Remi Collet <remi@remirepo.net> - 4.0.0-1
- Update to 4.0.0
- use phpunit6 when available
- drop dependency on sebastian/git
- raise dependency on sebastian/version 2.0

* Thu May 11 2017 Remi Collet <remi@remirepo.net> - 3.0.1-3
- switch to fedora/autoloader
- use Symfony 3 when available

* Tue Apr 26 2016 Remi Collet <remi@fedoraproject.org> - 3.0.1-1
- update to 3.0.1
- raise dependency on sebastian/git >= 2.1

* Mon Apr 18 2016 Remi Collet <remi@fedoraproject.org> - 3.0.0-2
- allow sebastian/version 2.0

* Wed Jan 13 2016 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
- raise minimal php version to 5.6
- raise dependency on PHPUnit ~5
- allow symfony 3

* Thu Oct 22 2015 Remi Collet <remi@fedoraproject.org> - 2.1.5-1
- update to 2.1.5
- simplify autoloader

* Tue Aug  4 2015 Remi Collet <remi@fedoraproject.org> - 2.1.4-1
- update to 2.1.4

* Mon Jun 29 2015 Remi Collet <remi@fedoraproject.org> - 2.1.3-2
- switch to $fedoraClassLoader autoloader

* Thu Jun  4 2015 Remi Collet <remi@fedoraproject.org> - 2.1.3-1
- update to 2.1.3
- improve autoloader
- lower minimal PHP version to 5.3.3
- fix license handling

* Tue May 26 2015 Remi Collet <remi@fedoraproject.org> - 2.1.2-1
- update to 2.1.2
- ensure compatibility with SCL

* Mon Apr 13 2015 Remi Collet <remi@fedoraproject.org> - 2.1.1-1
- update to 2.1.1

* Wed Mar 11 2015 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
- update to 2.1.0
- raise dependencies on sebastian/git 2.0, symfony/console 2.5
- raise minimal PHP version to 5.4

* Wed Jun 25 2014 Remi Collet <remi@fedoraproject.org> - 2.0.6-1
- update to 2.0.6
- composer dependencies

* Sat May  3 2014 Remi Collet <remi@fedoraproject.org> - 2.0.5-2
- fix scriptlet

* Sat May  3 2014 Remi Collet <remi@fedoraproject.org> - 2.0.5-1
- update to 2.0.5
- sources from github
- run test suite during build

* Wed Dec 18 2013 Remi Collet <remi@fedoraproject.org> - 2.0.4-1
- Update to 2.0.4

* Tue Nov 05 2013 Remi Collet <remi@fedoraproject.org> - 2.0.3-1
- Update to 2.0.3

* Sun Sep 08 2013 Remi Collet <remi@fedoraproject.org> - 2.0.2-1
- Update to 2.0.2

* Wed Aug 28 2013 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- Update to 2.0.0
- add requires symfony2/Console, phpunit/Git and phpunit/Version
- drop requires ezc/Console

* Mon Nov 12 2012 Remi Collet <remi@fedoraproject.org> - 1.7.4-1
- Version 1.7.4 (stable) - API 1.7.0 (stable)

* Fri Nov  9 2012 Remi Collet <remi@fedoraproject.org> - 1.7.3-1
- Version 1.7.3 (stable) - API 1.7.0 (stable)

* Thu Oct 18 2012 Remi Collet <remi@fedoraproject.org> - 1.7.2-1
- Version 1.7.2 (stable) - API 1.7.0 (stable)

* Thu Oct 11 2012 Remi Collet <remi@fedoraproject.org> - 1.7.1-1
- Version 1.7.1 (stable) - API 1.7.0 (stable)
- use FinderFacade instead of File_Iterator
- raise dependecies: php >= 5.3.3

* Tue Nov 22 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.6.4-1
- upstream 1.6.4, rebuild for remi repository

* Sun Nov 20 2011 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.4-1
- upstream 1.6.4

* Thu Nov 03 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.6.2-1
- upstream 1.6.2, rebuild for remi repository

* Tue Nov  1 2011 Christof Damian <christof@damian.net> - 1.6.2-1
- upstream 1.6.2

* Sat Feb 12 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.6.1-1
- rebuild for remi repository

* Sat Feb 12 2011 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.1-1
- upstream 1.6.1

* Fri Feb 12 2010 Remi Collet <RPMS@FamilleCollet.com> - 1.5.1-1
- rebuild for remi repository

* Wed Feb 10 2010 Christof Damian <christof@damian.net> 1.5.1-1
- upstream 1.5.1
- changed requirements
- replaced define macros with global

* Sat Jan 16 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.5.0-2
- rebuild for remi repository

* Thu Jan 14 2010 Christof Damian <christof@damian.net> - 1.5.0-2
- add php 5.2.0 dependency
- remove hack to lower pear requirement

* Sun Jan  3 2010 Christof Damian <christof@damian.net> - 1.5.0-1
- upstream 1.5.0

* Fri Dec 18 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.4.0-2
- /usr/share/pear/PHPLOC wasn't owned

* Fri Dec 18 2009 Remi Collet <Fedora@FamilleCollet.com> - 1.4.0-1
- rebuild for remi repository

* Sat Dec 12 2009 Christof Damian <christof@damian.net> - 1.4.0-1
- upstream 1.4.0

* Wed Nov 11 2009 Remi Collet <Fedora@FamilleCollet.com> - 1.2.0-2
- rebuild for remi repository

* Sat Nov  7 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.2.0-2
- F-(10|11) compatibility

* Tue Oct 13 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.2.0-1
- Initial packaging