ustream-ssl: update to the latest version, fixes openssl TLS version selection
[openwrt/openwrt.git] / package / libs / ustream-ssl / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ustream-ssl
4 PKG_VERSION:=2016-02-21
5 PKG_RELEASE=$(PKG_SOURCE_VERSION)
6
7 PKG_SOURCE_PROTO:=git
8 PKG_SOURCE_URL=$(OPENWRT_GIT)/project/ustream-ssl.git
9 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
10 PKG_SOURCE_VERSION:=6ba14990e63fc956e8aff3b0b09be1fd3aaa6d75
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
12 CMAKE_INSTALL:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
15
16 PKG_LICENSE:=ISC
17 PKG_LICENSE_FILES:=
18
19 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
20
21 include $(INCLUDE_DIR)/package.mk
22 include $(INCLUDE_DIR)/cmake.mk
23
24 define Package/libustream/default
25 SECTION:=libs
26 CATEGORY:=Libraries
27 TITLE:=ustream SSL Library
28 DEPENDS:=+libubox
29 ABI_VERSION:=$(PKG_VERSION)
30 endef
31
32 define Package/libustream-openssl
33 $(Package/libustream/default)
34 TITLE += (openssl)
35 DEPENDS += +PACKAGE_libustream-openssl:libopenssl
36 VARIANT:=openssl
37 endef
38
39 define Package/libustream-cyassl
40 $(Package/libustream/default)
41 TITLE += (cyassl)
42 DEPENDS += +PACKAGE_libustream-cyassl:libcyassl
43 VARIANT:=cyassl
44 endef
45
46 define Package/libustream-polarssl
47 $(Package/libustream/default)
48 TITLE += (polarssl)
49 DEPENDS += +libpolarssl
50 VARIANT:=polarssl
51 DEFAULT_VARIANT:=1
52 endef
53
54 define Package/libustream-mbedtls
55 $(Package/libustream/default)
56 TITLE += (mbedtls)
57 DEPENDS += +libmbedtls
58 VARIANT:=mbedtls
59 DEFAULT_VARIANT:=1
60 endef
61
62 ifeq ($(BUILD_VARIANT),cyassl)
63 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/cyassl -DHAVE_SNI
64 CMAKE_OPTIONS += -DCYASSL=on
65 endif
66 ifeq ($(BUILD_VARIANT),polarssl)
67 CMAKE_OPTIONS += -DPOLARSSL=on
68 endif
69 ifeq ($(BUILD_VARIANT),mbedtls)
70 CMAKE_OPTIONS += -DMBEDTLS=on
71 endif
72
73 define Package/libustream/default/install
74 $(INSTALL_DIR) $(1)/lib/
75 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libustream-ssl.so $(1)/lib/
76 endef
77
78 Package/libustream-openssl/install = $(Package/libustream/default/install)
79 Package/libustream-cyassl/install = $(Package/libustream/default/install)
80 Package/libustream-polarssl/install = $(Package/libustream/default/install)
81 Package/libustream-mbedtls/install = $(Package/libustream/default/install)
82
83 $(eval $(call BuildPackage,libustream-polarssl))
84 $(eval $(call BuildPackage,libustream-mbedtls))
85 $(eval $(call BuildPackage,libustream-cyassl))
86 $(eval $(call BuildPackage,libustream-openssl))