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
|
# remirepo/fedora spec file for php-symfony-contracts
#
# Copyright (c) 2019 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global gh_commit f51bca9de06b7a25b19a4155da7bebad099a5def
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner symfony
%global gh_project contracts
# Packagist
%global pk_vendor %{gh_owner}
%global pk_project %{gh_project}
# Namespace
%global ns_vendor Symfony
%global ns_project Contracts
%global php_home %{_datadir}/php
# Test
%global with_tests 0%{!?_without_tests:1}
Name: php-%{pk_vendor}-%{pk_project}
Version: 1.1.8
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}
Summary: A set of abstractions extracted out of the Symfony
License: MIT
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
BuildArch: noarch
%if %{with_tests}
# For tests
BuildRequires: php(language) >= 7.1.3
BuildRequires: php-reflection
BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-intl
# From composer.json, "require-dev": {
# "symfony/polyfill-intl-idn": "^1.10"
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >=8
BuildRequires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2)
BuildRequires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2)
# remirepo:4
%else
BuildRequires: php-psr-cache
BuildRequires: php-psr-container
%endif
%global phpunit %{_bindir}/phpunit7
BuildRequires: %{phpunit}
# Autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
# "php": "^7.1.3"
# "psr/cache": "^1.0",
# "psr/container": "^1.0"
Requires: php(language) >= 7.1.3
# From composer.json, "suggest": {
# "psr/event-dispatcher": "When using the EventDispatcher contracts",
# "symfony/cache-implementation": "",
# "symfony/event-dispatcher-implementation": "",
# "symfony/http-client-implementation": "",
# "symfony/service-implementation": "",
# "symfony/translation-implementation": ""
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >=8
Requires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2)
Requires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2)
Recommends: (php-composer(psr/event-dispatcher) >= 1.0 with php-composer(psr/event-dispatcher) < 2)
# remirepo:4
%else
Requires: php-psr-cache
Requires: php-psr-container
Requires: php-psr-event-dispatcher
%endif
# From phpcompatinfo report for version 1.1.0
Requires: php-reflection
Requires: php-json
Requires: php-pcre
Requires: php-spl
Requires: php-intl
# Autoloader
Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
Provides: php-composer(%{pk_vendor}/cache-contracts) = %{version}
Provides: php-composer(%{pk_vendor}/event-dispatcher-contracts) = %{version}
Provides: php-composer(%{pk_vendor}/http-client-contracts) = %{version}
Provides: php-composer(%{pk_vendor}/service-contracts) = %{version}
Provides: php-composer(%{pk_vendor}/translation-contracts) = %{version}
%description
A set of abstractions extracted out of the Symfony components.
Can be used to build on semantics that the Symfony components
proved useful - and that already have battle tested implementations.
Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
for i in */composer.json */LICENSE */README.md
do
mv $i $(dirname $i)_$(basename $i)
done
%build
: Create autoloader
cat <<'AUTOLOAD' | tee autoload.php
<?php
/* Autoloader for %{name} and its dependencies */
require_once '%{php_home}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\', __DIR__);
\Fedora\Autoloader\Dependencies::optional([
'%{php_home}/Psr/Cache/autoload.php',
'%{php_home}/Psr/Container/autoload.php',
'%{php_home}/Psr/EventDispatcher/autoload.php',
]);
AUTOLOAD
%install
mkdir -p %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}
for i in autoload.php Cache EventDispatcher HttpClient Service Translation
do
rm -f $i/.gitignore
cp -pr $i %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/$i
done
%check
%if %{with_tests}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require_once '%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php';
EOF
ret=0
for cmd in php php71 php72 php73 php74; do
if which $cmd; then
$cmd %{phpunit} \
--no-coverage \
--verbose
fi
done
exit $ret
%else
: Test suite disabled
%endif
%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
%license *LICENSE
%doc *composer.json
%doc *.md
%dir %{php_home}/%{ns_vendor}/
%{php_home}/%{ns_vendor}/%{ns_project}
%changelog
* Thu Nov 21 2019 Remi Collet <remi@remirepo.net> - 1.1.8-1
- update to 1.1.8
- psr/cache and psr/container are mandatory
* Tue Nov 5 2019 Remi Collet <remi@remirepo.net> - 1.1.7-1
- update to 1.1.7
- add missing EventDispatcher and HttpClient directories
- add weak dependency on psr/event-dispatcher
* Thu Jun 6 2019 Remi Collet <remi@remirepo.net> - 1.1.3-1
- update to 1.1.3
* Mon Jun 3 2019 Remi Collet <remi@remirepo.net> - 1.1.2-1
- update to 1.1.2 (no change)
* Tue May 28 2019 Remi Collet <remi@remirepo.net> - 1.1.1-1
- update to 1.1.1
* Thu May 16 2019 Remi Collet <remi@remirepo.net> - 1.1.0-1
- update to 1.1.0
* Mon Jan 7 2019 Remi Collet <remi@remirepo.net> - 1.0.2-1
- initial package, version 1.0.2
|