File dba-php-5418-ssh2.spec of Package dba-php-5418-ssh2

# norootforbuild

%define pkg ssh2
%define real_vers 0.12

%define php_version     5.4.18
%define php_vers        5418
%define run_tests       0
%define dba_ssh2	0
%define debug_package %{nil}
%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
Packager:       Michael Kessel <>
BuildRoot: 	%{_tmppath}/%{name}-%{version}-build

#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c

BuildRequires:  dba-php-%{php_vers}
%if 0%{?sles_version} == 11 || 0%{?rhel_version} >= 600
%define dba_ssh2 1
BuildRequires:  dba-libssh2-142 openssl-devel
Requires:       dba-libssh2-142
BuildRequires:  libssh2 libssh2-devel 

%if 0%{?suse_version} > 1020
BuildRequires:  re2c

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks

Provides bindings to the functions of libssh2 which implements the SSH2 protocol.
libssh2 is available from

%setup -q -n %{pkg}-%{real_vers}


CFLAGS="%{optflags} -fno-strict-aliasing"
CXXFLAGS="%{optflags} -fno-strict-aliasing"
%if 0%{?suse_version} > 1000
CFLAGS="$CFLAGS -fstack-protector"
CXXFLAGS="$CXXFLAGS -fstack-protector"
%if %{dba_ssh2}
CFLAGS="$CFLAGS -I/DBA/libssh2/1.4.2/include"
LDFLAGS="$LDFLAGS -L/DBA/libssh2/1.4.2/lib"


%configure \
%if %{dba_ssh2}
  --with-ssh2=/DBA/libssh2/1.4.2/ \
  --with-ssh2 \

sed -e's!64/include!!g' -e's!\s/include!!g' -i Makefile

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

%if %run_tests
%{__make} test PHP_EXECUTABLE=%{prefix}/bin/php

%if %{dba_ssh2}
# prevent rpath problem on suse
export NO_BRP_CHECK_RPATH=true

# %if 0%{?rhel_version} >= 600 && 0%{?rhel_version} <= 699
# %{__mkdir_p} %{buildroot}%{prefix}/lib/php/extensions
# %{__install} -D -m 0755 .libs/ %{buildroot}%{prefix}/lib/php/extensions/
#  %endif

%{__make} install INSTALL_ROOT="%{buildroot}"

%{__rm} -rf %{buildroot}

%dir %{prefix}/lib/php/extensions

* Mon Aug 26 2013 Holger Manthey <>
- disable debug_package
* Thu Aug 22 2013 Holger Manthey <>
- initial build