summaryrefslogtreecommitdiffstats
path: root/php-slim3.spec
blob: e6b5cfc447ced16fb30a9c04eecb8a3d1b69aa6e (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
# remirepo spec file for php-slim3, from
#
# Fedora spec file for php-slim3
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries

%global gh_commit   eaee12ef8d0750db62b8c548016d82fb33addb6b
%global gh_short    %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner    slimphp
%global gh_project  Slim
%global pk_project  slim
%global gh_version  3.12.1
%global php_home    %{_datadir}/php
%global slim_home   %{php_home}/Slim3


Name:           php-slim3
Summary:        PHP micro framework
Version:        %{gh_version}
Release:        1%{?dist}

# Use a git snapshot as upstream remove tests from distribution
Source0:       %{name}-%{gh_version}-%{gh_short}.tgz
# Script to pull the git snapshot
Source1:       %{name}-makesrc.sh

URL:            http://www.slimframework.com/
License:        MIT

BuildArch:      noarch

#main app
BuildRequires:  php(language) >= 5.5.0
BuildRequires:  php-spl
BuildRequires:  php-simplexml
BuildRequires:  php-date
BuildRequires:  php-json
BuildRequires:  php-pcre
BuildRequires:  php-libxml
BuildRequires:  %{_bindir}/phpab
#test specific
BuildRequires:  php-composer(phpunit/phpunit) >= 4.0
BuildRequires:  php-mbstring
BuildRequires:  php-composer(psr/http-message) >= 1.0
BuildRequires:  php-composer(pimple/pimple) >= 3.0
BuildRequires:  php-composer(container-interop/container-interop) >= 1.2
BuildRequires:  php-composer(psr/container) >= 1.0
BuildRequires:  php-composer(nikic/fast-route) >= 1.0

Requires:       php(language) >= 5.5.0
Requires:       php-spl
Requires:       php-simplexml
Requires:       php-date
Requires:       php-json
Requires:       php-pcre
Requires:       php-libxml
Requires:       php-composer(psr/http-message) >= 1.0
Requires:       php-composer(psr/http-message) < 2.0
Requires:       php-composer(pimple/pimple) >= 3.0
Requires:       php-composer(pimple/pimple) < 4.0
Requires:       php-composer(container-interop/container-interop) >= 1.1
Requires:       php-composer(container-interop/container-interop) < 2.0
Requires:       php-composer(psr/container) >= 1.0
Requires:       php-composer(psr/container) < 2.0
Requires:       php-composer(nikic/fast-route) >= 1.0
Requires:       php-composer(nikic/fast-route) < 2.0

Provides:       php-composer(%{pk_project}/%{pk_project}) = %{version}
Provides:       php-composer(psr/http-message-implementation) = 1.0

%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
#php-Slim (v2) ha been retired
Provides:       php-Slim = %{version}-%{release}
Obsoletes:      php-Slim <= 2.6.2-8
%endif


%description
Slim is a PHP micro framework that helps you quickly write simple yet
powerful web applications and APIs.

Features:
- Powerful router
    - Standard and custom HTTP methods
    - Route parameters with wildcards and conditions
    - Route redirect, halt, and pass
    - Route middleware
- Template rendering with custom views
- Flash messages
- Secure cookies with AES-256 encryption
- HTTP caching
- Logging with custom log writers
- Error handling and debugging
- Middleware and hook architecture
- Simple configuration

Autoloader: %{slim_home}/autoload.php


%prep
%setup -qn %{gh_project}-%{gh_commit}


%build
: Generate a simple classmap autoloader
%{_bindir}/phpab \
  --output %{gh_project}/autoload.php \
  %{gh_project}

cat << 'EOF' | tee -a %{gh_project}/autoload.php

// Dependencies
require_once '%{php_home}/Psr/Http/Message/autoload.php';
require_once '%{php_home}/Interop/Container/autoload.php';
require_once '%{php_home}/Pimple/autoload.php';
require_once '%{php_home}/FastRoute/bootstrap.php';

EOF

: Generate a simple classmap autoloader for tests
%{_bindir}/phpab \
  --output tests/autoload.php \
  tests


%install
# install framework files
install -d %{buildroot}%{slim_home}
cp -a %{gh_project}/* %{buildroot}%{slim_home}/


%check
sed -e \
        "s|dirname(__DIR__) . '/vendor/autoload.php'|'%{buildroot}%{slim_home}/autoload.php'|" \
        -e "s|\$autoloader->addPsr4.*$|require 'autoload.php';\nrequire __DIR__ . '/Assets/PhpFunctionOverrides.php';|" \
        -i tests/bootstrap.php

# OK (Tests: 512, Assertions: 820, Skipped: 13)
%{_bindir}/phpunit \
    -d memory_limit=-1 \
    tests



%files
%{!?_licensedir:%global license %%doc}
%license LICENSE.md
%doc README.md CONTRIBUTING.md composer.json
%dir %{slim_home}/
%{slim_home}/*


%changelog
* Sat Apr 27 2019 Johan Cwiklinski <johan AT x+tnd DOT be> - 3.12.1-1
- New upstream release

* Sat Jul 14 2018 Johan Cwiklinski <johan AT x-tnd DOT be> - 3.10.0-3
- php-Slim (for v2) has been retired, add provides and obsoletes

* Sat Apr 21 2018 Johan Cwiklinski <johan AT x-tnd DOT be> - 3.10.0-1
- New upstream release

* Sun Dec 25 2016 Johan Cwiklinski <johan AT x-tnd DOT be> - 3.7.0-1
- New upstream release

* Sun Nov 27 2016 Johan Cwiklinski <johan AT x-tnd DOT be> - 3.6.0-1
- New upstream release

* Tue Jun 21 2016 Remi Collet <remi@fedoraproject.org> - 3.4.2-1
- update to 3.4.2

* Tue May 17 2016 Johan Cwiklinski <johan AT x-tnd DOT be> - 3.4.1-1
- Update to Slim 3
- Use a git snapshot as upstream drop tests from distribution (thanks to Remi)
- Remove tests subpackage
- Rename package to php-slim3

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Dec 11 2015 Remi Collet <remi@fedoraproject.org> - 2.6.2-3
- fix autoloader name
- add comment about autoloader in package description

* Fri Oct 23 2015 Remi Collet <remi@fedoraproject.org> - 2.6.2-2
- provide php-composer(slim/slim)
- don't ignore test suite result
- add a simpler autoloader

* Thu Oct 22 2015 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.6.2-1
- Last upstream release

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat May 10 2014 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.4.3-1
- New upstream release

* Sun Dec 08 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.4.0-1
- New upstream release

* Thu Aug 08 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.3.0-1
- New upstream release

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Apr 17 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.2.0-1
- New upstream release

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Nov 25 2012 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.1.0-5
- Fix permissions on phpunit.xml.dist
- Remove not needeed %%if in %%check

* Sun Nov 25 2012 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.1.0-4
- phpunit.xml.dist should not be in package's %%doc

* Sun Nov 25 2012 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.1.0-3
- Remove unneedeed %%{real_name} subdirectory
- Move phpunit.xml.dist file in test subpackage

* Thu Nov 22 2012 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.1.0-2
- Various changes and improvements thanks to Remi

* Wed Nov 21 2012 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.1.0-1
- Initial packaging