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
|
# remirepo/fedora spec file for php-bartlett-php-compatinfo-db
#
# Copyright (c) 2015-2019 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# See https://github.com/llaville/php-compatinfo-db/releases
%global gh_commit b0a3e7f017a31ab176942b90f67b412fcf15aae3
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20151031
%global gh_owner llaville
%global gh_project php-compatinfo-db
%global upstream_version 2.2.0
#global upstream_prever RC1
# Namespace
%global ns_vendor Bartlett
%global ns_project CompatInfoDb
# Composer
%global c_vendor bartlett
%global c_project php-compatinfo-db
%global with_tests 0%{!?_without_tests:1}
Name: php-%{c_vendor}-%{c_project}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
%global specrel 1
Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
Summary: Reference Database to be used with php-compatinfo library
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz
# Fix autoloader path
# Fix sqlite database path
# Fix version and avoir jean85/pretty-package-versions (relying on composer.lock)
Patch0: %{name}-2.0-rpm.patch
# CURL_SSLVERSION constants have been backported
Patch1: %{name}-curltls.patch
BuildArch: noarch
# Needed to build the database from sources
BuildRequires: php(language) >= 7.1
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(composer/semver) >= 1.0 with php-composer(composer/semver) < 2)
BuildRequires: (php-composer(symfony/console) >= 3.0 with php-composer(symfony/console) < 5)
BuildRequires: (php-composer(league/tactician) >= 1.0 with php-composer(league/tactician) < 2)
BuildRequires: (php-composer(zendframework/zenddiagnostics) >= 1.3 with php-composer(zendframework/zenddiagnostics) < 2)
# remirepo:10
%else
BuildRequires: php-composer(composer/semver) < 2
BuildRequires: php-composer(composer/semver) >= 1.0
BuildRequires: php-composer(symfony/console) < 5
BuildRequires: php-composer(symfony/console) >= 3.0
BuildRequires: php-composer(league/tactician) < 2
BuildRequires: php-composer(league/tactician) >= 1.0
BuildRequires: php-composer(zendframework/zenddiagnostics) < 2
BuildRequires: php-composer(zendframework/zenddiagnostics) >= 1.3
%endif
BuildRequires: php-pdo
BuildRequires: php-reflection
BuildRequires: php-curl
BuildRequires: php-intl
BuildRequires: php-libxml
BuildRequires: php-openssl
BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-json
BuildRequires: php-pdo_sqlite
# For our patch / autoloader
BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require-dev": {
# "psr/log": "^1.0",
# "monolog/monolog": "^1.10",
# "bartlett/phpunit-loggertestlistener": "^2.0",
# "phpunit/php-timer": "^2.0"
BuildRequires: php-cli
%if %{with_tests}
BuildRequires: php-composer(phpunit/phpunit)
%endif
# From composer.json, "require"
# "php": "^7.1",
# "composer/semver": "^1.0",
# "ext-curl": "*",
# "ext-intl": "*",
# "ext-libxml": "*",
# "ext-openssl": "*",
# "ext-pcre": "*",
# "ext-spl": "*",
# "ext-json": "*",
# "ext-pdo_sqlite": "*",
# "symfony/console": "^3.0||^4.0",
# "jean85/pretty-package-versions": "^1.2",
# "league/tactician": "^1.0",
# "zendframework/zenddiagnostics": "^1.3"
Requires: php(language) >= 7.1
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(composer/semver) >= 1.0 with php-composer(composer/semver) < 2)
Requires: (php-composer(symfony/console) >= 3.0 with php-composer(symfony/console) < 5)
Requires: (php-composer(league/tactician) >= 1.0 with php-composer(league/tactician) < 2)
Requires: (php-composer(zendframework/zenddiagnostics) >= 1.3 with php-composer(zendframework/zenddiagnostics) < 2)
# remirepo:10
%else
Requires: php-composer(composer/semver) < 2
Requires: php-composer(composer/semver) >= 1.0
Requires: php-composer(symfony/console) < 5
Requires: php-composer(symfony/console) >= 3.0
Requires: php-composer(league/tactician) < 2
Requires: php-composer(league/tactician) >= 1.0
Requires: php-composer(zendframework/zenddiagnostics) < 2
Requires: php-composer(zendframework/zenddiagnostics) >= 1.3
%endif
Requires: php-pdo
Requires: php-reflection
Requires: php-curl
Requires: php-date
Requires: php-intl
Requires: php-json
Requires: php-libxml
Requires: php-openssl
Requires: php-pcre
Requires: php-spl
Requires: php-pdo_sqlite
# Required by autoloader
Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{c_vendor}/%{c_project}) = %{version}
# Extracted from bartlett/php-compatinfo 4
Conflicts: php-bartlett-PHP-CompatInfo < 5
%description
%{summary}.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
%patch1 -p0 -b .curltls
cat << 'EOF' | tee src/autoload.php
<?php
/**
* Autoloader %{name} and its dependencies
*/
require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\CompatInfoDb\\', __DIR__);
\Fedora\Autoloader\Dependencies::required(array(
'%{_datadir}/php/Composer/Semver/autoload.php',
[
'%{_datadir}/php/Symfony4/Component/Console/autoload.php',
'%{_datadir}/php/Symfony3/Component/Console/autoload.php',
],
'%{_datadir}/php/League/Tactician/autoload.php',
'%{_datadir}/php/ZendDiagnostics/autoload.php',
));
EOF
# Use package version
sed -e 's/@VERSION@/%{upstream_version}%{?upstream_prever}/' -i src/Presentation/Console/Application.php
# Cleanup patched files
find src -name \*rpm -delete -print
%build
: Ensure current version is known by reference
OPT=$(php -r '
require "src/autoload.php";
switch (PHP_MAJOR_VERSION . PHP_MINOR_VERSION) {
case "54":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_5_4;
break;
case "55":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_5_5;
break;
case "56":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_5_6;
break;
case "70":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_0;
break;
case "71":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_1;
break;
case "72":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_2;
break;
case "73":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_3;
break;
default:
exit(0);
}
if (version_compare(PHP_VERSION, $max, ">")) {
fputs(STDERR, "Current: " . PHP_VERSION . " > Known: $max\n\n");
echo "/LATEST_PHP_" . PHP_MAJOR_VERSION . "_" . PHP_MINOR_VERSION .
"/s/" . PHP_MAJOR_VERSION . "\." .PHP_MINOR_VERSION . "\.[0-9]*/" . PHP_VERSION . "/";
} else {
fputs(STDERR, "Current: " . PHP_VERSION . " = Known: $max\n\n");
}
')
if [ -n "$OPT" ]; then
sed -e "$OPT" -i src/ExtensionFactory.php
fi
grep " LATEST" src/ExtensionFactory.php
: Create command using local sources
sed -e "s:%{_datadir}/php/%{ns_vendor}/%{ns_project}:$PWD/src:" bin/compatinfo-db >compatinfo-db
: Diag
%{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db bartlett:diagnose
: Fix references database
%{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db bartlett:db:release:php
: Generate the references database
%{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db bartlett:db:init
%install
mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}
install -D -p -m 644 data/compatinfo.sqlite %{buildroot}%{_datadir}/%{name}/compatinfo.sqlite
install -D -p -m 755 bin/compatinfo-db %{buildroot}%{_bindir}/%{name}
%if %{with_tests}
%check
export BARTLETT_COMPATINFO_DB=%{buildroot}%{_datadir}/%{name}/compatinfo.sqlite
cat << 'EOF' | tee tests/bootstrap.php
<?php
require_once '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\Tests\\CompatInfoDb\\', __DIR__);
EOF
%{_bindir}/phpunit \
--include-path %{buildroot}%{_datadir}/php \
-d memory_limit=1G
%endif
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
%doc *.md
%{_bindir}/%{name}
%dir %{_datadir}/php/%{ns_vendor}
%{_datadir}/php/%{ns_vendor}/%{ns_project}
%{_datadir}/%{name}
%changelog
* Mon Mar 11 2019 Remi Collet <remi@remirepo.net> - 2.2.0-1
- update to 2.2.0
* Mon Feb 25 2019 Remi Collet <remi@remirepo.net> - 2.1.1-1
- update to 2.1.1
* Mon Jan 21 2019 Remi Collet <remi@remirepo.net> - 2.0.0-1
- update to 2.0.0
* Thu Jan 3 2019 Remi Collet <remi@remirepo.net> - 2.0.0~RC1-1
- update to 2.0.0RC1
- bump dependency on PHP 7.1
- add dependency on symfony/console 3 or 4
- add dependency on league/tactician
- add dependency on zendframework/zenddiagnostics
- add php-bartlett-php-compatinfo-db command
* Tue Dec 18 2018 Remi Collet <remi@remirepo.net> - 1.39.0-1
- update to 1.39.0
* Mon Nov 19 2018 Remi Collet <remi@remirepo.net> - 1.38.1-1
- update to 1.38.1 (no change)
* Tue Nov 13 2018 Remi Collet <remi@remirepo.net> - 1.38.0-1
- update to 1.38.0
* Fri Oct 12 2018 Remi Collet <remi@remirepo.net> - 1.37.0-1
- update to 1.37.0
- use symfony3
- ignore test failing because of symfony/polyfill
* Sun Oct 7 2018 Remi Collet <remi@remirepo.net> - 1.36.0-2
- update to 1.36.0
- raise dependency on PHP 5.5
- open https://github.com/llaville/php-compatinfo-db/issues/14 zip
- open https://github.com/llaville/php-compatinfo-db/issues/15 http
- open https://github.com/llaville/php-compatinfo-db/issues/16 redis
- open https://github.com/llaville/php-compatinfo-db/issues/17 uopz
- open https://github.com/llaville/php-compatinfo-db/issues/18 varnish
* Wed Aug 29 2018 Remi Collet <remi@remirepo.net> - 1.35.0-2
- update to 1.35.0
* Mon Jul 23 2018 Remi Collet <remi@remirepo.net> - 1.34.0-1
- update to 1.34.0
* Fri Jul 6 2018 Remi Collet <remi@remirepo.net> - 1.33.0-1
- update to 1.33.0
* Fri Apr 27 2018 Remi Collet <remi@remirepo.net> - 1.32.0-1
- update to 1.32.0
* Thu Apr 5 2018 Remi Collet <remi@remirepo.net> - 1.31.0-1
- update to 1.31.0
* Fri Mar 2 2018 Remi Collet <remi@remirepo.net> - 1.30.0-1
- Update to 1.30.0
* Fri Feb 2 2018 Remi Collet <remi@remirepo.net> - 1.29.0-1
- Update to 1.29.0
- use range dependency on F27+
* Tue Jan 9 2018 Remi Collet <remi@remirepo.net> - 1.28.0-1
- Update to 1.28.0
* Fri Jan 5 2018 Remi Collet <remi@remirepo.net> - 1.27.0-2
- enable test suite with 7.1
* Fri Jan 5 2018 Remi Collet <remi@remirepo.net> - 1.27.0-1
- Update to 1.27.0
* Fri Nov 24 2017 Remi Collet <remi@remirepo.net> - 1.26.0-1
- Update to 1.26.0
* Tue Oct 31 2017 Remi Collet <remi@remirepo.net> - 1.25.0-1
- Update to 1.25.0
* Tue Oct 3 2017 Remi Collet <remi@remirepo.net> - 1.24.0-1
- Update to 1.24.0
* Thu Sep 28 2017 Remi Collet <remi@remirepo.net> - 1.24.0~RC1-1
- Update to 1.24.0RC1
* Mon Jul 17 2017 Remi Collet <remi@remirepo.net> - 1.23.0-1
- Update to 1.23.0
* Sat Jun 10 2017 Remi Collet <remi@remirepo.net> - 1.22.0-1
- Update to 1.22.0
* Fri Jun 9 2017 Remi Collet <remi@remirepo.net> - 1.21.0-1
- Update to 1.21.0
* Fri Apr 14 2017 Remi Collet <remi@remirepo.net> - 1.20.0-1
- Update to 1.20.0
* Fri Mar 17 2017 Remi Collet <remi@remirepo.net> - 1.19.0-1
- Update to 1.19.0
- adapt patch fixing DB location
* Fri Feb 24 2017 Remi Collet <remi@fedoraproject.org> - 1.18.0-1
- update to 1.18.0
* Tue Jan 24 2017 Remi Collet <remi@fedoraproject.org> - 1.17.0-1
- update to 1.17.0
* Fri Dec 16 2016 Remi Collet <remi@fedoraproject.org> - 1.16.0-1
- update to 1.16.0
* Wed Nov 23 2016 Remi Collet <remi@fedoraproject.org> - 1.15.0-1
- update to 1.15.0
- disable test suite with PHP 7.1, not yet supported
https://github.com/llaville/php-compatinfo-db/issues/8
* Mon Oct 31 2016 Remi Collet <remi@fedoraproject.org> - 1.14.0-2
- switch to fedora/autoloader
* Sat Oct 15 2016 Remi Collet <remi@fedoraproject.org> - 1.14.0-1
- update to 1.14.0
* Tue Oct 4 2016 Remi Collet <remi@fedoraproject.org> - 1.13.0-1
- update to 1.13.0
* Tue Sep 27 2016 Remi Collet <remi@fedoraproject.org> - 1.12.0-1
- update to 1.12.0
* Tue Jul 26 2016 Remi Collet <remi@fedoraproject.org> - 1.11.0-1
- update to 1.11.0
* Tue Jul 5 2016 Remi Collet <remi@fedoraproject.org> - 1.10.0-1
- update to 1.10.0
* Sat May 28 2016 Remi Collet <remi@fedoraproject.org> - 1.9.0-1
- update to 1.9.0
* Tue May 3 2016 Remi Collet <remi@fedoraproject.org> - 1.8.1-1
- update to 1.8.1
* Tue May 3 2016 Remi Collet <remi@fedoraproject.org> - 1.8.0-1
- update to 1.8.0
- fix broken imagick references
https://github.com/llaville/php-compatinfo-db/issues/4
* Tue Apr 12 2016 Remi Collet <remi@fedoraproject.org> - 1.7.0-1
- update to 1.7.0
* Sat Mar 5 2016 Remi Collet <remi@fedoraproject.org> - 1.6.0-1
- update to 1.6.0
- use package version as version in database instead of date
* Sat Feb 6 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-1
- update to 1.5.0
* Sat Jan 9 2016 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
- update to 1.4.0
* Tue Dec 29 2015 Remi Collet <remi@fedoraproject.org> - 1.3.0-1
- update to 1.3.0
* Thu Dec 10 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-2
- fix reference to ensure current version is known
as we usually build RC version in rawhide.
* Sat Dec 5 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-1
- update to 1.2.0
- add dependency on composer/semver
* Wed Nov 4 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-0.1.alpha1
- Initial package
|