blob: 584dfba336ec2d1136020cdf5bfa2863596ca678 (
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
|
# remirepo/fedora spec file for php-alcaeus-mongo-php-adapter
#
# Copyright (c) 2016-2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# disabled for https://fedoraproject.org/wiki/Changes/MongoDB_Removal
%bcond_with tests
%global gh_commit 561496fca4989dc728ed3dda50331aacae62ee9c
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner alcaeus
%global gh_project mongo-php-adapter
%global ns_vendor Alcaeus
Name: php-%{gh_owner}-%{gh_project}
Version: 1.2.5
Release: 1%{?dist}
Summary: Mongo PHP Adapter
License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}%{?prever}-%{?gh_short}.tar.gz
BuildArch: noarch
BuildRequires: php-fedora-autoloader-devel
BuildRequires: php(language) >= 5.6
%if %{with tests}
BuildRequires: php-ctype
BuildRequires: php-hash
BuildRequires: php-composer(mongodb/mongodb) >= 1.0.1
BuildRequires: php-reflection
BuildRequires: php-date
BuildRequires: php-json
BuildRequires: php-mbstring
BuildRequires: php-pcre
BuildRequires: php-spl
# from composer.json, require-dev": {
# "phpunit/phpunit": "^5.7.27 || ^6.0 || ^7.0",
# "squizlabs/php_codesniffer": "^3.2"
BuildRequires: mongodb-server >= 3.4
BuildRequires: phpunit7
%endif
# From composer.json, "require": {
# "php": "^5.6 || ^7.0 || ^8.0",
# "ext-ctype": "*",
# "ext-hash": "*",
# "ext-mongodb": "^1.2.0",
# "mongodb/mongodb": "^1.0.1"
Requires: php(language) >= 5.6
Requires: php-ctype
Requires: php-hash
Requires: php-pecl(mongodb) >= 1.2.0
Requires: php-composer(mongodb/mongodb) >= 1.0.1
# From phpcompatinfo report for 1.1.7
Requires: php-reflection
Requires: php-date
Requires: php-json
Requires: php-mbstring
Requires: php-pcre
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
Provides: php-composer(ext-mongo) = 1.6.14
%description
The Mongo PHP Adapter is a userland library designed to act as an
adapter between applications relying on ext-mongo and the new driver
(ext-mongodb).
It provides the API of ext-mongo built on top of mongo-php-library,
thus being compatible with PHP 7.
Autoloader: %{_datadir}/php/%{ns_vendor}/MongoDbAdapter/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
mv lib/Mongo lib/%{ns_vendor}/Mongo
%build
: Create a classmap autoloader
%{_bindir}/phpab \
--template fedora \
--output lib/%{ns_vendor}/MongoDbAdapter/autoload.php \
lib/%{ns_vendor}
cat << 'EOF' | tee -a lib/%{ns_vendor}/MongoDbAdapter/autoload.php
\Fedora\Autoloader\Dependencies::required(array(
dirname(__DIR__) . '/Mongo/functions.php',
'%{_datadir}/php/MongoDB/autoload.php',
));
EOF
%install
mkdir -p %{buildroot}%{_datadir}/php
cp -pr lib/%{ns_vendor} %{buildroot}%{_datadir}/php/%{ns_vendor}
%check
%if %{with tests}
cat << 'EOF' | tee bs.php
<?php
require '%{buildroot}%{_datadir}/php/%{ns_vendor}/MongoDbAdapter/autoload.php';
require 'tests/%{ns_vendor}/MongoDbAdapter/TestCase.php';
EOF
: Run a server
mkdir dbtest
mongod \
--journal \
--logpath $PWD/server.log \
--pidfilepath $PWD/server.pid \
--dbpath $PWD/dbtest \
--fork || : skip test as server cant start
if [ ! -s server.pid ] ; then
exit 0
fi
: Run the test suite
%{_bindir}/phpunit7 --bootstrap bs.php || ret=1
: Cleanup
kill $(cat server.pid)
sleep 1
exit $ret
%else
: Test suite disabled
%endif
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
%doc *.md
%{_datadir}/php/%{ns_vendor}
%changelog
* Wed Nov 29 2023 Remi Collet <remi@remirepo.net> - 1.2.5-1
- update to 1.2.5
* Wed Oct 4 2023 Remi Collet <remi@remirepo.net> - 1.2.4-1
- update to 1.2.4
* Fri Jul 21 2023 Remi Collet <remi@remirepo.net> - 1.2.3-1
- update to 1.2.3
* Mon Feb 7 2022 Remi Collet <remi@remirepo.net> - 1.2.2-1
- update to 1.2.2
* Fri Jul 9 2021 Remi Collet <remi@remirepo.net> - 1.2.1-1
- update to 1.2.1
* Thu Nov 12 2020 Remi Collet <remi@remirepo.net> - 1.2.0-1
- update to 1.2.0
* Mon Nov 2 2020 Remi Collet <remi@remirepo.net> - 1.1.13-1
- update to 1.1.13
* Mon Oct 19 2020 Remi Collet <remi@remirepo.net> - 1.1.12-1
- update to 1.1.12
* Tue Nov 12 2019 Remi Collet <remi@remirepo.net> - 1.1.11-1
- update to 1.1.11
* Thu Nov 7 2019 Remi Collet <remi@remirepo.net> - 1.1.10-1
- update to 1.1.10
* Thu Aug 8 2019 Remi Collet <remi@remirepo.net> - 1.1.9-1
- update to 1.1.9
* Mon Jul 15 2019 Remi Collet <remi@remirepo.net> - 1.1.8-1
- update to 1.1.8
* Mon Apr 8 2019 Remi Collet <remi@remirepo.net> - 1.1.7-1
- update to 1.1.7
* Fri Feb 8 2019 Remi Collet <remi@remirepo.net> - 1.1.6-1
- update to 1.1.6
- drop patch merged upstream
* Tue Feb 5 2019 Remi Collet <remi@remirepo.net> - 1.1.5-5
- disable test suite and so mongodb-server build dependency
for https://fedoraproject.org/wiki/Changes/MongoDB_Removal
* Mon Jul 9 2018 Remi Collet <remi@remirepo.net> - 1.1.5-2
- add upstream for ext-mongodb 1.5
* Tue Mar 6 2018 Remi Collet <remi@remirepo.net> - 1.1.5-1
- Update to 1.1.5
- switch to phpunit7
* Thu Jan 25 2018 Remi Collet <remi@remirepo.net> - 1.1.4-1
- Update to 1.1.4
* Sun Sep 24 2017 Remi Collet <remi@remirepo.net> - 1.1.3-1
- Update to 1.1.3
* Sat Aug 5 2017 Remi Collet <remi@remirepo.net> - 1.1.2-1
- Update to 1.1.2
* Fri Jun 30 2017 Remi Collet <remi@remirepo.net> - 1.1.1-1
- Update to 1.1.1
* Sun May 14 2017 Remi Collet <remi@remirepo.net> - 1.1.0-1
- Update to 1.1.0
- raise dependency on PHP >= 5.6
- add dependency on pecl/mongodb >= 1.2.0
- only run test with MongoDB 3.4
* Thu Apr 27 2017 Remi Collet <remi@remirepo.net> - 1.0.11-1
- Update to 1.0.11
* Wed Apr 12 2017 Remi Collet <remi@remirepo.net> - 1.0.10-2
- add patch from https://github.com/alcaeus/mongo-php-adapter/pull/167
- enable test suite with mongodb 3.1 (F26)
* Thu Mar 30 2017 Remi Collet <remi@remirepo.net> - 1.0.10-1
- Update to 1.0.10
* Sun Jan 29 2017 Remi Collet <remi@fedoraproject.org> - 1.0.9-1
- update to 1.0.9
- switch to fedora autoloader
* Thu Jan 12 2017 Remi Collet <remi@fedoraproject.org> - 1.0.8-1
- update to 1.0.8
* Tue Dec 20 2016 Remi Collet <remi@fedoraproject.org> - 1.0.7-1
- update to 1.0.7
* Fri Oct 7 2016 Remi Collet <remi@fedoraproject.org> - 1.0.6-1
- update to 1.0.6
* Thu Jul 28 2016 Remi Collet <remi@fedoraproject.org> - 1.0.5-2
- only run upstream test suite when build --with tests
* Mon Jul 4 2016 Remi Collet <remi@fedoraproject.org> - 1.0.5-1
- update to 1.0.5
* Wed Jun 22 2016 Remi Collet <remi@fedoraproject.org> - 1.0.4-1
- update to 1.0.4
* Wed Jun 15 2016 Remi Collet <remi@fedoraproject.org> - 1.0.3-1
- initial package
|