1 |
blueness |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
3 |
blueness |
1.6 |
# $Header: /var/cvsroot/gentoo-x86/net-libs/cyassl/cyassl-2.0.8-r1.ebuild,v 1.5 2012/07/16 22:49:44 blueness Exp $ |
4 |
blueness |
1.1 |
|
5 |
|
|
EAPI="4" |
6 |
|
|
|
7 |
|
|
inherit eutils |
8 |
|
|
|
9 |
|
|
DESCRIPTION="Lightweight SSL/TLS library targeted at embedded and RTOS environments" |
10 |
|
|
HOMEPAGE="http://www.yassl.com/yaSSL/Home.html" |
11 |
|
|
SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.zip" |
12 |
|
|
|
13 |
|
|
LICENSE="GPL-2" |
14 |
|
|
SLOT="0" |
15 |
blueness |
1.6 |
KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86" |
16 |
blueness |
1.1 |
|
17 |
|
|
#Add CRYPTO_OPTS=ecc when fixed |
18 |
|
|
CACHE_SIZE="small big +huge" |
19 |
|
|
CRYPTO_OPTS="aes-ni +hc128 +psk +ripemd sha512" |
20 |
|
|
CERT_OPTS="+sessioncerts +testcert" |
21 |
|
|
IUSE="-dtls ipv6 +httpd +sniffer static-libs threads +zlib cyassl-hardening ${CACHE_SIZE} ${CRYPTO_OPTS} ${CERT_OPTS}" |
22 |
|
|
|
23 |
|
|
#You can only pick one cach size |
24 |
|
|
#sha512 is broken on x86 |
25 |
|
|
#Testing freezes with dtls |
26 |
|
|
REQUIRED_USE="^^ ( small big huge ) |
27 |
|
|
test? ( !dtls )" |
28 |
|
|
|
29 |
blueness |
1.2 |
DEPEND="app-arch/unzip |
30 |
|
|
sniffer? ( net-libs/libpcap ) |
31 |
blueness |
1.1 |
zlib? ( sys-libs/zlib )" |
32 |
|
|
RDEPEND="${DEPEND}" |
33 |
|
|
|
34 |
|
|
src_prepare() { |
35 |
|
|
epatch "${FILESDIR}"/${P}-disable-testsuit-ifnothreads.patch |
36 |
|
|
|
37 |
|
|
#Apply unconditionally, but only triggered if USE="aes-ni" |
38 |
|
|
epatch "${FILESDIR}"/${P}-fix-gnustack.patch |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
src_configure() { |
42 |
|
|
local myconf=() |
43 |
|
|
|
44 |
|
|
if use threads; then |
45 |
|
|
myconf+=( --disable-singleThreaded ) |
46 |
|
|
else |
47 |
|
|
myconf+=( --enable-singleThreaded ) |
48 |
|
|
fi |
49 |
|
|
|
50 |
|
|
if use amd64; then |
51 |
|
|
myconf+=( --enable-fastmath --enable-fasthugemath --enable-bump ) |
52 |
|
|
elif use x86; then |
53 |
|
|
#not pie friendly, sorry x86, no fast math for you :( |
54 |
|
|
myconf+=( --disable-fastmath --disable-fasthugemath --disable-bump ) |
55 |
|
|
fi |
56 |
|
|
|
57 |
|
|
#There are lots of options, so we'll force a few reasonable |
58 |
|
|
#We may change this in the future, in particular ecc needs to be fixed |
59 |
|
|
econf \ |
60 |
|
|
--enable-opensslExtra \ |
61 |
|
|
--enable-fortress \ |
62 |
|
|
--enable-keygen \ |
63 |
|
|
--enable-certgen \ |
64 |
|
|
--disable-debug \ |
65 |
|
|
--disable-ecc \ |
66 |
|
|
--disable-small \ |
67 |
|
|
--disable-ntru \ |
68 |
|
|
--disable-noFilesystem \ |
69 |
|
|
--disable-noInline \ |
70 |
|
|
--disable-gcc-lots-o-warnings \ |
71 |
|
|
$(use_enable small smallcache) \ |
72 |
|
|
$(use_enable big bigcache) \ |
73 |
|
|
$(use_enable huge hugecache) \ |
74 |
|
|
$(use_enable aes-ni aesni) \ |
75 |
|
|
$(use_enable hc128) \ |
76 |
|
|
$(use_enable psk) \ |
77 |
|
|
$(use_enable ripemd) \ |
78 |
|
|
$(use_enable sha512) \ |
79 |
|
|
$(use_enable dtls) \ |
80 |
|
|
$(use_enable ipv6) \ |
81 |
|
|
$(use_enable httpd webServer) \ |
82 |
|
|
$(use_enable sessioncerts) \ |
83 |
|
|
$(use_enable sniffer) \ |
84 |
|
|
$(use_enable testcert) \ |
85 |
|
|
$(use_enable static-libs static) \ |
86 |
|
|
$(use_enable cyassl-hardening gcc-hardening) \ |
87 |
|
|
$(use_enable cyassl-hardening linker-hardening) \ |
88 |
|
|
$(use_with zlib libz) \ |
89 |
|
|
"${myconf[@]}" |
90 |
|
|
} |
91 |
|
|
|
92 |
|
|
src_test() { |
93 |
|
|
"${S}"/tests/unit |
94 |
|
|
"${S}"/ctaocrypt/benchmark/benchmark |
95 |
|
|
} |
96 |
|
|
|
97 |
|
|
src_install() { |
98 |
|
|
default |
99 |
|
|
|
100 |
|
|
mv "${D}"/usr/share/doc/"${PN}"/* \ |
101 |
|
|
"${D}"/usr/share/doc/"${P}"/ |
102 |
|
|
rmdir "${D}"/usr/share/doc/"${PN}"/ |
103 |
|
|
} |