You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

126 lines
3.8 KiB

##
## libssh2.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_libssh2 1.2.4
%define V_libssh 0.4.1
# package information
Name: libssh2
Summary: SSH2 Protocol Client Library
URL: http://www.libssh2.org/
Vendor: Sara Golemon
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: PLUS
Group: SSH
License: BSD-style
Version: %{V_libssh2}
Release: 20100214
# package options
%option with_perl no
# list of sources
Source0: http://www.libssh2.org/download/libssh2-%{V_libssh2}.tar.gz
Source1: http://www.libssh.org/files/libssh-%{V_libssh}.tar.gz
Patch0: libssh2.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, make, cmake, gcc, gcc::with_cxx = yes
PreReq: OpenPKG, openpkg >= 20040130
BuildPreReq: openssl, zlib
PreReq: openssl, zlib
AutoReq: no
AutoReqProv: no
%description
This package contains both libssh2, a C library implementing the
SSH2 protocol, and libssh, an independent C library implementing the
SSH1 and SSH2 protocols.
%track
prog libssh2 = {
version = %{V_libssh2}
url = http://www.libssh2.org/
regex = libssh2-(__VER__)\.tar\.gz
}
prog libssh2:libssh = {
version = %{V_libssh}
url = http://www.libssh.org/files/
regex = libssh-(__VER__)\.tar\.gz
}
%prep
%setup -q -c
%setup -q -T -D -a 1
%patch -p0
%build
( cd libssh2-%{V_libssh2}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man \
--with-openssl=%{l_prefix} \
--with-libz=%{l_prefix} \
--disable-shared
%{l_make} %{l_mflags -O}
) || exit $?
( cd libssh-%{V_libssh}
mkdir build
cd build
cmake \
-DCMAKE_C_COMPILER=%{l_cc} \
-DCMAKE_CXX_COMPILER=%{l_cxx} \
-DCMAKE_INSTALL_PREFIX=%{l_prefix} \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_STATIC_LIB=ON \
-DWITH_LIBZ=OFF \
-DWITH_SFTP=OFF \
-DWITH_SERVER=OFF \
..
%{l_make} %{l_mflags}
) || exit $?
%install
rm -rf $RPM_BUILD_ROOT
( cd libssh2-%{V_libssh2}
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
) || exit $?
( cd libssh-%{V_libssh}/build
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libssh.so* >/dev/null 2>&1 || true
) || exit $?
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT