File php5-ssh2.spec of Package php5-ssh2

#
# spec file for package php5-ssh2
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define         pkg_name    ssh2
Name:           php5-ssh2
Version:        0.13
Release:        0
Summary:        Bindings for the libssh2 Library
License:        PHP-3.01
Group:          Productivity/Networking/Web/Servers
Url:            http://pecl.php.net/ssh2
Source:         https://pecl.php.net/get/%{pkg_name}-%{version}.tgz
BuildRequires:  libssh2-devel
BuildRequires:  php5-devel
Provides:       php-ssh2 = %{version}
Obsoletes:      php-ssh2 < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{?php_zend_api}0
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
%else
%requires_eq    php
%endif

%description
Provides bindings to the functions of libssh2 which implements the SSH2
protocol.

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

%build
%{_bindir}/phpize
pushd %{name}
export CFLAGS="%{optflags} -Werror=format-security -fno-strict-aliasing -fstack-protector"
export CXXFLAGS="%{optflags} -fno-strict-aliasing -fstack-protector"
../configure --with-ssh2=%{_prefix} --with-libdir=%{_lib}
make %{?_smp_mflags}
popd

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags} -C %{name} INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/php5/conf.d
echo "; comment out next line to disable ssh2 extension in php" > %{buildroot}%{_sysconfdir}/php5/conf.d/ssh2.ini
echo 'extension = ssh2.so' >> %{buildroot}%{_sysconfdir}/php5/conf.d/ssh2.ini

%check
pushd %{name}
make %{?_smp_mflags} test
popd

%files
%defattr(-,root,root,-)
%doc LICENSE
%{_libdir}/php5/extensions/ssh2.so
%config(noreplace) %{_sysconfdir}/php5/conf.d/ssh2.ini

%changelog
openSUSE Build Service is sponsored by