blob: 68433f5431ef98c1512abf122e2fc7e6c333bd70 (
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
|
# remirepo spec file for php-sqlsrv
#
# Copyright (c) 2016-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# we don't want -z defs linker flag
%undefine _strict_symbol_defs_build
%{?scl: %scl_package php-sqlsrv}
%global gh_commit 4ccffbbe077e87288bf00cc6327142579da46775
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner Microsoft
%global gh_project msphpsql
%global from_pecl 1
%global extname sqlsrv
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
# After 20-pdo.ini
%global ininame 40-%{extname}.ini
%global msodbcsqlver17 17.10
%global msodbcsqlver18 18.1
Name: %{?scl_prefix}php-sqlsrv
Summary: Microsoft Drivers for PHP for SQL Server
%global tarversion 5.10.1
Version: 5.10.1
Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: MIT
URL: https://github.com/Microsoft/msphpsql
%if %{from_pecl}
Source0: http://pecl.php.net/get/%{extname}-%{tarversion}.tgz
Source1: http://pecl.php.net/get/pdo_%{extname}-%{tarversion}.tgz
%else
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
%endif
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?dtsprefix}gcc-c++
BuildRequires: %{?scl_prefix}php-devel >= 7.3
BuildRequires: %{?scl_prefix}php-pdo
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: unixODBC-devel >= 2.3.1
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires:(msodbcsql17 >= %{msodbcsqlver17} or msodbcsql18 >= %{msodbcsqlver18})
Requires: (msodbcsql17%{?_isa} >= %{msodbcsqlver17} or msodbcsql18%{?_isa} >= %{msodbcsqlver18})
%else
BuildRequires: msodbcsql17 >= %{msodbcsqlver17}
Requires: msodbcsql17%{?_isa} >= %{msodbcsqlver17}
%endif
# ABI check
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php(pdo-abi) = %{php_pdo_api}
Requires: %{?scl_prefix}php-pdo%{?_isa}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-pdo_%{extname} = %{version}
Provides: %{?scl_prefix}php-pdo_%{extname}%{_isa} = %{version}
# Also available as pecl packages
Provides: %{?scl_prefix}php-pecl(%{extname}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{extname})%{_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(pdo_%{extname}) = %{version}
Provides: %{?scl_prefix}php-pecl(pdo_%{extname})%{_isa} = %{version}
%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
Obsoletes: php74-sqlsrv <= %{version}
%if "%{php_version}" > "8.0"
Obsoletes: php80-sqlsrv <= %{version}
Obsoletes: php80-pecl-sqlsrv <= %{version}
Obsoletes: php80-pecl-pdo-sqlsrv <= %{version}
%endif
%if "%{php_version}" > "8.1"
Obsoletes: php81-sqlsrv <= %{version}
Obsoletes: php81-pecl-sqlsrv <= %{version}
Obsoletes: php81-pecl-pdo-sqlsrv <= %{version}
%endif
%endif
%description
The Microsoft Drivers for PHP for SQL Server are PHP extensions that allow for
the reading and writing of SQL Server data from within PHP scripts.
The SQLSRV extension provides a procedural interface while the PDO_SQLSRV
extension implements PDO for accessing data in all editions of SQL Server
2008 R2 and later (including Azure SQL DB).
These drivers rely on the Microsoft ODBC Driver for SQL Server to handle the
low-level communication with SQL Server.
You can download the Microsoft ODBC Driver from
https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server
Package built using msodbcsql17 version %{msodbcsqlver}.
Package built for PHP %(%{__php} -n -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
%prep
%if %{from_pecl}
%setup -qcT
mkdir NTS
tar xf %{SOURCE0}
mv %{extname}-%{tarversion}/LICENSE .
mv %{extname}-%{tarversion} NTS/%{extname}
mv package.xml NTS/%{extname}
tar xf %{SOURCE1}
mv pdo_%{extname}-%{tarversion} NTS/pdo_%{extname}
mv package.xml NTS/pdo_%{extname}
%else
%setup -qc
mv %{gh_project}-%{gh_commit}/source NTS
mv %{gh_project}-%{gh_commit}/LICENSE .
%endif
cd NTS
cd %{extname}
: no patch
cd ../pdo_%{extname}
: no patch
cd ..
# Sanity check, really often broken
extmaj=$(sed -n '/#define SQLVERSION_MAJOR/{s/.*MAJOR //;s/\r//;p}' sqlsrv/shared/version.h)
extmin=$(sed -n '/#define SQLVERSION_MINOR/{s/.*MINOR //;s/\r//;p}' sqlsrv/shared/version.h)
extrel=$(sed -n '/#define SQLVERSION_PATCH/{s/.*PATCH //;s/\r//;p}' sqlsrv/shared/version.h)
extbld=$(sed -n '/#define SQLVERSION_BUILD/{s/.*BUILD //;s/\r//;p}' sqlsrv/shared/version.h)
extver=${extmaj}.${extmin}.${extrel}
rpmver=%{version}
if test "x${extver}" != "x${rpmver%%~*}"; then
: Error: Upstream extension version is ${extver}, expecting ${rpmver%%~*}.
exit 1
fi
cd ..
cat << 'EOF' | tee %{ininame}
; Enable '%{summary}' extension module
extension = %{extname}.so
extension = pdo_%{extname}.so
; Configuration
;sqlsrv.WarningsReturnAsErrors = On
;sqlsrv.LogSeverity = 0
;sqlsrv.LogSubsystems = 0
;sqlsrv.ClientBufferMaxKBSize = 10240
;sqlsrv.SetLocaleInfo => 2 => 2
;pdo_sqlsrv.log_severity = 0
;pdo_sqlsrv.client_buffer_max_kb_size = 10240
;pdo_sqlsrv.set_locale_info = 2
EOF
%if %{with_zts}
# duplicate for ZTS build
cp -pr NTS ZTS
%endif
%build
%{?dtsenable}
: =================== sqlsrv NTS ===================
cd NTS/%{extname}
%{_bindir}/phpize
%configure \
--with-php-config=%{_bindir}/php-config \
--enable-sqlsrv
make %{?_smp_mflags}
: =================== pdo_sqlsrv NTS ===================
cd ../../NTS/pdo_%{extname}
%{_bindir}/phpize
%configure \
--with-php-config=%{_bindir}/php-config \
--with-pdo_sqlsrv
make %{?_smp_mflags}
%if %{with_zts}
: =================== sqlsrv ZTS ===================
cd ../../ZTS/%{extname}
%{_bindir}/zts-phpize
%configure \
--with-php-config=%{_bindir}/zts-php-config \
--enable-sqlsrv
make %{?_smp_mflags}
: =================== pdo_sqlsrv ZTS ===================
cd ../../ZTS/pdo_%{extname}
%{_bindir}/zts-phpize
%configure \
--with-php-config=%{_bindir}/zts-php-config \
--with-pdo_sqlsrv
make %{?_smp_mflags}
%endif
%install
%{?dtsenable}
install -Dpm 644 NTS/%{extname}/package.xml %{buildroot}%{pecl_xmldir}/php-pecl-%{extname}.xml
install -Dpm 644 NTS/pdo_%{extname}/package.xml %{buildroot}%{pecl_xmldir}/php-pecl-pdo-%{extname}.xml
make -C NTS/%{extname} install INSTALL_ROOT=%{buildroot}
make -C NTS/pdo_%{extname} install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ininame} %{buildroot}%{php_inidir}/%{ininame}
%if %{with_zts}
make -C ZTS/%{extname} install INSTALL_ROOT=%{buildroot}
make -C ZTS/pdo_%{extname} install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ininame} %{buildroot}%{php_ztsinidir}/%{ininame}
%endif
%check
# simple module load test
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{extname}.so \
--modules | grep '^%{extname}$'
%{__php} --no-php-ini \
--define extension=pdo.so \
--define extension=%{buildroot}%{php_extdir}/pdo_%{extname}.so \
--modules | grep '^pdo_%{extname}$'
%if %{with_zts}
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{extname}.so \
--modules | grep '^%{extname}$'
%{__ztsphp} --no-php-ini \
--define extension=pdo.so \
--define extension=%{buildroot}%{php_ztsextdir}/pdo_%{extname}.so \
--modules | grep '^pdo_%{extname}$'
%endif
%if 0%{?fedora} < 24 && 0%{?rhel} < 8
# when pear installed alone, after us
%triggerin -- %{?scl_prefix}php-pear
if [ -x %{__pecl} ] ; then
%{pecl_install} %{pecl_xmldir}/php-pecl-%{extname}.xml >/dev/null || :
%{pecl_install} %{pecl_xmldir}/php-pecl-pdo-%{extname}.xml >/dev/null || :
fi
# posttrans as pear can be installed after us
%posttrans
if [ -x %{__pecl} ] ; then
%{pecl_install} %{pecl_xmldir}/php-pecl-%{extname}.xml >/dev/null || :
%{pecl_install} %{pecl_xmldir}/php-pecl-pdo-%{extname}.xml >/dev/null || :
fi
%postun
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{extname} >/dev/null || :
%{pecl_uninstall} pdo_%{extname} >/dev/null || :
fi
%endif
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%{pecl_xmldir}/php-pecl-%{extname}.xml
%{pecl_xmldir}/php-pecl-pdo-%{extname}.xml
%config(noreplace) %{php_inidir}/%{ininame}
%{php_extdir}/%{extname}.so
%{php_extdir}/pdo_%{extname}.so
%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{ininame}
%{php_ztsextdir}/%{extname}.so
%{php_ztsextdir}/pdo_%{extname}.so
%endif
%changelog
* Tue Aug 9 2022 Remi Collet <remi@remirepo.net> - 5.10.1-2
- allow msodbcsql18
* Thu May 19 2022 Remi Collet <remi@remirepo.net> - 5.10.1-1
- update to 5.10.1
- lower minimal PHP version to 7.4
* Tue Feb 1 2022 Remi Collet <remi@remirepo.net> - 5.10.0-1
- update to 5.10.0
- raise minimal PHP version to 7.4
* Fri Dec 3 2021 Remi Collet <remi@remirepo.net> - 5.10.0~beta2-1
- update to 5.10.0beta2
* Thu Sep 9 2021 Remi Collet <remi@remirepo.net> - 5.10.0~beta1-1
- update to 5.10.0beta1
* Sat Jan 30 2021 Remi Collet <remi@remirepo.net> - 5.9.0-1
- update to 5.9.0
* Thu Dec 3 2020 Remi Collet <remi@remirepo.net> - 5.9.0~zbeta2-1
- update to 5.9.0beta2
- raise dependency on PHP 7.3
* Mon Oct 5 2020 Remi Collet <remi@remirepo.net> - 5.9.0~preview1-1
- update to 5.9.0preview1
* Thu Apr 16 2020 Remi Collet <remi@remirepo.net> - 5.8.1-1
- update to 5.8.1
* Fri Jan 31 2020 Remi Collet <remi@remirepo.net> - 5.8.0-1
- update to 5.8.0 (stable)
* Wed Dec 4 2019 Remi Collet <remi@remirepo.net> - 5.7.1~preview-1
- update to 5.7.1preview
- raise dependency on PHP 7.2
* Fri Sep 6 2019 Remi Collet <remi@remirepo.net> - 5.7.0~preview-1
- update to 5.7.0preview
* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 5.6.1-5
- rebuild for 7.4.0RC1
* Wed Jul 24 2019 Remi Collet <remi@remirepo.net> - 5.6.1-4
- add patch for 7.4.0beta1 from
https://github.com/microsoft/msphpsql/pull/1013
* Fri Jun 14 2019 Remi Collet <remi@remirepo.net> - 5.6.1-3
- add workaround for 7.4.0alpha1
* Wed Apr 10 2019 Remi Collet <remi@remirepo.net> - 5.6.1-2
- switch from msodbcsql to msodbcsql17
* Wed Mar 20 2019 Remi Collet <remi@remirepo.net> - 5.6.1-1
- update to 5.6.1 (stable)
* Fri Feb 22 2019 Remi Collet <remi@remirepo.net> - 5.6.0-1
- update to 5.6.0 (stable)
* Mon Dec 10 2018 Remi Collet <remi@remirepo.net> - 5.5.0~preview-1
- update to 5.5.0.preview (devel)
* Tue Sep 25 2018 Remi Collet <remi@remirepo.net> - 5.4.0~preview-1
- update to 5.4.0.preview (devel)
- raise dependency on PHP 7.1
* Sat Jul 21 2018 Remi Collet <remi@remirepo.net> - 5.3.0-1
- update to 5.3.0 (stable)
* Wed Jul 4 2018 Remi Collet <remi@remirepo.net> - 5.2.1~preview-2
- add fix for PHP 7.3 from
https://github.com/Microsoft/msphpsql/pull/810
* Thu May 31 2018 Remi Collet <remi@remirepo.net> - 5.2.1~preview-1
- update to 5.2.1preview (devel)
* Mon Mar 26 2018 Remi Collet <remi@remirepo.net> - 5.2.0-1
- update to 5.2.0 (stable)
* Fri Dec 22 2017 Remi Collet <remi@remirepo.net> - 5.2.0~RC1-1
- update to 5.2.0RC1 (devel)
* Thu Dec 21 2017 Remi Collet <remi@remirepo.net> - 5.2.0~RC-1
- update to 5.2.0RC (devel)
* Thu Nov 23 2017 Remi Collet <remi@remirepo.net> - 5.1.2~preview-1
- update to 5.1.2preview (devel)
* Sat Oct 28 2017 Remi Collet <remi@remirepo.net> - 5.1.1~preview-1
- update to 5.1.1preview (devel)
* Thu Sep 21 2017 Remi Collet <remi@remirepo.net> - 5.1.0~preview-1
- update to 5.1.0preview (devel)
* Tue Aug 1 2017 Remi Collet <remi@remirepo.net> - 5.0.0~preview-1
- update to 5.0.0preview (devel)
* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 4.3.0-2
- rebuild for PHP 7.2.0beta1 new API
* Fri Jul 7 2017 Remi Collet <remi@remirepo.net> - 4.3.0-1
- update to 4.3.0 (stable)
* Thu Jun 22 2017 Remi Collet <remi@remirepo.net> - 4.3.0~RC1-2
- rebuild using the msodbcsql package from Microsoft repository
* Thu Jun 22 2017 Remi Collet <remi@remirepo.net> - 4.3.0~RC1-1
- update to 4.3.0RC1 (devel)
* Wed Jun 21 2017 Remi Collet <remi@remirepo.net> - 4.2.0.0~preview-2
- rebuild for 7.2.0alpha2
* Sun May 21 2017 Remi Collet <remi@remirepo.net> - 4.2.0.0~preview-1
- update to 4.2.0preview (devel)
* Wed May 10 2017 Remi Collet <remi@remirepo.net> - 4.1.9.0~preview-1
- update to 4.1.9preview (devel)
* Tue Apr 11 2017 Remi Collet <remi@remirepo.net> - 4.1.8.0~preview-1
- update to 4.1.8preview (devel)
* Tue Mar 7 2017 Remi Collet <remi@remirepo.net> - 4.1.7.0-0.1.preview
- update to 4.1.7preview (devel)
* Thu Feb 9 2017 Remi Collet <remi@remirepo.net> - 4.1.6.1-1
- update to 4.1.6.1 (devel)
* Sat Feb 4 2017 Remi Collet <remi@remirepo.net> - 4.1.6-1
- update to 4.1.6 (devel)
* Tue Dec 20 2016 Remi Collet <remi@remirepo.net> - 4.0.8-1
- update to 4.0.8 (stable)
* Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 4.0.7-2
- rebuild with PHP 7.1.0 GA
* Fri Nov 18 2016 Remi Collet <remi@remirepo.net> - 4.0.7-1
- update to 4.0.7 (devel)
* Sat Oct 22 2016 Remi Collet <remi@remirepo.net> - 4.0.6-1
- update to 4.0.6 (devel)
* Sat Oct 1 2016 Remi Collet <remi@remirepo.net> - 4.0.5-1
- update to 4.0.5, sources from PECL
- drop all patches merged upstream
- open https://github.com/Microsoft/msphpsql/issues/164
* Tue Sep 20 2016 Remi Collet <remi@remirepo.net> - 4.0.4-5
- use the splitted msodbcsql packages
* Mon Sep 19 2016 Remi Collet <remi@remirepo.net> - 4.0.4-4
- fix reported version
- open https://github.com/Microsoft/msphpsql/pull/157 - buffer overflow
* Fri Sep 16 2016 Remi Collet <remi@remirepo.net> - 4.0.4-2
- build from sources
- open https://github.com/Microsoft/msphpsql/pull/153 - build
- open https://github.com/Microsoft/msphpsql/pull/154 - odbcver
- open https://github.com/Microsoft/msphpsql/pull/155 - PHP 7.1
* Fri Sep 16 2016 Remi Collet <remi@remirepo.net> - 4.0.4-1
- initial package
|