diff options
-rw-r--r-- | php-pecl-ssh2.spec | 108 |
1 files changed, 76 insertions, 32 deletions
diff --git a/php-pecl-ssh2.spec b/php-pecl-ssh2.spec index 4c3044e..e34b7c4 100644 --- a/php-pecl-ssh2.spec +++ b/php-pecl-ssh2.spec @@ -1,13 +1,24 @@ -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} - +# spec file for php-pecl-ssh2 +# +# Copyright (c) 2011-2013 Remi Collet +# Copyright (c) 2008-2011 Itamar Reis Peixoto +# License: MIT +# +# Please, preserve the changelog entries +# +%{?scl: %scl_package php-pecl-ssh2} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} + +%global with_zts 0%{?__ztsphp:1} %global pecl_name ssh2 -Name: php-pecl-ssh2 +Name: %{?scl_prefix}php-pecl-ssh2 Version: 0.12 -Release: 1%{?dist}.5 +Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} Summary: Bindings for the libssh2 library -# http://pecl.php.net/bugs/bug.php?id=24364 License: PHP Group: Development/Languages URL: http://pecl.php.net/package/ssh2 @@ -16,19 +27,20 @@ Source2: php-pecl-ssh2-0.10-README BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libssh2-devel >= 1.2 -BuildRequires: php-devel -BuildRequires: php-pear +BuildRequires: %{?scl_prefix}php-devel +BuildRequires: %{?scl_prefix}php-pear Requires(post): %{__pecl} Requires(postun): %{__pecl} -Requires: php(zend-abi) = %{php_zend_api} -Requires: php(api) = %{php_core_api} +Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} +Requires: %{?scl_prefix}php(api) = %{php_core_api} -Provides: php-%{pecl_name} = %{version} -Provides: php-%{pecl_name}%{?_isa} = %{version} -Provides: php-pecl(%{pecl_name}) = %{version} -Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +%if 0%{!?scl:1} # Other third party repo stuff Obsoletes: php53-pecl-%{pecl_name} Obsoletes: php53u-pecl-%{pecl_name} @@ -38,10 +50,13 @@ Obsoletes: php54-pecl-%{pecl_name} %if "%{php_version}" > "5.5" Obsoletes: php55u-pecl-%{pecl_name} %endif +%endif +%if 0%{?fedora} < 20 # Filter private shared %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} +%endif %description @@ -49,13 +64,19 @@ Bindings to the libssh2 library which provide access to resources (shell, remote exec, tunneling, file transfer) on a remote machine using a secure cryptographic transport. -Documentation : http://php.net/ssh2 +Documentation: http://php.net/ssh2 %prep -%setup -c -q +%setup -c -q -extver=$(sed -n '/#define PHP_SSH2_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_ssh2.h) +# http://git.php.net/?p=pecl/networking/ssh2.git;a=commit;h=febf5a78b761ad3c8da06dfb6e94ac54708d2fa1 +sed -e '/LICENSE/s/"src"/"doc"/' \ + -i package.xml + +mv %{pecl_name}-%{version} NTS + +extver=$(sed -n '/#define PHP_SSH2_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_ssh2.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream PDO ABI version is now ${extver}, expecting %{version}. : Update the pdover macro and rebuild. @@ -69,50 +90,65 @@ cat > ssh2.ini << 'EOF' extension=ssh2.so EOF -cp -pr %{pecl_name}-%{version} %{pecl_name}-%{version}-zts +%if %{with_zts} +: Duplicate source tree for NTS / ZTS build +cp -pr NTS ZTS +%endif %build -cd %{pecl_name}-%{version} +cd NTS %{_bindir}/phpize %configure --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} -cd ../%{pecl_name}-%{version}-zts +%if %{with_zts} +cd ../ZTS %{_bindir}/zts-phpize %configure --with-php-config=%{_bindir}/zts-php-config make %{?_smp_mflags} +%endif %install rm -rf %{buildroot} -make -C %{pecl_name}-%{version} \ - install INSTALL_ROOT=%{buildroot} - -make -C %{pecl_name}-%{version}-zts \ - install INSTALL_ROOT=%{buildroot} +make -C NTS install INSTALL_ROOT=%{buildroot} # Install XML package description install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml # install config file install -Dpm644 ssh2.ini %{buildroot}%{php_inidir}/ssh2.ini + +%if %{with_zts} +make -C ZTS install INSTALL_ROOT=%{buildroot} install -Dpm644 ssh2.ini %{buildroot}%{php_ztsinidir}/ssh2.ini +%endif + +# Documentation +install -Dpm 644 README %{buildroot}%{pecl_docdir}/%{pecl_name}/README + +for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + %check -# Minimal load test for NTS extension +: Minimal load test for NTS extension %{__php} --no-php-ini \ - --define extension_dir=%{pecl_name}-%{version}/modules \ + --define extension_dir=%{buildroot}%{php_extdir} \ --define extension=%{pecl_name}.so \ --modules | grep %{pecl_name} -# Minimal load test for ZTS extension +%if %{with_zts} +: Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ - --define extension_dir=%{pecl_name}-%{version}-zts/modules \ + --define extension_dir=%{buildroot}%{php_ztsextdir} \ --define extension=%{pecl_name}.so \ --modules | grep %{pecl_name} +%endif %post @@ -131,15 +167,23 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc README +%doc %{pecl_docdir}/%{pecl_name} %config(noreplace) %{php_inidir}/ssh2.ini -%config(noreplace) %{php_ztsinidir}/ssh2.ini %{php_extdir}/ssh2.so -%{php_ztsextdir}/ssh2.so %{pecl_xmldir}/%{name}.xml +%if %{with_zts} +%config(noreplace) %{php_ztsinidir}/ssh2.ini +%{php_ztsextdir}/ssh2.so +%endif + %changelog +* Sat Nov 30 2013 Remi Collet <RPMS@FamilleCollet.com> - 0.12-2 +- cleanups for Copr +- adap for SCL +- install doc in pecl doc_dir + * Fri Nov 30 2012 Remi Collet <RPMS@FamilleCollet.com> - 0.12-1.1 - also provides php-ssh2 @@ -150,7 +194,7 @@ rm -rf %{buildroot} * Sun Nov 13 2011 Remi Collet <remi@fedoraproject.org> - 0.11.3-2 - build against php 5.4 -* Sat Oct 04 2011 Remi Collet <RPMS@FamilleCollet.com> - 0.11.3-1 +* Tue Oct 04 2011 Remi Collet <RPMS@FamilleCollet.com> - 0.11.3-1 - update to 0.11.3 - zts extension |