1 |
commit: da5485ee12e496029f223dedcff43cfada0147cd |
2 |
Author: Julian Ospald <hasufell <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 4 20:05:17 2015 +0000 |
4 |
Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 4 20:05:17 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da5485ee |
7 |
|
8 |
net-libs/polarssl: add libressl support |
9 |
|
10 |
net-libs/polarssl/polarssl-1.3.9-r1.ebuild | 94 ++++++++++++++++++++++++++++++ |
11 |
1 file changed, 94 insertions(+) |
12 |
|
13 |
diff --git a/net-libs/polarssl/polarssl-1.3.9-r1.ebuild b/net-libs/polarssl/polarssl-1.3.9-r1.ebuild |
14 |
new file mode 100644 |
15 |
index 0000000..516593b |
16 |
--- /dev/null |
17 |
+++ b/net-libs/polarssl/polarssl-1.3.9-r1.ebuild |
18 |
@@ -0,0 +1,94 @@ |
19 |
+# Copyright 1999-2015 Gentoo Foundation |
20 |
+# Distributed under the terms of the GNU General Public License v2 |
21 |
+# $Id$ |
22 |
+ |
23 |
+EAPI=5 |
24 |
+ |
25 |
+inherit eutils multilib cmake-utils multilib-minimal |
26 |
+ |
27 |
+DESCRIPTION="Cryptographic library for embedded systems" |
28 |
+HOMEPAGE="http://polarssl.org/" |
29 |
+SRC_URI="http://polarssl.org/download/${P}-gpl.tgz" |
30 |
+ |
31 |
+LICENSE="GPL-2" |
32 |
+SLOT="0/7" |
33 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" |
34 |
+IUSE="doc havege libressl programs cpu_flags_x86_sse2 static-libs test threads zlib" |
35 |
+ |
36 |
+RDEPEND=" |
37 |
+ programs? ( |
38 |
+ !libressl? ( dev-libs/openssl:0 ) |
39 |
+ libressl? ( dev-libs/libressl ) |
40 |
+ ) |
41 |
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )" |
42 |
+DEPEND="${RDEPEND} |
43 |
+ doc? ( app-doc/doxygen media-gfx/graphviz ) |
44 |
+ test? ( dev-lang/perl )" |
45 |
+ |
46 |
+enable_polarssl_option() { |
47 |
+ local myopt="$@" |
48 |
+ # check that config.h syntax is the same at version bump |
49 |
+ sed -i \ |
50 |
+ -e "s://#define ${myopt}:#define ${myopt}:" \ |
51 |
+ include/polarssl/config.h || die |
52 |
+} |
53 |
+ |
54 |
+src_prepare() { |
55 |
+ use cpu_flags_x86_sse2 && enable_polarssl_option POLARSSL_HAVE_SSE2 |
56 |
+ use zlib && enable_polarssl_option POLARSSL_ZLIB_SUPPORT |
57 |
+ use havege && enable_polarssl_option POLARSSL_HAVEGE_C |
58 |
+ use threads && enable_polarssl_option POLARSSL_THREADING_C |
59 |
+ use threads && enable_polarssl_option POLARSSL_THREADING_PTHREAD |
60 |
+ |
61 |
+ epatch "${FILESDIR}"/${PN}-1.3.9-respect-cflags.patch |
62 |
+} |
63 |
+ |
64 |
+multilib_src_configure() { |
65 |
+ local mycmakeargs=( |
66 |
+ $(multilib_is_native_abi && cmake-utils_use_enable programs PROGRAMS \ |
67 |
+ || echo -DENABLE_PROGRAMS=OFF) |
68 |
+ $(cmake-utils_use_enable zlib ZLIB_SUPPORT) |
69 |
+ $(cmake-utils_use_use static-libs STATIC_POLARSSL_LIBRARY) |
70 |
+ $(cmake-utils_use_enable test TESTING) |
71 |
+ -DUSE_SHARED_POLARSSL_LIBRARY=ON |
72 |
+ -DINSTALL_POLARSSL_HEADERS=ON |
73 |
+ -DLIB_INSTALL_DIR="/usr/$(get_libdir)" |
74 |
+ ) |
75 |
+ |
76 |
+ cmake-utils_src_configure |
77 |
+} |
78 |
+ |
79 |
+multilib_src_compile() { |
80 |
+ cmake-utils_src_compile |
81 |
+ use doc && multilib_is_native_abi && emake apidoc |
82 |
+} |
83 |
+ |
84 |
+multilib_src_test() { |
85 |
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BUILD_DIR}/library" \ |
86 |
+ cmake-utils_src_test |
87 |
+} |
88 |
+ |
89 |
+multilib_src_install() { |
90 |
+ cmake-utils_src_install |
91 |
+} |
92 |
+ |
93 |
+multilib_src_install_all() { |
94 |
+ einstalldocs |
95 |
+ |
96 |
+ use doc && dohtml -r apidoc |
97 |
+ |
98 |
+ if use programs ; then |
99 |
+ # avoid file collisions with sys-apps/coreutils |
100 |
+ local p e |
101 |
+ for p in "${ED%/}"/usr/bin/* ; do |
102 |
+ if [[ -x "${p}" && ! -d "${p}" ]] ; then |
103 |
+ mv "${p}" "${ED%/}"/usr/bin/polarssl_${p##*/} || die |
104 |
+ fi |
105 |
+ done |
106 |
+ for e in aes hash pkey ssl test ; do |
107 |
+ docinto "${e}" |
108 |
+ dodoc programs/"${e}"/*.c |
109 |
+ dodoc programs/"${e}"/*.txt |
110 |
+ done |
111 |
+ fi |
112 |
+} |