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
|
# remirepo spec file for php-silex, from Fedora:
#
# Fedora spec file for php-silex
#
# Copyright (c) 2015-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#
%global github_owner silexphp
%global github_name Silex
%global github_version 1.3.6
%global github_commit ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136
%global composer_vendor silex
%global composer_project silex
# "php": ">=5.3.9"
%global php_min_ver 5.3.9
# "doctrine/dbal": "~2.2"
# NOTE: Min version not 2.2 because autoloader required
%global doctrine_dbal_min_ver 2.5.4
%global doctrine_dbal_max_ver 3.0
# "monolog/monolog": "^1.4.1"
# NOTE: Min version not 1.4.1 because autoloader required
%global monolog_min_ver 1.15.0
%global monolog_max_ver 2.0.0
# "pimple/pimple": "~1.0"
%global pimple_min_ver 1.0
%global pimple_max_ver 2.0
# "swiftmailer/swiftmailer": "~5"
# NOTE: Min version not 5.0 because autoloader required
%global swiftmailer_min_ver 5.4.1
%global swiftmailer_max_ver 6.0
# "symfony/browser-kit": "~2.3|3.0.*"
# "symfony/config": "~2.3|3.0.*"
# "symfony/css-selector": "~2.3|3.0.*"
# "symfony/debug": "~2.3|3.0.*"
# "symfony/dom-crawler": "~2.3|3.0.*"
# "symfony/event-dispatcher": "~2.3|3.0.*"
# "symfony/finder": "~2.3|3.0.*"
# "symfony/form": "~2.3|3.0.*"
# "symfony/http-foundation": "~2.3|3.0.*"
# "symfony/http-kernel": "~2.3|3.0.*"
# "symfony/intl": "~2.3|3.0.*"
# "symfony/monolog-bridge": "~2.3|3.0.*"
# "symfony/options-resolver": "~2.3|3.0.*"
# "symfony/phpunit-bridge": "~2.7"
# "symfony/process": "~2.3|3.0.*"
# "symfony/routing": "~2.3|3.0.*"
# "symfony/security": "~2.3|3.0.*"
# "symfony/serializer": "~2.3|3.0.*"
# "symfony/translation": "~2.3|3.0.*"
# "symfony/twig-bridge": "~2.3|3.0.*"
# "symfony/validator": "~2.3|3.0.*"
# NOTE: Min version not 2.3 because autoloaders required
# NOTE: Max version not 3.1.0 to force version 2 so version 3
# can increase beyond version 3.1.0
%global symfony_min_ver 2.7.1
%global symfony_max_ver 3.0
# "twig/twig": "~1.28|~2.0"
%global twig_min_ver 1.28
%global twig_max_ver 3.0
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
%{!?phpdir: %global phpdir %{_datadir}/php}
Name: php-%{composer_project}
Version: %{github_version}
Release: 1%{dist}
Summary: PHP micro-framework based on the Symfony components
Group: Development/Libraries
License: MIT
URL: http://silex.sensiolabs.org
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
# Library version value check
BuildRequires: php-cli
# %%{pear_phpdir} macro
BuildRequires: php-pear
# Tests
%if %{with_tests}
BuildRequires: php-composer(phpunit/phpunit)
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(doctrine/dbal) < %{doctrine_dbal_max_ver}
BuildRequires: php-composer(doctrine/dbal) >= %{doctrine_dbal_min_ver}
BuildRequires: php-composer(monolog/monolog) < %{monolog_max_ver}
BuildRequires: php-composer(monolog/monolog) >= %{monolog_min_ver}
BuildRequires: php-composer(pimple/pimple) < %{pimple_max_ver}
BuildRequires: php-composer(pimple/pimple) >= %{pimple_min_ver}
BuildRequires: php-composer(swiftmailer/swiftmailer) < %{swiftmailer_max_ver}
BuildRequires: php-composer(swiftmailer/swiftmailer) >= %{swiftmailer_min_ver}
BuildRequires: php-composer(symfony/browser-kit) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/browser-kit) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/config) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/config) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/css-selector) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/css-selector) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/debug) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/debug) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/dom-crawler) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/dom-crawler) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/finder) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/finder) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/form) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/form) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/http-kernel) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/http-kernel) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/intl) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/intl) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/monolog-bridge) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/monolog-bridge) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/options-resolver) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/options-resolver) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/process) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/process) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/routing) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/routing) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/security) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/security) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/serializer) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/serializer) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/translation) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/translation) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/twig-bridge) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/twig-bridge) >= %{symfony_min_ver}
BuildRequires: php-composer(symfony/validator) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/validator) >= %{symfony_min_ver}
BuildRequires: php-composer(twig/twig) < %{twig_max_ver}
BuildRequires: php-composer(twig/twig) >= %{twig_min_ver}
## phpcompatinfo (computed from version 1.3.5)
BuildRequires: php-date
BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-session
BuildRequires: php-spl
BuildRequires: php-tokenizer
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
Requires: php-composer(pimple/pimple) >= %{pimple_min_ver}
Requires: php-composer(pimple/pimple) < %{pimple_max_ver}
Requires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver}
Requires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver}
Requires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
Requires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
Requires: php-composer(symfony/http-kernel) >= %{symfony_min_ver}
Requires: php-composer(symfony/http-kernel) < %{symfony_max_ver}
Requires: php-composer(symfony/routing) >= %{symfony_min_ver}
Requires: php-composer(symfony/routing) < %{symfony_max_ver}
# phpcompatinfo (computed from version 1.3.5)
Requires: php-date
Requires: php-pcre
Requires: php-reflection
Requires: php-session
Requires: php-spl
Requires: php-tokenizer
# Autoloader
Requires: php-composer(fedora/autoloader)
# Weak dependencies
%if 0%{?fedora} >= 21
Suggests: php-composer(doctrine/dbal)
Suggests: php-composer(monolog/monolog)
Suggests: php-composer(psr/log)
Suggests: php-composer(swiftmailer/swiftmailer)
Suggests: php-composer(symfony/browser-kit)
Suggests: php-composer(symfony/debug)
Suggests: php-composer(symfony/doctrine-bridge)
Suggests: php-composer(symfony/finder)
Suggests: php-composer(symfony/form)
Suggests: php-composer(symfony/intl)
Suggests: php-composer(symfony/monolog-bridge)
Suggests: php-composer(symfony/process)
Suggests: php-composer(symfony/security)
Suggests: php-composer(symfony/serializer)
Suggests: php-composer(symfony/translation)
Suggests: php-composer(symfony/twig-bridge)
Suggests: php-composer(symfony/validator)
Suggests: php-composer(twig/twig)
%endif
# php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}
Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%description
Silex is a PHP micro-framework. It is built on the shoulders of Symfony and
Pimple and also inspired by Sinatra.
A micro-framework provides the guts for building simple single-file apps. Silex
aims to be:
* Concise: Silex exposes an intuitive and concise API that is fun to use
* Extensible: Silex has an extension system based around the Pimple micro
service-container that makes it even easier to tie in third party libraries
* Testable: Silex uses Symfony's HttpKernel which abstracts requests and
responses. This makes it very easy to test apps and the framework itself.
It also respects the HTTP specification and encourages its' proper use.
Autoloader: %{phpdir}/Silex/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/Silex/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('Silex\\', __DIR__);
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Pimple1/autoload.php',
'%{phpdir}/Symfony/Component/EventDispatcher/autoload.php',
'%{phpdir}/Symfony/Component/HttpFoundation/autoload.php',
'%{phpdir}/Symfony/Component/HttpKernel/autoload.php',
'%{phpdir}/Symfony/Component/Routing/autoload.php',
));
\Fedora\Autoloader\Dependencies::optional(array(
'%{phpdir}/Doctrine/DBAL/autoload.php',
'%{phpdir}/Monolog/autoload.php',
'%{phpdir}/Psr/Log/autoload.php',
'%{phpdir}/Swift/swift_required.php',
'%{phpdir}/Symfony/Bridge/Doctrine/autoload.php',
'%{phpdir}/Symfony/Bridge/Monolog/autoload.php',
'%{phpdir}/Symfony/Bridge/Twig/autoload.php',
'%{phpdir}/Symfony/Component/BrowserKit/autoload.php',
'%{phpdir}/Symfony/Component/Debug/autoload.php',
'%{phpdir}/Symfony/Component/Finder/autoload.php',
'%{phpdir}/Symfony/Component/Form/autoload.php',
'%{phpdir}/Symfony/Component/Intl/autoload.php',
'%{phpdir}/Symfony/Component/Process/autoload.php',
'%{phpdir}/Symfony/Component/Security/autoload.php',
'%{phpdir}/Symfony/Component/Serializer/autoload.php',
'%{phpdir}/Symfony/Component/Translation/autoload.php',
'%{phpdir}/Symfony/Component/Validator/autoload.php',
array(
'%{phpdir}/Twig2/autoload.php',
'%{phpdir}/Twig/autoload.php',
),
));
AUTOLOAD
%install
mkdir -p %{buildroot}%{phpdir}
cp -rp src/* %{buildroot}%{phpdir}/
%check
: Library version value check
%{_bindir}/php -r '
require_once "%{buildroot}%{phpdir}/Silex/autoload.php";
$version = \Silex\Application::VERSION;
echo "Version $version (expected %{version})\n";
exit(version_compare("%{version}", "$version", "=") ? 0 : 1);
'
%if %{with_tests}
: Create test bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
require_once '%{buildroot}%{phpdir}/Silex/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Silex\\Tests\\', __DIR__.'/tests/Silex/Tests');
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Symfony/Component/Config/autoload.php',
'%{phpdir}/Symfony/Component/CssSelector/autoload.php',
'%{phpdir}/Symfony/Component/DomCrawler/autoload.php',
'%{phpdir}/Symfony/Component/OptionsResolver/autoload.php',
));
BOOTSTRAP
: Temporarily skip tests known to fail
rm -f \
tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php \
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
: Upstream tests
export RPM_SYMFONY_TREE=%{phpdir}/Symfony
RETURN_CODE=0
PHPUNIT=$(which phpunit)
for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
|| RETURN_CODE=1
fi
done
exit $RETURN_CODE
%else
: Tests skipped
%endif
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.rst
%doc composer.json
%doc doc
%{phpdir}/Silex
%changelog
* Tue May 30 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.6-1
- Update to 1.3.6 (RHBZ #1447040)
- Switch autoloader to php-composer(fedora/autoloader)
- Add max versions to build dependencies
- Test with SCLs if available
* Sat Jul 23 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.5-4
- Updated autoloader to not use "@include_once"
* Fri Apr 01 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.5-3
- Use actual package names (instead of virtual provides) for conflicts
* Wed Mar 30 2016 Remi Collet <remi@fedoraproject.org> - 1.3.5-2
- fix swiftmailer autoloader path
- run test suite with both PHP 5 and 7 when available
* Tue Mar 29 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.5-1
- Updated to 1.3.5 (RHBZ #1296756)
- Updated dependency versions for their autoloaders and updated autoloader
to use dependency autoloaders
- Added php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT} virtual provide
- php-swift-Swift => php-composer(swiftmailer/swiftmailer)
- Added weak dependencies
- Added library version value check
* Sun Oct 11 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.4-1
- Updated to 1.3.4 (RHBZ #1256774)
* Thu Aug 13 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.1-1
- Updated to 1.3.1 (RHBZ #1250055)
- Updated autoloader to load dependencies after self registration
* Mon Aug 10 2015 Remi Collet <remi@remirepo.net> - 1.3.1-1
- update to 1.3.1
* Fri Jul 03 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-1
- Updated to 1.3.0 (RHBZ #1238910)
* Fri Jul 03 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2.5-1
- Updated to 1.2.5 (RHBZ #1238910)
- Autoloader changed from phpab to Symfony ClassLoader
* Sun May 31 2015 Remi Collet <remi@remirepo.net> - 1.2.4-3
- backport in remi repository
* Wed May 20 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2.4-3
- "%%{phpdir}/Pimple" => "%%{phpdir}/Pimple1"
* Sun May 17 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2.4-2
- Fix php-composer(pimple/pimple) dependency
* Sat May 16 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2.4-1
- Initial package
|