File dba-php-539-ssh2.spec of Package dba-php-549-ssh2
# norootforbuild
%define pkg ssh2
%define real_vers 0.12
%define php_version 5.4.9
%define php_vers 549
%define dba_ssh2 0
%define run_tests 1
%define prefix /DBA/apache/PHP/%{php_version}
%define phpize %{prefix}/bin/phpize
%define phpconf %{prefix}/bin/php-config
Name: dba-php-%{php_vers}-ssh2
Summary: PECL bindings for the libssh2 library
Version: %{real_vers}
Release: 1
License: Other/See package
Group: Productivity/Networking/Web/Servers
URL: http://pecl.php.net/package/ssh2
Source: http://pecl.php.net/get/%{pkg}-%{version}.tgz
Source1: ssh2.ini
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: dba-php-%{php_vers}
#!BuildIgnore: dba-postgresql-839 dba-postgresql-842 dba-postgresql-845 dba-postgresql-846
#!BuildIgnore: dba-postgresql-901 dba-postgresql-902 dba-postgresql-904 dba-postgresql-910
#!BuildIgnore: dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c dba-openssl-101e
%if 0%{?sles_version} == 11 || 0%{?rhel_version} >= 600
%define dba_ssh2 1
BuildRequires: dba-libssh2-142 openssl-devel
Requires: dba-libssh2-142
%else
BuildRequires: libssh2 libssh2-devel
%endif
%if 0%{?suse_version} > 1020
BuildRequires: re2c
%endif
%if 0%{?suse_version} >= 1100
BuildRequires: -post-build-checks
%endif
%description
Provides bindings to the functions of libssh2 which implements the SSH2 protocol.
libssh2 is available from http://www.sourceforge.net/projects/libssh2
%prep
%setup -q -n %{pkg}-%{real_vers}
%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
%if %{dba_ssh2}
CFLAGS="$CFLAGS -I/DBA/libssh2/1.4.2/include"
LDFLAGS="$LDFLAGS -L/DBA/libssh2/1.4.2/lib"
%endif
export CFLAGS CXXFLAGS LDFLAGS
%{phpize}
%configure \
%if %{dba_ssh2}
--with-ssh2=/DBA/libssh2/1.4.2/ \
%else
--with-ssh2 \
%endif
--with-php-config=%{phpconf}
sed -e's!64/include!!g' -e's!\s/include!!g' -i Makefile
%{__make} %{?jobs:-j%jobs}
%check
%if %run_tests
%{__make} test PHP_EXECUTABLE=%{prefix}/bin/php
%endif
%install
%if %{dba_ssh2}
# prevent rpath problem on suse
export NO_BRP_CHECK_RPATH=true
%endif
%{__make} install INSTALL_ROOT="%{buildroot}"
# %{__install} -D -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/php5/conf.d/ssh2.ini
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%dir %{prefix}/lib/php/extensions
%{prefix}/lib/php/extensions/ssh2.so
# %config(noreplace) %{_sysconfdir}/php5/conf.d/ssh2.ini
%changelog
* Thu Aug 22 2013 Holger Manthey <holger.manthey@bertelsmann.de>
- use dba-libssh2 for suse