blob: 1eedf8e5b824065c23d4af9c14adc3e1ca6071a7 (
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
|
# remirepo spec file for php-fedora-autoloader, from:
#
# Fedora spec file for php-fedora-autoloader
#
# Copyright (c) 2016-2021 Shawn Iwinski <shawn@iwin.ski>
# Remi Collet <remi@fedoraproject.org>
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#
%global github_owner php-fedora
%global github_name autoloader
%global github_version 1.0.1
%global github_commit 7cd61b5a927c8f446df8e820aa288434e18a7f0c
%global composer_vendor fedora
%global composer_project autoloader
# "php": ">= 5.3.3"
%global php_min_ver 5.3.3
# "theseer/autoload": "^1.22"
%global phpab_min_ver 1.22
%global phpab_max_ver 2.0
%if 0%{?fedora}
%bcond_without tests
%else
%bcond_with tests
%endif
%{!?phpdir: %global phpdir %{_datadir}/php}
%global phpab_template_dir %{phpdir}/TheSeer/Autoload/templates/ci
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
Release: 7%{?dist}
Summary: Fedora Autoloader
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
# Tests
%if %{with tests}
BuildRequires: php-cli
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
%global phpunit %{_bindir}/phpunit8
%else
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires:(php-composer(theseer/autoload) >= %{phpab_min_ver} with php-composer(theseer/autoload) < %{phpab_max_ver})
%else
BuildRequires: php-composer(theseer/autoload) < %{phpab_max_ver}
BuildRequires: php-composer(theseer/autoload) >= %{phpab_min_ver}
%endif
BuildRequires: php-pear
## phpcompatinfo (computed from version 1.0.1)
BuildRequires: php-ctype
BuildRequires: php-spl
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
# phpcompatinfo (computed from version 1.0.1)
Requires: php-ctype
Requires: php-spl
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%description
Static PSR-4 [1], PSR-0 [2], and classmap autoloader. Includes loader for
required and optional dependencies.
[1] http://www.php-fig.org/psr/psr-4/
[2] http://www.php-fig.org/psr/psr-0/
# ------------------------------------------------------------------------------
%package devel
Summary: %{name} devel
Requires: %{name} = %{version}-%{release}
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires:(php-composer(theseer/autoload) >= %{phpab_min_ver} with php-composer(theseer/autoload) < %{phpab_max_ver})
%else
Requires: php-composer(theseer/autoload) < %{phpab_max_ver}
Requires: php-composer(theseer/autoload) >= %{phpab_min_ver}
%endif
%description devel
Provides needed tools to build other packages:
- phpab fedora template
# ------------------------------------------------------------------------------
%prep
%setup -qn %{github_name}-%{github_commit}
: Set autoload path in phpab templates
sed "s#___AUTOLOAD_PATH___#'Fedora/Autoloader'#" \
res/phpab/fedora.php.tpl >res/phpab/fedora2.php.tpl
sed "s#___AUTOLOAD_PATH___#'%{phpdir}/Fedora/Autoloader'#" \
-i res/phpab/fedora.php.tpl
%build
# Empty build section, nothing to build
%install
: Main
mkdir -p %{buildroot}%{phpdir}/Fedora/Autoloader
cp -rp src/* %{buildroot}%{phpdir}/Fedora/Autoloader/
: Devel
mkdir -p %{buildroot}%{phpab_template_dir}
cp -p res/phpab/fedora*.php.tpl %{buildroot}%{phpab_template_dir}/
%check
%if %{with tests}
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
require '%{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php';
if (!class_exists('PHPUnit\\Framework\\TestCase')) {
class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\\Framework\\TestCase');
}
BOOTSTRAP
: Upstream tests
RETURN_CODE=0
for PHP_EXEC in "php %{phpunit}" php74 php80 php81; do
set $PHP_EXEC
if [ "php" == "$1" ] || which $PHP_EXEC; then
$1 -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \
${2:-%{_bindir}/phpunit8} \
--bootstrap bootstrap.php \
--verbose
fi
done
exit $RETURN_CODE
%else
: Tests skipped
%endif
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%dir %{phpdir}/Fedora
%{phpdir}/Fedora/Autoloader
%files devel
%doc *.md
%doc composer.json
%{phpab_template_dir}/fedora*.php.tpl
%changelog
* Mon Dec 6 2021 Remi Collet <remi@remirepo.net> - 1.0.1-7
- disable test suite on EL
* Mon Mar 8 2021 Remi Collet <remi@remirepo.net> - 1.0.1-5
- use range dependencies
- switch to phpunit8
* Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-2
- Add tests bootstrap to fix EPEL6 build
* Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-1
- Update to 1.0.1 (RHBZ #1802372)
* Tue Dec 4 2018 Remi Collet <remi@remirepo.net> - 1.0.0-5
- cleanup for EL-8
* Thu May 04 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1
- Update to 1.0.0
* Thu Mar 30 2017 Remi Collet <remi@remirepo.net> - 1.0.0-0.2.rc1
- use phpunit6 when available
* Tue Mar 28 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-0.1.rc1
- Update to 1.0.0-rc1
- Test with SCLs if available
- Add fedora2 template relying on include_path
* Fri Oct 28 2016 Shawn Iwinski <shawn@iwin.ski> - 0.2.1-2
- Do not install tests into buildroot
* Fri Oct 28 2016 Shawn Iwinski <shawn@iwin.ski> - 0.2.1-1
- Update to 0.2.1
- Remove applied patches that are included in 0.2.1
- Re-add custom include_path and bootstrap for tests
- Add php-cli build dependency
* Thu Oct 27 2016 Shawn Iwinski <shawn@iwin.ski> - 0.2.0-5
- Add upstream patch "Remove self-autoload constant and prepend
self-autoload PSR-4 register"
- Remove custom include_path and bootstrap for tests
* Thu Oct 27 2016 Remi Collet <remi@fedoraproject.org> - 0.2.0-4
- workaround when not in global autoloader
* Wed Oct 26 2016 Shawn Iwinski <shawn@iwin.ski> - 0.2.0-3
- Update to 0.2.0
- Remove applied patches that are included in 0.2.0
* Tue Oct 25 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-3
- rename 1 method to avoid conflicts with symfony
* Sat Oct 22 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-2
- ensure we use newly installed autoloader in buildroot
* Fri Oct 21 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-1
- update to 0.1.2
* Fri Oct 21 2016 Remi Collet <remi@remirepo.net> - 0.1.1-2
- test build for PR #6
* Thu Oct 20 2016 Remi Collet <remi@remirepo.net> - 0.1.1-1
- add backport stuff
* Wed Oct 19 2016 Shawn Iwinski <shawn@iwin.ski> - 0.1.1-1
- Update to 0.1.1
- Fix phpab template
- Move docs to devel subpackage
* Wed Oct 19 2016 Shawn Iwinski <shawn@iwin.ski> - 0.1.0-1
- Initial package
|