Summary:        A library implementing the SSH2 protocol
Summary(ja):    SSH2プロトコルを実装するためのライブラリ

Name:           libssh
Version:        0.4.4
Release:        1%{?_dist_release}

Group:          System Environment/Libraries
License:        LGPLv2+
URL:            http://www.libssh.org/
Source0:        http://www.libssh.org/files/%{name}-%{version}.tar.gz
Patch0:         libssh-0.2-libdir.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-root

BuildRequires:  openssl-devel
BuildRequires:  zlib-devel   
BuildRequires:  cmake

%description
The SSH library with
- Full C library functions for manipulating a client-side SSH connection
- Fully configurable sessions
- Support for AES-128,AES-192,AES-256,blowfish, in cbc mode
- use multiple SSH connections in a same process, at same time.
- usable SFTP implementation
- Public key and password authentication

%package devel
Summary:         Development files for %{name}
Summary(ja):     %{name} の開発ファイル
Group:           Development/Libraries
Requires:        %{name} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%cmake ..
popd

make %{?_smp_mflags} -C %{_target_platform}

#configure --disable-static --enable-shared
#make # doesn't build with %{?_smp_mflags}

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/*.so

%changelog
* Sun Jun 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.4.4-1
- new upstream release

* Sun Mar  7 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.4.1-1
- new upstream release

* Tue Sep 15 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2-1
- initial build for Vine Linux

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.2-4
- rebuilt with new openssl

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Jun 02 2009 Jan F. Chadima <jchadima@redhat.com> - 0.2-2
- Small changes during review

* Mon Jun 01 2009 Jan F. Chadima <jchadima@redhat.com> - 0.2-1
- Initial build