Browse Source

add libssh

Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
lilik-openwrt-22.03
Mislav Novakovic 8 years ago
parent
commit
0faddbbb47
3 changed files with 142 additions and 0 deletions
  1. +85
    -0
      libs/libssh/Makefile
  2. +35
    -0
      libs/libssh/patches/001-compile.patch
  3. +22
    -0
      libs/libssh/patches/002-disable-libssp.patch

+ 85
- 0
libs/libssh/Makefile View File

@ -0,0 +1,85 @@
#
# Copyright (C) 2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_NAME:=libssh
PKG_VERSION:=0.7.5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=0588cbf9d43e7819e453c8b35c1b5e515d815473
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_URL:=git://git.libssh.org/projects/libssh.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libssh
SECTION:=lib
CATEGORY:=Libraries
URL:=$(PKG_SOURCE_URL)
TITLE:=SSH library
DEPENDS:=+libpthread +librt +zlib +libopenssl
endef
define Package/libssh/description
libssh is a mulitplatform C library implementing the SSHv2 and SSHv1 protocol
for client and server implementations.
endef
CMAKE_OPTIONS = \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DHAVE_STRTOULL=1 \
-DHAVE_GETADDRINFO=1 \
-DHAVE_TERMIOS_H=1 \
-DWITH_EXAMPLES:BOOL=OFF \
-DWITH_GCRYPT:BOOL=OFF \
-DWITH_GSSAPI:BOOL=OFF \
-DWITH_LIBZ:BOOL=ON \
-DWITH_NACL:BOOL=OFF \
-DWITH_PCAP:BOOL=OFF \
-DWITH_SERVER:BOOL=ON \
-DWITH_SFTP:BOOL=ON \
-DWITH_SSH1:BOOL=OFF \
-DWITH_TESTING:BOOL=OFF \
ifeq ($(CONFIG_BIG_ENDIAN),y)
CMAKE_OPTIONS += -DWITH_BIG_ENDIAN=ON
else
CMAKE_OPTIONS += -DWITH_BIG_ENDIAN=OFF
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libssh/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libssh/* $(1)/usr/include/libssh/
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libssh* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
endef
define Package/libssh/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libssh* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libssh))

+ 35
- 0
libs/libssh/patches/001-compile.patch View File

@ -0,0 +1,35 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,10 +35,6 @@ include(DefineInstallationPaths)
include(DefineOptions.cmake)
include(CPackConfig.cmake)
-# disallow in-source build
-include(MacroEnsureOutOfSourceBuild)
-macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
-
# search for libraries
if (WITH_ZLIB)
find_package(ZLIB REQUIRED)
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -5,7 +5,6 @@ include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)
-include(TestBigEndian)
set(PACKAGE ${APPLICATION_NAME})
set(VERSION ${APPLICATION_VERSION})
@@ -270,6 +269,8 @@ if (WITH_GSSAPI AND NOT GSSAPI_FOUND)
endif (WITH_GSSAPI AND NOT GSSAPI_FOUND)
# ENDIAN
-if (NOT WIN32)
- test_big_endian(WORDS_BIGENDIAN)
-endif (NOT WIN32)
+if (WITH_BIG_ENDIAN)
+ set(WORDS_BIGENDIAN 1)
+else (WITH_BIG_ENDIAN)
+ set(WORDS_BIGENDIAN 0)
+endif (WITH_BIG_ENDIAN)

+ 22
- 0
libs/libssh/patches/002-disable-libssp.patch View File

@ -0,0 +1,22 @@
--- a/cmake/Modules/DefineCompilerFlags.cmake
+++ b/cmake/Modules/DefineCompilerFlags.cmake
@@ -1,7 +1,6 @@
# define system dependent compiler flags
include(CheckCCompilerFlag)
-include(CheckCCompilerFlagSSP)
if (UNIX AND NOT WIN32)
#
@@ -21,11 +20,6 @@ if (UNIX AND NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif (WITH_FPIC)
- check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
- if (WITH_STACK_PROTECTOR)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
- endif (WITH_STACK_PROTECTOR)
-
if (CMAKE_BUILD_TYPE)
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
if (CMAKE_BUILD_TYPE_LOWER MATCHES (release|relwithdebinfo|minsizerel))

Loading…
Cancel
Save