summaryrefslogtreecommitdiffstats
path: root/php-aws-sdk3.spec
blob: d4487c69e234910fb9e16b0b9dccdfcc62d61173 (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
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# remirepo spec file for php-aws-sdk3, from
#
# Fedora spec file for php-aws-sdk3
#
# Copyright (c) 2016-2017 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#

%global github_owner     aws
%global github_name      aws-sdk-php
%global github_version   3.21.6
%global github_commit    b51512a4ad4aa080ab963942a1e234265771fcde

%global composer_vendor  aws
%global composer_project aws-sdk-php

# "php": ">=5.5"
%global php_min_ver 5.5
# "andrewsville/php-token-reflection": "^1.4"
%global tokenreflection_min_ver 1.4
%global tokenreflection_max_ver 2.0
# "aws/aws-php-sns-message-validator": "~1.0"
%global aws_sns_message_validator_min_ver 1.0
%global aws_sns_message_validator_max_ver 2.0
# "doctrine/cache": "~1.4"
#     NOTE: Min version not 1.4 because autoloader required
%global doctrine_cache_min_ver 1.4.1
%global doctrine_cache_max_ver 2.0
# "guzzlehttp/guzzle": "^5.3.1|^6.2.1"
%global guzzle_min_ver 5.3.1
%global guzzle_max_ver 7.0
# "guzzlehttp/promises": "~1.0"
%global guzzle_promises_min_ver 1.0
%global guzzle_promises_max_ver 2.0
# "guzzlehttp/psr7": "~1.3.1"
#     NOTE: Keeping previous max of 2.0 instead of changing to 1.4
%global guzzle_psr7_min_ver 1.3.1
%global guzzle_psr7_max_ver 2.0
# "mtdowling/jmespath.php": "~2.2"
%global jmespath_min_ver 2.2
%global jmespath_max_ver 3.0
# "nette/neon": "^2.3"
%global nette_neon_min_ver 2.3
%global nette_neon_max_ver 3.0
# "psr/cache": "^1.0"
%global psr_cache_min_ver 1.0
%global psr_cache_max_ver 2.0

# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}

%{!?phpdir:  %global phpdir  %{_datadir}/php}

Name:          php-aws-sdk3
Version:       %{github_version}
Release:       1%{?dist}
Summary:       Amazon Web Services framework for PHP

Group:         Development/Libraries
License:       ASL 2.0
URL:           http://aws.amazon.com/sdkforphp

# GitHub export does not include tests.
# Run php-aws-sdk3-get-source.sh to create full source.
Source0:       %{name}-%{github_version}-%{github_commit}.tar.gz
Source1:       %{name}-get-source.sh

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:     noarch
# Library version value and autoloader check
BuildRequires: php-cli                              >= %{php_min_ver}
BuildRequires: php-composer(guzzlehttp/guzzle)      >= 6
BuildRequires: php-composer(guzzlehttp/promises)    >= %{guzzle_promises_min_ver}
BuildRequires: php-composer(guzzlehttp/psr7)        >= %{guzzle_psr7_min_ver}
BuildRequires: php-composer(mtdowling/jmespath.php) >= %{jmespath_min_ver}
BuildRequires: php-composer(fedora/autoloader)
# Tests
%if %{with_tests}
## Classmap
BuildRequires: php-composer(theseer/autoload)
## composer.json
BuildRequires: php-composer(andrewsville/php-token-reflection) >= %{tokenreflection_min_ver}
BuildRequires: php-composer(aws/aws-php-sns-message-validator) >= %{aws_sns_message_validator_min_ver}
BuildRequires: php-composer(doctrine/cache)                    >= %{doctrine_cache_min_ver}
BuildRequires: php-composer(nette/neon)                        >= %{nette_neon_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
BuildRequires: php-composer(psr/cache)                         >= %{psr_cache_min_ver}
BuildRequires: php-dom
BuildRequires: php-json
BuildRequires: php-openssl
BuildRequires: php-pcre
BuildRequires: php-simplexml
BuildRequires: php-spl
## phpcompatinfo (computed from version 3.21.0)
BuildRequires: php-curl
BuildRequires: php-date
BuildRequires: php-filter
BuildRequires: php-hash
BuildRequires: php-libxml
BuildRequires: php-reflection
BuildRequires: php-session
BuildRequires: php-xml
BuildRequires: php-xmlwriter
%endif

# composer.json
Requires:      php(language)                        >= %{php_min_ver}
Requires:      php-composer(guzzlehttp/guzzle)      <  %{guzzle_max_ver}
Requires:      php-composer(guzzlehttp/guzzle)      >= %{guzzle_min_ver}
Requires:      php-composer(guzzlehttp/promises)    <  %{guzzle_promises_max_ver}
Requires:      php-composer(guzzlehttp/promises)    >= %{guzzle_promises_min_ver}
Requires:      php-composer(guzzlehttp/psr7)        <  %{guzzle_psr7_max_ver}
Requires:      php-composer(guzzlehttp/psr7)        >= %{guzzle_psr7_min_ver}
Requires:      php-composer(mtdowling/jmespath.php) <  %{jmespath_max_ver}
Requires:      php-composer(mtdowling/jmespath.php) >= %{jmespath_min_ver}
# phpcompatinfo (computed from version 3.21.0)
Requires:      php-date
Requires:      php-filter
Requires:      php-hash
Requires:      php-json
Requires:      php-libxml
Requires:      php-pcre
Requires:      php-session
Requires:      php-simplexml
Requires:      php-spl
Requires:      php-xmlwriter
# Autoloader
Requires:      php-composer(fedora/autoloader)

# Weak dependencies
## composer.json: optional
%if 0%{?fedora} >= 21
Suggests:      php-curl
Suggests:      php-openssl
Suggests:      php-composer(doctrine/cache)
Conflicts:     php-doctrine-cache <  %{doctrine_cache_min_ver}
Conflicts:     php-doctrine-cache >= %{doctrine_cache_max_ver}
Suggests:      php-composer(aws/aws-php-sns-message-validator)
Conflicts:     php-aws-php-sns-message-validator <  %{aws_sns_message_validator_min_ver}
Conflicts:     php-aws-php-sns-message-validator >= %{aws_sns_message_validator_max_ver}
%endif

# Composer
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}

%description
The AWS SDK for PHP makes it easy for developers to access Amazon Web
Services [1] in their PHP code, and build robust applications and software
using services like Amazon S3, Amazon DynamoDB, Amazon Glacier, etc.

Autoloader: %{phpdir}/Aws3/autoload.php

[1] http://aws.amazon.com/


%prep
%setup -qn %{github_name}-%{github_commit}


%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/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('Aws\\', __DIR__);

\Fedora\Autoloader\Dependencies::required([
    __DIR__.'/functions.php',
    [
        '%{phpdir}/GuzzleHttp6/autoload.php',
        '%{phpdir}/GuzzleHttp/autoload.php',
    ],
    '%{phpdir}/GuzzleHttp/Promise/autoload.php',
    '%{phpdir}/GuzzleHttp/Psr7/autoload.php',
    '%{phpdir}/JmesPath/autoload.php',
]);

\Fedora\Autoloader\Dependencies::optional([
    '%{phpdir}/Aws/Sns/autoload.php',
    '%{phpdir}/Doctrine/Common/Cache/autoload.php',
]);
AUTOLOAD


%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{phpdir}/Aws3
cp -pr src/* %{buildroot}%{phpdir}/Aws3/


%check
: Library version value and autoloader check
%{_bindir}/php -r '
    require_once "%{buildroot}%{phpdir}/Aws3/autoload.php";
    $version = \Aws\Sdk::VERSION;
    echo "Version $version (expected %{version})\n";
    exit(version_compare("%{version}", "$version", "=") ? 0 : 1);
'

%if %{with_tests}
: Create tests classmap
%{_bindir}/phpab --nolower --output bootstrap.classmap.php build/

: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
error_reporting(-1);
date_default_timezone_set('UTC');

require_once '%{buildroot}%{phpdir}/Aws3/autoload.php';

\Fedora\Autoloader\Autoload::addPsr4('Aws\\Test\\', __DIR__.'/tests');
\Fedora\Autoloader\Autoload::addPsr4('TokenReflection\\', '%{phpdir}/TokenReflection');

\Fedora\Autoloader\Dependencies::required([
    __DIR__.'/bootstrap.classmap.php',
    '%{phpdir}/Nette/Neon/autoload.php',
    '%{phpdir}/Psr/Cache/autoload.php',
]);
BOOTSTRAP

: Skip tests known to fail
rm -f \
    tests/Integ/GuzzleV5HandlerTest.php \
    tests/Integ/GuzzleV6StreamHandlerTest.php

export AWS_ACCESS_KEY_ID=foo
export AWS_SECRET_ACCESS_KEY=bar

: Upstream tests
%{_bindir}/phpunit -d memory_limit=1G --verbose  --testsuite=unit \
    --bootstrap bootstrap.php

: Upstream tests with SCLs if available
SCL_RETURN_CODE=0
for SCL in php56 php70 php71; do
    if which $SCL; then
        $SCL %{_bindir}/phpunit -d memory_limit=1G --verbose  --testsuite=unit \
            --bootstrap bootstrap.php || SCL_RETURN_CODE=1
    fi
done
exit $SCL_RETURN_CODE
%else
: Tests skipped
%endif


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE.md
%doc CHANGELOG.md
%doc composer.json
%doc README.md
%doc UPGRADING.md
%{phpdir}/Aws3


%changelog
* Fri Jan 27 2017 Remi Collet <remi@remirepo.net> - 3.21.6-1
- update to 3.21.6

* Thu Jan 26 2017 Remi Collet <remi@remirepo.net> - 3.21.5-1
- update to 3.21.5

* Wed Jan 25 2017 Remi Collet <remi@remirepo.net> - 3.21.4-1
- update to 3.21.4

* Sat Jan 21 2017 Remi Collet <remi@remirepo.net> - 3.21.3-1
- update to 3.21.3

* Fri Jan 20 2017 Remi Collet <remi@remirepo.net> - 3.21.2-1
- update to 3.21.2

* Thu Jan 19 2017 Remi Collet <remi@remirepo.net> - 3.21.1-1
- update to 3.21.1

* Wed Jan 18 2017 Shawn Iwinski <shawn@iwin.ski> - 3.21.0-1
- Updated to 3.21.0 (RHBZ #1405254)

* Tue Jan 17 2017 Remi Collet <remi@remirepo.net> - 3.20.16-1
- update to 3.20.16

* Thu Jan  5 2017 Remi Collet <remi@remirepo.net> - 3.20.13-1
- update to 3.20.13

* Fri Dec 30 2016 Remi Collet <remi@remirepo.net> - 3.20.12-1
- update to 3.20.12

* Mon Dec 26 2016 Shawn Iwinski <shawn@iwin.ski> - 3.20.11-1
- Updated to 3.20.11 (RHBZ #1405254)
- Run upstream tests with SCLs if they are available

* Fri Dec 23 2016 Remi Collet <remi@remirepo.net> - 3.20.11-1
- update to 3.20.11

* Thu Dec 22 2016 Remi Collet <remi@remirepo.net> - 3.20.10-1
- update to 3.20.10

* Wed Dec 21 2016 Remi Collet <remi@remirepo.net> - 3.20.9-1
- update to 3.20.9

* Tue Dec 20 2016 Remi Collet <remi@remirepo.net> - 3.20.8-1
- update to 3.20.8

* Fri Dec 16 2016 Remi Collet <remi@remirepo.net> - 3.20.7-1
- update to 3.20.7

* Thu Dec 15 2016 Shawn Iwinski <shawn@iwin.ski> - 3.20.6-1
- Updated to 3.20.6 (RHBZ #1402170)

* Tue Dec 13 2016 Remi Collet <remi@remirepo.net> - 3.20.5-1
- update to 3.20.5

* Fri Dec  9 2016 Remi Collet <remi@remirepo.net> - 3.20.4-1
- update to 3.20.4

* Thu Dec  8 2016 Remi Collet <remi@remirepo.net> - 3.20.3-1
- update to 3.20.3

* Wed Dec  7 2016 Remi Collet <remi@remirepo.net> - 3.20.2-1
- update to 3.20.2

* Fri Dec  2 2016 Remi Collet <remi@remirepo.net> - 3.20.1-1
- update to 3.20.1

* Thu Dec 01 2016 Shawn Iwinski <shawn@iwin.ski> - 3.20.0-1
- Updated to 3.20.0 (RHBZ #1397218)

* Wed Nov 30 2016 Remi Collet <remi@remirepo.net> - 3.19.33-1
- update to 3.19.33

* Wed Nov 23 2016 Remi Collet <remi@remirepo.net> - 3.19.32-1
- update to 3.19.32

* Tue Nov 22 2016 Remi Collet <remi@remirepo.net> - 3.19.31-1
- update to 3.19.31

* Mon Nov 21 2016 Shawn Iwinski <shawn@iwin.ski> - 3.19.30-1
- Updated to 3.19.30 (RHBZ #1380046)
- Switched autoloader from php-composer(symfony/class-loader) to
  php-composer(fedora/autoloader)

* Fri Nov 18 2016 Remi Collet <remi@remirepo.net> - 3.19.28-1
- update to 3.19.28

* Thu Nov 17 2016 Remi Collet <remi@remirepo.net> - 3.19.27-1
- update to 3.19.27

* Wed Nov 16 2016 Remi Collet <remi@remirepo.net> - 3.19.26-1
- update to 3.19.26

* Tue Nov 15 2016 Remi Collet <remi@remirepo.net> - 3.19.25-1
- update to 3.19.25

* Fri Nov 11 2016 Remi Collet <remi@remirepo.net> - 3.19.24-1
- update to 3.19.24

* Fri Nov  4 2016 Remi Collet <remi@remirepo.net> - 3.19.23-1
- update to 3.19.23

* Thu Nov  3 2016 Remi Collet <remi@remirepo.net> - 3.19.22-1
- update to 3.19.22

* Wed Nov  2 2016 Remi Collet <remi@remirepo.net> - 3.19.21-1
- update to 3.19.21

* Wed Oct 26 2016 Remi Collet <remi@remirepo.net> - 3.19.20-1
- update to 3.19.20

* Tue Oct 25 2016 Remi Collet <remi@remirepo.net> - 3.19.19-1
- update to 3.19.19

* Fri Oct 21 2016 Remi Collet <remi@remirepo.net> - 3.19.18-1
- update to 3.19.18

* Wed Oct 19 2016 Remi Collet <remi@remirepo.net> - 3.19.17-1
- update to 3.19.17

* Tue Oct 18 2016 Remi Collet <remi@remirepo.net> - 3.19.16-1
- update to 3.19.16

* Fri Oct 14 2016 Remi Collet <remi@remirepo.net> - 3.19.15-1
- update to 3.19.15

* Thu Oct 13 2016 Remi Collet <remi@remirepo.net> - 3.19.14-1
- update to 3.19.14

* Fri Oct  7 2016 Remi Collet <remi@remirepo.net> - 3.19.13-1
- update to 3.19.13

* Fri Sep 30 2016 Remi Collet <remi@remirepo.net> - 3.19.12-1
- update to 3.19.12

* Wed Sep 28 2016 Remi Collet <remi@remirepo.net> - 3.19.11-1
- update to 3.19.11

* Sun Sep 25 2016 Shawn Iwinski <shawn@iwin.ski> - 3.19.10-1
- Updated to 3.19.10 (RHBZ #1376241)

* Fri Sep 23 2016 Remi Collet <remi@remirepo.net> - 3.19.10-1
- update to 3.19.10

* Mon Sep 19 2016 Remi Collet <remi@remirepo.net> - 3.19.8-1
- update to 3.19.8

* Wed Sep 14 2016 Remi Collet <remi@remirepo.net> - 3.19.7-1
- update to 3.19.7

* Sun Sep 11 2016 Shawn Iwinski <shawn@iwin.ski> - 3.19.6-1
- Updated to 3.19.6 (RHBZ #1365099)

* Fri Aug 12 2016 Remi Collet <remi@remirepo.net> - 3.18.39-1
- update to 3.18.39

* Wed Aug 10 2016 Remi Collet <remi@remirepo.net> - 3.18.38-1
- update to 3.18.38

* Fri Aug  5 2016 Remi Collet <remi@remirepo.net> - 3.18.37-1
- update to 3.18.37

* Wed Aug  3 2016 Remi Collet <remi@remirepo.net> - 3.18.36-1
- update to 3.18.36

* Fri Jul 29 2016 Remi Collet <remi@remirepo.net> - 3.18.35-1
- update to 3.18.35

* Thu Jul 21 2016 Remi Collet <remi@remirepo.net> - 3.18.31-1
- update to 3.18.31

* Sun Jul 17 2016 Remi Collet <remi@remirepo.net> - 3.18.28-1
- update to 3.18.28

* Fri Jul  8 2016 Remi Collet <remi@remirepo.net> - 3.18.27-1
- update to 3.18.27

* Wed Jul  6 2016 Remi Collet <remi@remirepo.net> - 3.18.25-1
- update to 3.18.25

* Mon Jul 04 2016 Shawn Iwinski <shawn@iwin.ski> - 3.18.24-1
- Updated to 3.18.24 (RHBZ #1342771)

* Sat Jul  2 2016 Remi Collet <remi@remirepo.net> - 3.18.24-1
- update to 3.18.24

* Fri Jul  1 2016 Remi Collet <remi@remirepo.net> - 3.18.23-1
- update to 3.18.23

* Thu Jun 30 2016 Remi Collet <remi@remirepo.net> - 3.18.22-1
- update to 3.18.22

* Tue Jun 28 2016 Remi Collet <remi@remirepo.net> - 3.18.21-1
- update to 3.18.21

* Fri Jun 24 2016 Remi Collet <remi@remirepo.net> - 3.18.20-1
- update to 3.18.20

* Wed Jun 22 2016 Remi Collet <remi@remirepo.net> - 3.18.19-1
- update to 3.18.19

* Wed Jun 15 2016 Remi Collet <remi@remirepo.net> - 3.18.18-1
- update to 3.18.18

* Fri Jun 10 2016 Remi Collet <remi@remirepo.net> - 3.18.17-1
- update to 3.18.17

* Fri Jun  3 2016 Remi Collet <remi@remirepo.net> - 3.18.15-1
- update to 3.18.15

* Fri May 27 2016 Remi Collet <remi@remirepo.net> - 3.18.14-1
- update to 3.18.14

* Wed May 25 2016 Remi Collet <remi@remirepo.net> - 3.18.13-1
- update to 3.18.13

* Fri May 20 2016 Remi Collet <remi@remirepo.net> - 3.18.12-1
- update to 3.18.12

* Fri May 20 2016 Remi Collet <remi@remirepo.net> - 3.18.11-1
- update to 3.18.11

* Wed May 18 2016 Remi Collet <remi@remirepo.net> - 3.18.9-1
- update to 3.18.9

* Fri May  6 2016 Remi Collet <remi@remirepo.net> - 3.18.6-1
- update to 3.18.6

* Wed May  4 2016 Remi Collet <remi@remirepo.net> - 3.18.5-1
- update to 3.18.5

* Fri Apr 29 2016 Remi Collet <remi@remirepo.net> - 3.18.4-1
- update to 3.18.4

* Thu Apr 28 2016 Remi Collet <remi@remirepo.net> - 3.18.3-1
- update to 3.18.3

* Fri Apr 22 2016 Remi Collet <remi@remirepo.net> - 3.18.1-1
- update to 3.18.1

* Thu Apr 21 2016 Remi Collet <remi@remirepo.net> - 3.18.0-1
- backport for remi repository

* Wed Apr 20 2016 Shawn Iwinski <shawn@iwin.ski> - 3.18.0-1
- Updated to 3.18.0
- Modified autoloader to not use @include_once for optional dependencies
- Set test memory_limit because build issues on certain systems

* Tue Apr 12 2016 Shawn Iwinski <shawn@iwin.ski> - 3.17.6-1
- Initial package