%bcond_without tests %global pecl_name ssh2 %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global ini_name 40-%{pecl_name}.ini %global sources %{pecl_name}-%{version} %global _configure ../%{sources}/configure Summary: PHP bindings for libssh2 Name: php-pecl-%{pecl_name} Version: 1.4.1 Release: 10.1.git5167e58%{?dist} License: PHP-3.01 URL: https://github.com/php/pecl-networking-ssh2 Source0: ssh2-%{version}.tar.gz Source1: package.xml BuildRequires: gcc BuildRequires: php-devel >= 7.0 BuildRequires: php-pear BuildRequires: libssh2-devel >= 1.2 Requires: libssh2%{?_isa} >= 1.2 Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} Provides: php-%{pecl_name} = %{version}-%{release} Provides: php-%{pecl_name}%{?_isa} = %{version}-%{release} Provides: php-pecl(%{pecl_name}) = %{version} Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} %description PHP bindings for the libssh2 library providing access to resources (shell, remote exec, tunneling, file transfer) on a remote machine using a secure cryptographic transport. Package built for PHP %{php_version} %prep %setup -qc cp %{SOURCE1} . %{?_licensedir:sed -e '/LICENSE/s/role=\"doc\"/role=\"src\"/' -i package.xml} cd %{sources} # Sanity check extver=$(sed -n '/#define PHP_SSH2_VERSION/{s/.*\"\([^\"]*\)\".*/\1/p}' php_ssh2.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. exit 1 fi cd .. mkdir NTS %if %{with_zts} mkdir ZTS %endif # Drop in the bit of configuration cat << 'EOF' | tee %{ini_name} ; Enable '%{summary}' extension module extension = %{pecl_name}.so EOF %build cd %{sources} %{__phpize} cd ../NTS %configure \ --with-php-config=%{__phpconfig} \ --with-ssh2 make %{?_smp_mflags} %if %{with_zts} cd ../ZTS %configure \ --with-php-config=%{__ztsphpconfig} \ --with-ssh2 make %{?_smp_mflags} %endif %install # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} # Install the ZTS stuff make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif # Documentation cd %{sources} for i in LICENSE README.md do [ -f $i ] && install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done %check cd %{sources} : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' %if %{with_zts} : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' %endif %files %{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so %if %{with_zts} %config(noreplace) %{php_ztsinidir}/%{ini_name} %{php_ztsextdir}/%{pecl_name}.so %endif %changelog * Fri Apr 03 2026 COPR Builder - 1.4.1-1.git5167e58 - Automated build from GitHub master branch - Git commit: 5167e58