wolfssl: add PKG_CPE_ID ids to package and tools
[openwrt/openwrt.git] / package / libs / wolfssl / Makefile
1 #
2 # Copyright (C) 2006-2017 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:=wolfssl
11 PKG_VERSION:=3.12.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
15 PKG_SOURCE_URL:=https://www.wolfssl.com/
16 PKG_HASH:=5bb196056ac0086efbf07ecea7d3e73b1c31722eb52a88b85879f920428a9a0f
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20 PKG_USE_MIPS16:=0
21 PKG_BUILD_PARALLEL:=1
22 PKG_LICENSE:=GPL-2.0+
23 PKG_CPE_ID:=cpe:/a:yassl:cyassl
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/libwolfssl
28 SECTION:=libs
29 SUBMENU:=SSL
30 CATEGORY:=Libraries
31 TITLE:=wolfSSL library
32 URL:=http://www.wolfssl.com/
33 MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
34 MENU:=1
35 PROVIDES:=libcyassl
36 endef
37
38 define Package/libwolfssl/description
39 wolfSSL (formerly CyaSSL) is an SSL library optimized for small
40 footprint, both on disk and for memory use.
41 endef
42
43 define Package/libwolfssl/config
44 source "$(SOURCE)/Config.in"
45 endef
46
47 TARGET_CFLAGS += $(FPIC)
48
49 # --enable-stunnel needed for OpenSSL API compatibility bits
50 CONFIGURE_ARGS += \
51 --enable-opensslextra \
52 --enable-sni \
53 --enable-stunnel \
54 --disable-examples
55
56 ifeq ($(CONFIG_IPV6),y)
57 CONFIGURE_ARGS += \
58 --enable-ipv6
59 endif
60
61 ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y)
62 CONFIGURE_ARGS += \
63 --enable-aesccm
64 endif
65
66 ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y)
67 CONFIGURE_ARGS += \
68 --disable-aesgcm
69 endif
70
71 ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y)
72 CONFIGURE_ARGS += \
73 --disable-chacha
74 endif
75
76 ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y)
77 CONFIGURE_ARGS += \
78 --enable-ecc \
79 --enable-supportedcurves
80 endif
81
82 ifneq ($(CONFIG_WOLFSSL_HAS_DH),y)
83 CONFIGURE_ARGS += \
84 --enable-dh
85 endif
86
87 ifeq ($(CONFIG_WOLFSSL_HAS_ARC4),n)
88 CONFIGURE_ARGS += \
89 --disable-arc4
90 endif
91
92 ifeq ($(CONFIG_WOLFSSL_HAS_DES3),y)
93 CONFIGURE_ARGS += \
94 --disable-des3
95 endif
96
97 ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y)
98 CONFIGURE_ARGS += \
99 --enable-psk
100 endif
101
102 ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y)
103 CONFIGURE_ARGS += \
104 --enable-dtls
105 endif
106
107 ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y)
108 CONFIGURE_ARGS += \
109 --enable-curve25519
110 endif
111
112 ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y)
113 CONFIGURE_ARGS += \
114 --enable-poly1305
115 endif
116
117 #ifneq ($(CONFIG_TARGET_x86),)
118 # CONFIGURE_ARGS += --enable-intelasm
119 #endif
120 #ifneq ($(CONFIG_TARGET_x86_64),)
121 # CONFIGURE_ARGS += --enable-intelasm
122 #endif
123
124 define Build/InstallDev
125 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
126 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
127
128 $(INSTALL_DIR) $(1)/usr/lib
129 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.{so*,la} $(1)/usr/lib/
130 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
131 ln -s libwolfssl.la $(1)/usr/lib/libcyassl.la
132
133 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
134 endef
135
136 define Package/libwolfssl/install
137 $(INSTALL_DIR) $(1)/usr/lib
138 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/
139 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
140 endef
141
142 $(eval $(call BuildPackage,libwolfssl))