A new user interface for you! Read more...

File php7-sqlsrv.spec of Package php7-sqlsrv

%define pkg_name sqlsrv
%define version 5.2.0

%define prefix          /DBA/apache24/PHP/%{php_version}
%define maketest        0

Name:       php7-%{pkg_name}
Summary: 	PHP Extension to access Microsoft SQL Server
Version: 	%{version}
Release: 	0
License: 	BSD-2-Clause
Group: 		Productivity/Networking/Web/Servers
URL: 		http://pecl.php.net/package/%{pkg_name}
Source: 	http://pecl.php.net/get/%{pkg_name}-%{version}.tgz
BuildRoot: 	%{_tmppath}/%{name}-%{version}-build
BuildRequires:	php7-devel
BuildRequires:	unzip
BuildRequires:	gcc-c++ libstdc++-devel
BuildRequires:	unixODBC-devel
%if 0%{?suse_version} >= 1100
BuildRequires:  -post-build-checks
%endif
%if 0%{?suse_version} >= 1200
BuildRequires:  automake libtool
%endif
%if %{?php_zend_api}0
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
%else
%requires_eq    php7
%endif
Requires: msodbcsql
Requires: unixODBC

%description
The PHP extension to access Microsoft SQL Server allows 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.

%prep
%setup -q -n %{pkg_name}-%{version}


%build
CFLAGS="%{optflags} -fno-strict-aliasing"
CXXFLAGS="%{optflags} -fno-strict-aliasing"
%if 0%{?suse_version} > 1000
CFLAGS="$CFLAGS -fstack-protector"
CXXFLAGS="$CXXFLAGS -fstack-protector"
%endif

export CFLAGS
export CXXFLAGS

%{_bindir}/phpize

%configure

%{__make} %{?jobs:-j%jobs}


%check
%if %maketest
%{__make} test
%endif


%clean
%{__rm} -rf %{buildroot}


%install
%makeinstall INSTALL_ROOT=%{buildroot}
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php7/conf.d
echo "; comment out next line to disable %{pkg_name} extension in php" > %{buildroot}%{_sysconfdir}/php7/conf.d/%{pkg_name}.ini
echo "extension = %{pkg_name}.so" >> %{buildroot}%{_sysconfdir}/php7/conf.d/%{pkg_name}.ini

%files
%defattr(644,root,root,755)
%{_libdir}/php7/extensions/%{pkg_name}.so
%config(noreplace) %{_sysconfdir}/php7/conf.d/%{pkg_name}.ini


%changelog