Merge pull request #9700 from ja-pa/libssh2-1.9.0
[feed/packages.git] / libs / libssh2 / Makefile
1 #
2 # Copyright (C) 2015-2018 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libssh2
11 PKG_VERSION:=1.9.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://www.libssh2.org/download
16 PKG_HASH:=d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd
17
18 PKG_FIXUP:=autoreconf
19
20 PKG_INSTALL:=1
21
22 PKG_LICENSE:=BSD
23 PKG_LICENSE_FILES:=COPYING
24 PKG_CPE_ID:=cpe:/a:libssh2:libssh2
25
26 PKG_CONFIG_DEPENDS:= \
27 CONFIG_LIBSSH2_MBEDTLS \
28 CONFIG_LIBSSH2_OPENSSL
29
30 include $(INCLUDE_DIR)/package.mk
31 include $(INCLUDE_DIR)/cmake.mk
32
33 define Package/libssh2
34 SECTION:=libs
35 CATEGORY:=Libraries
36 TITLE:=SSH2 library
37 URL:=https://www.libssh2.org/
38 DEPENDS:=+LIBSSH2_MBEDTLS:libmbedtls +LIBSSH2_OPENSSL:libopenssl +zlib
39 MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
40 endef
41
42 define Package/libssh2/description
43 libssh2 is a client-side C library implementing the SSH2 protocol.
44 endef
45
46 define Package/libssh2/config
47 source "$(SOURCE)/Config.in"
48 endef
49
50 CMAKE_OPTIONS += \
51 -DBUILD_SHARED_LIBS=ON \
52 -DENABLE_ZLIB_COMPRESSION=ON \
53 -DCLEAR_MEMORY=ON
54
55 ifeq ($(CONFIG_LIBSSH2_OPENSSL),y)
56 CMAKE_OPTIONS += -DCRYPTO_BACKEND=OpenSSL
57 else
58 CMAKE_OPTIONS += -DCRYPTO_BACKEND=mbedTLS
59 endif
60
61 define Build/InstallDev
62 $(INSTALL_DIR) $(1)/usr/include
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
65 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh2.so* $(1)/usr/lib/
67 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libssh2.pc $(1)/usr/lib/pkgconfig/
68 endef
69
70 define Package/libssh2/install
71 $(INSTALL_DIR) $(1)/usr/lib
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh2.so* $(1)/usr/lib/
73 endef
74
75 $(eval $(call BuildPackage,libssh2))