summaryrefslogtreecommitdiffstats
path: root/php-theseer-autoload.spec
blob: bd1bd1dd5186ffda345e73c5f34cc2ac4774756a (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
# remirepo/fedora spec file for php-theseer-autoload
#
# Copyright (c) 2014-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

# For compatibility with SCL
%undefine __brp_mangle_shebangs

%global gh_commit    6ac38edd83856019e70d1c904a2450c8e042ad28
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner     theseer
%global gh_project   Autoload
%global php_home     %{_datadir}/php/TheSeer
%global pear_name    Autoload
%global pear_channel pear.netpirates.net

%if 0%{?fedora}
%bcond_without  tests
%else
%bcond_with     tests
%endif

Name:           php-theseer-autoload
Version:        1.29.2
Release:        1%{?dist}
Summary:        A tool and library to generate autoload code

License:        BSD-3-Clause
URL:            https://github.com/%{gh_owner}/%{gh_project}
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{?gh_short}.tar.gz

# Autoloader path
Patch0:         %{gh_project}-rpm.patch

BuildArch:      noarch
BuildRequires:  php(language) >= 7.4
BuildRequires:  php-cli
BuildRequires:  php-date
BuildRequires:  php-json
BuildRequires:  php-openssl
BuildRequires:  php-phar
BuildRequires:  php-spl
BuildRequires:  php-tokenizer
BuildRequires: (php-composer(theseer/directoryscanner)     >= 1.3.2 with php-composer(theseer/directoryscanner)     < 2)
BuildRequires: (php-composer(zetacomponents/console-tools) >= 1.7   with php-composer(zetacomponents/console-tools) < 2)
%if %{with tests}
%global phpunit %{_bindir}/phpunit9
BuildRequires:  %{phpunit}
%endif

# From composer.json, "require": {
#        "php": ">=5.3",
#        "ext-openssl": "*",
#        "theseer/directoryscanner": "^1.3.3",
#        "zetacomponents/console-tools": "^1.7.2"
Requires:       php(language) >= 5.3.1
Requires:       php-openssl
Requires:      (php-composer(theseer/directoryscanner)     >= 1.3.2 with php-composer(theseer/directoryscanner)     < 2)
Requires:      (php-composer(zetacomponents/console-tools) >= 1.7   with php-composer(zetacomponents/console-tools) < 2)
# From phpcompatinfo report for version 1.25.0
Requires:       php-cli
Requires:       php-date
Requires:       php-json
Requires:       php-phar
Requires:       php-spl
Requires:       php-tokenizer
# Optional xdebug

Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides:       php-composer(theseer/autoload) = %{version}


%description
The PHP AutoloadBuilder CLI tool phpab is a command line application
to automate the process of generating an autoload require file with
the option of creating static require lists as well as phar archives.


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

%patch -P0 -p0 -b .rpm

: drop composer dependencies
sed -e '\:../vendor/:d'    -i src/autoload.php

: add package dependencies
cat <<EOF | tee            -a src/autoload.php
// Dependencies
require '/usr/share/php/TheSeer/DirectoryScanner/autoload.php';
require '/usr/share/php/ezc/Base/base.php';
spl_autoload_register(array('\\ezcBase','autoload'));
EOF

# set version
sed -e 's/@VERSION@/%{version}/' -i phpab.php


%build
# Empty build section, most likely nothing required.


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

install -Dpm 0755 phpab.php %{buildroot}%{_bindir}/phpab


%check
: Check version
sed -e 's:%{php_home}:%{buildroot}%{php_home}:' phpab.php >t.php
php t.php --version | grep %{version}
php t.php --output foo.php src

%if %{with tests}
: Fix test suite to use installed library
cat <<EOF | tee tests/init.php
<?php
require '%{buildroot}%{_datadir}/php/TheSeer/Autoload/autoload.php';
EOF

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


%pre
if [ -x %{_bindir}/pear ]; then
  %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
      %{pear_channel}/%{pear_name} >/dev/null || :
fi


%files
%license LICENSE
%doc README.md composer.json
%{php_home}/%{gh_project}
%{_bindir}/phpab


%changelog
* Mon Oct  7 2024 Remi Collet <remi@remirepo.net> - 1.29.2-1
- update to 1.29.2

* Thu May  2 2024 Remi Collet <remi@remirepo.net> - 1.29.1-1
- update to 1.29.1

* Tue Sep 19 2023 Remi Collet <remi@remirepo.net> - 1.29.0-1
- update to 1.29.0

* Wed Jun 14 2023 Remi Collet <remi@remirepo.net> - 1.28.0-1
- update to 1.28.0

* Fri Feb 17 2023 Remi Collet <remi@remirepo.net> - 1.27.2-1
- update to 1.27.2

* Wed Jan 26 2022 Remi Collet <remi@remirepo.net> - 1.27.1-1
- update to 1.27.1

* Mon Jan 24 2022 Remi Collet <remi@remirepo.net> - 1.27.0-1
- update to 1.27.0

* Mon Dec  6 2021 Remi Collet <remi@remirepo.net> - 1.26.3-2
- disable test suite on EL

* Mon Jul 26 2021 Remi Collet <remi@remirepo.net> - 1.26.3-1
- update to 1.26.3 (no change)
- raise dependency on theseer/directoryscanner 1.3.3
- raise dependency on zetacomponents/console-tools 1.7.2

* Tue Jun 15 2021 Remi Collet <remi@remirepo.net> - 1.26.1-1
- update to 1.26.1

* Wed Oct 28 2020 Remi Collet <remi@remirepo.net> - 1.26.0-1
- update to 1.26.0
- drop patch merged upstream

* Tue Oct 27 2020 Remi Collet <remi@remirepo.net> - 1.25.9-3
- add upstream patch for PHP 8
- add patch for Xdebug 3 from
  https://github.com/theseer/Autoload/pull/97

* Fri Mar 20 2020 Remi Collet <remi@remirepo.net> - 1.25.9-1
- update to 1.25.9

* Mon Nov 25 2019 Remi Collet <remi@remirepo.net> - 1.25.8-1
- update to 1.25.8

* Fri Nov 15 2019 Remi Collet <remi@remirepo.net> - 1.25.7-1
- update to 1.25.7

* Thu May 16 2019 Remi Collet <remi@remirepo.net> - 1.25.6-1
- update to 1.25.6

* Thu Apr 25 2019 Remi Collet <remi@remirepo.net> - 1.25.5-1
- update to 1.25.5
- drop patch merged upstream

* Wed Apr 24 2019 Remi Collet <remi@remirepo.net> - 1.25.4-2
- add patch for PHP 5.3 from
  https://github.com/theseer/Autoload/pull/86

* Fri Apr 19 2019 Remi Collet <remi@remirepo.net> - 1.25.4-1
- update to 1.25.4

* Mon Feb 11 2019 Remi Collet <remi@remirepo.net> - 1.25.3-1
- update to 1.25.3

* Mon Feb  4 2019 Remi Collet <remi@remirepo.net> - 1.25.2-1
- update to 1.25.2

* Sat Oct 20 2018 Remi Collet <remi@remirepo.net> - 1.25.1-1
- update to 1.25.1
- drop patch merged upstream

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

* Mon Jul  2 2018 Remi Collet <remi@remirepo.net> - 1.25.0-1
- update to 1.25.0
- use range dependencies

* Mon Jun 26 2017 Remi Collet <remi@remirepo.net> - 1.24.1-1
- Update to 1.24.1
- drop patch merged upstream

* Mon Jun 26 2017 Remi Collet <remi@remirepo.net> - 1.24.0-1
- Update to 1.24.0
- use phpunit6 on F26+
- add patch for PHP 5.3 in EL-6 from
  https://github.com/theseer/Autoload/pull/78

* Wed Dec 21 2016 Remi Collet <remi@fedoraproject.org> - 1.23.0-1
- update to 1.23.0

* Sat Aug 13 2016 Remi Collet <remi@fedoraproject.org> - 1.22.0-1
- update to 1.22.0

* Wed Nov 11 2015 Remi Collet <remi@fedoraproject.org> - 1.21.0-1
- update to 1.21.0

* Sun Oct  4 2015 Remi Collet <remi@fedoraproject.org> - 1.20.3-1
- update to 1.20.3

* Sun Oct  4 2015 Remi Collet <remi@fedoraproject.org> - 1.20.2-1
- update to 1.20.2

* Sat Oct  3 2015 Remi Collet <remi@fedoraproject.org> - 1.20.1-1
- update to 1.20.1

* Sat Jul 25 2015 Remi Collet <remi@fedoraproject.org> - 1.20.0-1
- update to 1.20.0

* Tue Jul 14 2015 Remi Collet <remi@fedoraproject.org> - 1.19.2-1
- update to 1.19.2

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

* Thu Jul  2 2015 Remi Collet <remi@fedoraproject.org> - 1.19.0-1
- update to 1.19.0

* Wed Jul  1 2015 Remi Collet <remi@fedoraproject.org> - 1.18.0-1
- update to 1.18.0
- load dependencies in the autoloader (not in the command)

* Thu Jun  4 2015 Remi Collet <remi@fedoraproject.org> - 1.17.0-3
- missing dependency on php-cli

* Wed Jun  3 2015 Remi Collet <remi@fedoraproject.org> - 1.17.0-2
- swicth from eZ to Zeta Components
- ensure compatibility with SCL

* Fri May 15 2015 Remi Collet <remi@fedoraproject.org> - 1.17.0-1
- Update to 1.17.0

* Tue Nov 25 2014 Remi Collet <remi@fedoraproject.org> - 1.16.2-1
- Update to 1.16.2

* Tue Nov 25 2014 Remi Collet <remi@fedoraproject.org> - 1.16.1-1
- Update to 1.16.1
- switch from pear to github sources

* Wed Nov 12 2014 Remi Collet <remi@fedoraproject.org> - 1.16.0-2
- define date.timezone in phpab command to avoid warning

* Tue Sep 02 2014 Remi Collet <remi@fedoraproject.org> - 1.16.0-1
- Update to 1.16.0

* Thu Aug 14 2014 Remi Collet <remi@fedoraproject.org> - 1.15.1-1
- Update to 1.15.1

* Tue Aug 12 2014 Remi Collet <remi@fedoraproject.org> - 1.15.0-1
- Update to 1.15.0

* Thu Apr 24 2014 Remi Collet <remi@fedoraproject.org> - 1.14.2-1
- Update to 1.14.2

* Sun Apr  6 2014 Remi Collet <remi@fedoraproject.org> - 1.14.1-1
- initial package, version 1.14.1