blob: 045e987ab6d72580ec11dafed646fc9add92cada (
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
|
# remirepo spec file for php-ocramius-generated-hydrator, from:
#
# Fedora spec file for php-ocramius-generated-hydrator
#
# Copyright (c) 2014-2021 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#
# Outdated package, ignore test suite
%bcond_with tests
%global github_owner Ocramius
%global github_name GeneratedHydrator
%global github_version 2.2.0
%global github_commit 9b6b62db9959bec8fec88111e081e9456e36179f
%global composer_vendor ocramius
%global composer_project generated-hydrator
# "php": "~7.0"
%global php_min_ver 7.0
# "nikic/php-parser": "~2.0|~3.0"
%global php_parser_min_ver 2.0
%global php_parser_max_ver 4
# "ocramius/code-generator-utils": "~0.4"
%global ocramius_cgu_min_ver 0.4
%global ocramius_cgu_max_ver 1.0
# "zendframework/zend-hydrator": "^2.0"
%global zf_hydrator_min_ver 2.0
%global zf_hydrator_max_ver 3
%{!?phpdir: %global phpdir %{_datadir}/php}
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
Release: 5%{?github_release}%{?dist}
Summary: An object hydrator
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
%if %{with tests}
# composer.json
BuildRequires: php(language) >= %{php_min_ver}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(nikic/php-parser) >= %{php_parser_min_ver} with php-composer(nikic/php-parser) < %{php_parser_max_ver})
BuildRequires: (php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver} with php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver})
BuildRequires: (php-autoloader(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver} with php-autoloader(zendframework/zend-hydrator) < %{zf_hydrator_max_ver})
# remirepo:7
%else
BuildRequires: php-nikic-php-parser3 >= %{php_parser_min_ver}
BuildRequires: php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver}
BuildRequires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
BuildRequires: php-composer(zendframework/zend-hydrator) < %{zf_hydrator_max_ver}
BuildRequires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
%endif
BuildRequires: phpunit7
# phpcompatinfo (computed from version 2.2.0)
BuildRequires: php-date
BuildRequires: php-reflection
BuildRequires: php-spl
%endif
# Autoloader
BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(nikic/php-parser) >= %{php_parser_min_ver} with php-composer(nikic/php-parser) < %{php_parser_max_ver})
Requires: (php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver} with php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver})
Requires: (php-autoloader(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver} with php-autoloader(zendframework/zend-hydrator) < %{zf_hydrator_max_ver})
# remirepo:7
%else
Requires: php-nikic-php-parser3 >= %{php_parser_min_ver}
Requires: php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver}
Requires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
Requires: php-composer(zendframework/zend-hydrator) < %{zf_hydrator_max_ver}
Requires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
%endif
# phpcompatinfo (computed from version 2.2.0)
Requires: php-reflection
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%description
GeneratedHydrator is a library about high performance transition of data from
arrays to objects and from objects to arrays.
Autoloader: %{phpdir}/GeneratedHydrator/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/GeneratedHydrator/autoload.php
<?php
/**
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
*/
require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydrator\\', __DIR__);
\Fedora\Autoloader\Dependencies::required([
'%{phpdir}/CodeGenerationUtils/autoload.php',
[
'%{phpdir}/PhpParser3/autoload.php',
'%{phpdir}/PhpParser2/autoload.php',
],
'%{phpdir}/Zend/Hydrator/autoload.php',
]);
AUTOLOAD
%install
mkdir -p %{buildroot}%{phpdir}
cp -rp src/GeneratedHydrator %{buildroot}%{phpdir}/
%check
%if %{with tests}
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
require '%{buildroot}%{phpdir}/GeneratedHydrator/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydratorTest\\', __DIR__.'/tests/GeneratedHydratorTest');
\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydratorTestAsset\\', __DIR__.'/tests/GeneratedHydratorTestAsset');
BOOTSTRAP
: Upstream tests
RETURN_CODE=0
for PHP_EXEC in php php73 php74 php80; do
if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC %{_bindir}/phpunit7 --verbose --bootstrap bootstrap.php \
|| RETURN_CODE=1
fi
done
exit $RETURN_CODE
%else
: Tests skipped
%endif
%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%{phpdir}/GeneratedHydrator
%changelog
* Wed Mar 24 2021 Remi Collet <remi@remirepo.net> - 2.2.0-5
- disable tests
* Thu Aug 29 2019 Remi Collet <remi@remirepo.net> - 2.2.0-1
- update to 2.2.0
- use zendframework/zend-hydrator autoloader instead of framework one
- switch to phpunit6
* Thu Nov 29 2018 Remi Collet <remi@fedoraproject.org> - 2.1.0-6
- use range dependencies and fix FTBFS
* Mon Aug 7 2017 Remi Collet <remi@fedoraproject.org> - 2.1.0-2
- clean autoloader
* Sat Aug 05 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.1.0-1
- Update to 2.1.0 (RHBZ #1473994)
- Switch autoloader to php-composer(fedora/autoloader)
- Test with SCLs if available
* Mon Jan 23 2017 Remi Collet <remi@fedoraproject.org> - 2.0.0-3
- change BR order, fix FTBFS from Koschei
* Wed Oct 12 2016 Remi Collet <remi@fedoraproject.org> - 2.0.0-2
- switch symfony autoloader
* Wed Jun 29 2016 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- update to 2.0.0
- drop dependency on zendframework/zend-stdlib
- raise dependency on php ~7.0
- raise dependency on nikic/php-parser ~2.0
- raise dependency on ocramius/code-generator-utils 0.4.*
- add dependency on zendframework/zend-hydrator
- add simple autoloader
* Wed Feb 25 2015 Remi Collet <remi@fedoraproject.org> - 1.1.1-1
- update to 1.1.1 (no change)
- raise nikic/php-parser max version
* Sat Nov 29 2014 Remi Collet <rpms@famillecollet.com> - 1.1.0-1
- backport for remi repo
* Mon Oct 27 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1.0-1
- Initial package
|