diff options
| author | Remi Collet <remi@remirepo.net> | 2026-03-26 16:03:59 +0100 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2026-03-26 16:03:59 +0100 |
| commit | a1285b8a412dde799c26af379db7f3b97777bbb7 (patch) | |
| tree | 3d535d3592264236ea0ff67e8fcf44a92d90f633 | |
| parent | 546ed657654b65493deba92f255f77b56e46f7eb (diff) | |
sources from github
| -rw-r--r-- | REFLECTION | 2 | ||||
| -rw-r--r-- | php-sqlsrv.spec | 129 |
2 files changed, 61 insertions, 70 deletions
@@ -1,4 +1,4 @@ -Extension [ <persistent> extension #117 sqlsrv version 5.13.0 ] { +Extension [ <persistent> extension #121 sqlsrv version 5.13.0 ] { - INI { Entry [ sqlsrv.WarningsReturnAsErrors <ALL> ] diff --git a/php-sqlsrv.spec b/php-sqlsrv.spec index 78dcfc1..1e61225 100644 --- a/php-sqlsrv.spec +++ b/php-sqlsrv.spec @@ -9,32 +9,32 @@ %{?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}} +%global extname sqlsrv +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} # After 20-pdo.ini -%global ininame 40-%{extname}.ini +%global ininame 40-%{extname}.ini %global msodbcsqlver17 17.10 %global msodbcsqlver18 18.1 +%global sources %{gh_proj}-%{version}/sources +%global _configure ../configure + +# Github forge +%global gh_vend Microsoft +%global gh_proj msphpsql +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag v%{version} +# for EL-8 to avoid TAG usage +%global archivename %{gh_proj}-%{version} + Name: %{?scl_prefix}php-sqlsrv Summary: Microsoft Drivers for PHP for SQL Server -%global tarversion 5.13.0 -Version: 5.13.0 -Release: 1%{?dist} 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 +Version: 5.13.0 +Release: 2%{?dist} +%forgemeta +URL: %{forgeurl} +Source0: %{forgesource} BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -42,7 +42,6 @@ BuildRequires: %{?dtsprefix}gcc-c++ BuildRequires: libtool-ltdl-devel BuildRequires: %{?scl_prefix}php-devel >= 8.3 BuildRequires: %{?scl_prefix}php-pdo -BuildRequires: %{?scl_prefix}php-pear BuildRequires: unixODBC-devel >= 2.3.1 # grep 'ODBC_DRIVER drivers' shared/core_conn.cpp # { ODBC_DRIVER::VER_17, ODBC_DRIVER::VER_18, ODBC_DRIVER::VER_13 } @@ -62,6 +61,7 @@ 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} +# No PIE for now %description @@ -83,43 +83,21 @@ Package built for PHP %(%{__php} -n -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VER %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 .. +%forgesetup +pushd source/shared # 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) +extmaj=$(sed -n '/#define SQLVERSION_MAJOR/{s/.*MAJOR //;s/\r//;p}' version.h) +extmin=$(sed -n '/#define SQLVERSION_MINOR/{s/.*MINOR //;s/\r//;p}' version.h) +extrel=$(sed -n '/#define SQLVERSION_PATCH/{s/.*PATCH //;s/\r//;p}' version.h) +extbld=$(sed -n '/#define SQLVERSION_BUILD/{s/.*BUILD //;s/\r//;p}' 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 .. +popd cat << 'EOF' | tee %{ininame} ; Enable '%{summary}' extensions @@ -138,11 +116,6 @@ extension = pdo_%{extname}.so ;pdo_sqlsrv.set_locale_info = 2 EOF -%if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS -%endif - : ====== Known driver versions ====== grep 'ODBC_DRIVER drivers' NTS/%{extname}/shared/core_conn.cpp | \ sed -e 's/ODBC_DRIVER/\n\tODBC_DRIVER/g' @@ -152,53 +125,67 @@ grep 'ODBC_DRIVER drivers' NTS/%{extname}/shared/core_conn.cpp | \ %{?dtsenable} : =================== sqlsrv NTS =================== -cd NTS/%{extname} +pushd source/%{extname} +ln -sf ../shared +mkdir NTS ZTS + %{_bindir}/phpize +sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global + +cd NTS %configure \ --with-php-config=%{_bindir}/php-config \ --enable-sqlsrv make %{?_smp_mflags} +popd : =================== pdo_sqlsrv NTS =================== -cd ../../NTS/pdo_%{extname} +pushd source/pdo_%{extname} +ln -sf ../shared +mkdir NTS ZTS + %{_bindir}/phpize +sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global + +cd NTS %configure \ --with-php-config=%{_bindir}/php-config \ --with-pdo_sqlsrv + make %{?_smp_mflags} +popd %if %{with_zts} : =================== sqlsrv ZTS =================== -cd ../../ZTS/%{extname} -%{_bindir}/zts-phpize +pushd source/%{extname}/ZTS %configure \ --with-php-config=%{_bindir}/zts-php-config \ --enable-sqlsrv + make %{?_smp_mflags} +popd : =================== pdo_sqlsrv ZTS =================== -cd ../../ZTS/pdo_%{extname} -%{_bindir}/zts-phpize +pushd source/pdo_%{extname}/ZTS %configure \ --with-php-config=%{_bindir}/zts-php-config \ --with-pdo_sqlsrv + make %{?_smp_mflags} +popd %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} +%make_install -C source/%{extname}/NTS +%make_install -C source/pdo_%{extname}/NTS 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} +%make_install -C source/%{extname}/ZTS +%make_install -C source/pdo_%{extname}/ZTS install -D -m 644 %{ininame} %{buildroot}%{php_ztsinidir}/%{ininame} %endif @@ -226,8 +213,8 @@ install -D -m 644 %{ininame} %{buildroot}%{php_ztsinidir}/%{ininame} %files %license LICENSE -%{pecl_xmldir}/php-pecl-%{extname}.xml -%{pecl_xmldir}/php-pecl-pdo-%{extname}.xml +%doc *.md +%doc sample %config(noreplace) %{php_inidir}/%{ininame} %{php_extdir}/%{extname}.so @@ -241,6 +228,10 @@ install -D -m 644 %{ininame} %{buildroot}%{php_ztsinidir}/%{ininame} %changelog +* Thu Mar 26 2026 Remi Collet <remi@remirepo.net> - 5.12.0-2 +- drop pear/pecl dependency +- sources from github + * Sat Feb 28 2026 Remi Collet <remi@remirepo.net> - 5.12.0-1 - update to 5.13.0 |
