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.
 
 
 
 
 
 

124 lines
3.9 KiB

##
## libssh2.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2020 OpenPKG Project <http://openpkg.org/>
##
## 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.9.0
%define V_libssh_dir 0.5
%define V_libssh 0.7.5
# package information
Name: libssh2
Summary: SSH2 Protocol Client Library
URL: http://www.libssh2.org/
Vendor: Sara Golemon
Packager: OpenPKG Project
Distribution: OpenPKG Community
Class: PLUS
Group: SSH
License: BSD-style
Version: %{V_libssh2}
Release: 20190621
# package options
%option with_perl no
# list of sources
Source0: http://www.libssh2.org/download/libssh2-%{V_libssh2}.tar.gz
Source1: https://red.libssh.org/attachments/download/218/libssh-%{V_libssh}.tar.xz
Patch0: libssh2.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101, make, cmake, gcc, gcc::with_cxx = yes
PreReq: OpenPKG, openpkg >= 20160101
BuildPreReq: openssl, zlib
PreReq: openssl, zlib
%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 = https://red.libssh.org/projects/libssh/files
regex = libssh-(__VER__)\.tar\.xz
}
%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=ON \
..
%{l_make} %{l_mflags}
) || exit $?
%install
( 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
%{l_shtool} install -c -m 744 \
../include/libssh/*.h \
$RPM_BUILD_ROOT%{l_prefix}/include/libssh/
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