Browse Source

Added gnutls library

Nikos Mavrogiannopoulos 10 years ago
parent
commit
a206f07dd3
2 changed files with 265 additions and 0 deletions
  1. 34
    0
      libs/gnutls/Config.in
  2. 231
    0
      libs/gnutls/Makefile

+ 34
- 0
libs/gnutls/Config.in View File

@@ -0,0 +1,34 @@
1
+# gnutls avanced configuration
2
+
3
+menu "Configuration"
4
+	depends on PACKAGE_libgnutls
5
+
6
+config GNUTLS_DTLS_SRTP
7
+	bool "enable DTLS SRTP support"
8
+
9
+config GNUTLS_ALPN
10
+	bool "enable ALPN support"
11
+
12
+config GNUTLS_OCSP
13
+	bool "enable ocsp support"
14
+
15
+config GNUTLS_CRYPTODEV
16
+	bool "enable /dev/crypto support"
17
+	depends on BROKEN
18
+
19
+config GNUTLS_HEARTBEAT
20
+	bool "enable DTLS heartbeat support"
21
+
22
+config GNUTLS_OPENPGP
23
+	bool "enable OPENPGP authentication support"
24
+
25
+config GNUTLS_SRP
26
+	bool "enable SRP authentication support"
27
+
28
+config GNUTLS_PSK
29
+	bool "enable PSK authentication support"
30
+
31
+config GNUTLS_ANON
32
+	bool "enable anonymous authentication support"
33
+
34
+endmenu

+ 231
- 0
libs/gnutls/Makefile View File

@@ -0,0 +1,231 @@
1
+#
2
+# Copyright (C) 2005-2010 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:=gnutls
11
+PKG_VERSION:=3.2.15
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2
16
+PKG_MD5SUM:=ec3b06f80e312137386c5d322183ca5a
17
+PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
18
+
19
+PKG_INSTALL:=1
20
+PKG_LIBTOOL_PATHS:=. lib
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+
25
+define Package/gnutls/Default
26
+  SUBMENU:=SSL
27
+  SECTION:=libs
28
+  CATEGORY:=Libraries
29
+  TITLE:=GNU TLS
30
+  URL:=http://www.gnutls.org/
31
+endef
32
+
33
+define Package/gnutls/Default/description
34
+ GnuTLS is a secure communications library implementing the SSL, TLS
35
+ and DTLS protocols and technologies around them. It provides a simple
36
+ C language application programming interface (API) to access the secure
37
+ communications protocols as well as APIs to parse and write X.509, PKCS12,
38
+ OpenPGP and other required structures. It is aimed to be portable and
39
+ efficient with focus on security and interoperability.
40
+endef
41
+
42
+
43
+define Package/certtool
44
+$(call Package/gnutls/Default)
45
+  SECTION:=utils
46
+  CATEGORY:=Utilities
47
+  TITLE+= (certool utility)
48
+  DEPENDS+= +libgnutls
49
+endef
50
+
51
+define Package/certtool/description
52
+$(call Package/gnutls/Default/description)
53
+ This package contains the GnuTLS certtool utility.
54
+endef
55
+
56
+
57
+define Package/gnutls-utils
58
+$(call Package/gnutls/Default)
59
+  SECTION:=utils
60
+  CATEGORY:=Utilities
61
+  TITLE+= (utilities)
62
+  DEPENDS+= +libgnutls
63
+endef
64
+
65
+define Package/gnutls-utils/description
66
+$(call Package/gnutls/Default/description)
67
+ This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
68
+ and srptool utilities.
69
+endef
70
+
71
+define Package/libgnutls/config
72
+	source "$(SOURCE)/Config.in"
73
+endef
74
+
75
+define Package/libgnutls
76
+$(call Package/gnutls/Default)
77
+  TITLE+= (library)
78
+  DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp
79
+endef
80
+
81
+define Package/libgnutls/description
82
+$(call Package/gnutls/Default/description)
83
+ This package contains the GnuTLS shared library, needed by other programs.
84
+endef
85
+
86
+
87
+define Package/libgnutls-openssl
88
+$(call Package/gnutls/Default)
89
+  TITLE+= (OpenSSL compat library)
90
+  DEPENDS+= +libgnutls
91
+endef
92
+
93
+define Package/libgnutls-openssl/description
94
+$(call Package/gnutls/Default/description)
95
+ This package contains the GnuTLS OpenSSL compatibility layer shared library.
96
+endef
97
+
98
+CONFIGURE_ARGS+= \
99
+	--enable-shared \
100
+	--enable-static \
101
+	--disable-libdane \
102
+	--disable-guile \
103
+	--disable-nls \
104
+	--without-zlib \
105
+	--with-included-libtasn1 \
106
+	--enable-local-libopts \
107
+	--disable-doc \
108
+	--disable-tests \
109
+	--disable-rsa-export \
110
+	--disable-crywrap \
111
+	--without-p11-kit
112
+
113
+ifeq ($(CONFIG_LIBNETTLE_MINI),y)
114
+CONFIGURE_ARGS += --with-nettle-mini
115
+endif
116
+
117
+ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
118
+CONFIGURE_ARGS += --disable-dtls-srtp-support
119
+endif
120
+
121
+ifneq ($(CONFIG_GNUTLS_ALPN),y)
122
+CONFIGURE_ARGS += --disable-alpn-support
123
+endif
124
+
125
+ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
126
+CONFIGURE_ARGS += --disable-heartbeat-support
127
+endif
128
+
129
+ifneq ($(CONFIG_GNUTLS_SRP),y)
130
+CONFIGURE_ARGS += --disable-srp-authentication
131
+endif
132
+
133
+ifneq ($(CONFIG_GNUTLS_PSK),y)
134
+CONFIGURE_ARGS += --disable-psk-authentication
135
+endif
136
+
137
+ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
138
+CONFIGURE_ARGS += --disable-openpgp-authentication
139
+endif
140
+
141
+ifneq ($(CONFIG_GNUTLS_ANON),y)
142
+CONFIGURE_ARGS += --disable-anon-authentication
143
+endif
144
+
145
+ifneq ($(CONFIG_GNUTLS_OCSP),y)
146
+CONFIGURE_ARGS += --disable-ocsp
147
+endif
148
+
149
+ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
150
+CONFIGURE_ARGS += --enable-cryptodev
151
+endif
152
+
153
+# XXX: AM_CFLAGS duplicates with CFLAGS
154
+MAKE_FLAGS:= \
155
+	AM_CFLAGS="" \
156
+
157
+TARGET_CFLAGS += $(FPIC)
158
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
159
+
160
+define Build/Configure
161
+	$(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
162
+	$(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
163
+	$(call Build/Configure/Default)
164
+endef
165
+
166
+define Build/InstallDev
167
+	$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
168
+	$(CP) \
169
+		$(PKG_INSTALL_DIR)/usr/include/gnutls \
170
+		$(1)/usr/include/
171
+	$(CP) \
172
+		$(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
173
+		$(1)/usr/lib/
174
+	$(CP) \
175
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
176
+		$(1)/usr/lib/pkgconfig/
177
+endef
178
+
179
+define Package/certtool/conffiles
180
+/etc/gnutls/certtool.cfg
181
+endef
182
+
183
+define Package/certtool/install
184
+	$(INSTALL_DIR) $(1)/etc/gnutls
185
+	$(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
186
+	$(INSTALL_DIR) $(1)/usr/bin
187
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
188
+endef
189
+
190
+
191
+define Package/gnutls-utils/install
192
+	$(INSTALL_DIR) $(1)/usr/bin
193
+ifeq ($(CONFIG_GNUTLS_OCSP),y)
194
+ifeq ($(CONFIG_GNUTLS_ANON),y)
195
+	$(CP) \
196
+		$(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
197
+		$(1)/usr/bin/
198
+endif
199
+	$(CP) \
200
+		$(PKG_INSTALL_DIR)/usr/bin/ocsptool \
201
+		$(1)/usr/bin/
202
+endif
203
+ifeq ($(CONFIG_GNUTLS_SRP),y)
204
+	$(CP) \
205
+		$(PKG_INSTALL_DIR)/usr/bin/srptool \
206
+		$(1)/usr/bin/
207
+endif
208
+ifeq ($(CONFIG_GNUTLS_PSK),y)
209
+	$(CP) \
210
+		$(PKG_INSTALL_DIR)/usr/bin/psktool \
211
+		$(1)/usr/bin/
212
+endif
213
+endef
214
+
215
+
216
+define Package/libgnutls/install
217
+	$(INSTALL_DIR) $(1)/usr/lib
218
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
219
+endef
220
+
221
+
222
+define Package/libgnutls-openssl/install
223
+	$(INSTALL_DIR) $(1)/usr/lib
224
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
225
+endef
226
+
227
+
228
+$(eval $(call BuildPackage,certtool))
229
+$(eval $(call BuildPackage,gnutls-utils))
230
+$(eval $(call BuildPackage,libgnutls))
231
+$(eval $(call BuildPackage,libgnutls-openssl))