diff options
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl.inc')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl.inc | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl.inc b/meta/recipes-connectivity/openssl/openssl.inc new file mode 100644 index 0000000000..ff08cca302 --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl.inc | |||
@@ -0,0 +1,170 @@ | |||
1 | SUMMARY = "Secure Socket Layer" | ||
2 | DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." | ||
3 | HOMEPAGE = "http://www.openssl.org/" | ||
4 | BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" | ||
5 | SECTION = "libs/network" | ||
6 | |||
7 | # Big Jump for OpenSSL 1.0 support with meta-oe | ||
8 | INC_PR = "r15" | ||
9 | |||
10 | # "openssl | SSLeay" dual license | ||
11 | LICENSE = "openssl" | ||
12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8" | ||
13 | |||
14 | DEPENDS = "perl-native-runtime" | ||
15 | |||
16 | SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ | ||
17 | " | ||
18 | S = "${WORKDIR}/openssl-${PV}" | ||
19 | |||
20 | AR_append = " r" | ||
21 | # Avoid binaries being marked as requiring an executable stack since it | ||
22 | # doesn't(which causes and this causes issues with SELinux | ||
23 | CFLAG = "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \ | ||
24 | -DTERMIO ${CFLAGS} -Wall -Wa,--noexecstack" | ||
25 | |||
26 | # -02 does not work on mipsel: ssh hangs when it tries to read /dev/urandom | ||
27 | CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}" | ||
28 | CFLAG_mtx-2 := "${@'${CFLAG}'.replace('-O2', '')}" | ||
29 | |||
30 | export DIRS = "crypto ssl apps" | ||
31 | export EX_LIBS = "-lgcc -ldl" | ||
32 | export AS = "${CC} -c" | ||
33 | |||
34 | inherit pkgconfig siteinfo multilib_header ptest | ||
35 | |||
36 | PACKAGES =+ "libcrypto libssl ${PN}-misc" | ||
37 | FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}" | ||
38 | FILES_libssl = "${libdir}/libssl.so.*" | ||
39 | FILES_${PN} =+ " ${libdir}/ssl/*" | ||
40 | FILES_${PN}-misc = "${libdir}/ssl/misc ${libdir}/ssl/openssl.cnf" | ||
41 | FILES_${PN}-dev += "${base_libdir}/libcrypto${SOLIBSDEV}" | ||
42 | |||
43 | RDEPENDS_${PN}-ptest = "openssl-misc" | ||
44 | |||
45 | do_configure_prepend_darwin () { | ||
46 | sed -i -e '/version-script=openssl\.ld/d' Configure | ||
47 | } | ||
48 | |||
49 | do_configure () { | ||
50 | cd util | ||
51 | perl perlpath.pl ${STAGING_BINDIR_NATIVE} | ||
52 | cd .. | ||
53 | ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/ | ||
54 | |||
55 | os=${HOST_OS} | ||
56 | if [ "x$os" = "xlinux-uclibc" ]; then | ||
57 | os=linux | ||
58 | elif [ "x$os" = "xlinux-uclibceabi" ]; then | ||
59 | os=linux | ||
60 | elif [ "x$os" = "xlinux-gnueabi" ]; then | ||
61 | os=linux | ||
62 | fi | ||
63 | target="$os-${HOST_ARCH}" | ||
64 | case $target in | ||
65 | linux-arm) | ||
66 | target=linux-elf-arm | ||
67 | ;; | ||
68 | linux-armeb) | ||
69 | target=linux-elf-armeb | ||
70 | ;; | ||
71 | linux-sh3) | ||
72 | target=debian-sh3 | ||
73 | ;; | ||
74 | linux-sh4) | ||
75 | target=debian-sh4 | ||
76 | ;; | ||
77 | linux-i486) | ||
78 | target=debian-i386-i486 | ||
79 | ;; | ||
80 | linux-i586 | linux-viac3) | ||
81 | target=debian-i386-i586 | ||
82 | ;; | ||
83 | linux-i686) | ||
84 | target=debian-i386-i686/cmov | ||
85 | ;; | ||
86 | linux-gnux32-x86_64) | ||
87 | target=linux-x32 | ||
88 | ;; | ||
89 | linux-gnu64-x86_64) | ||
90 | target=linux-x86_64 | ||
91 | ;; | ||
92 | linux-mips) | ||
93 | target=debian-mips | ||
94 | ;; | ||
95 | linux-mipsel) | ||
96 | target=debian-mipsel | ||
97 | ;; | ||
98 | linux-*-mips64) | ||
99 | target=linux-mips | ||
100 | ;; | ||
101 | linux-powerpc) | ||
102 | target=linux-ppc | ||
103 | ;; | ||
104 | linux-gnuspe-powerpc) | ||
105 | target=linux-ppc | ||
106 | ;; | ||
107 | linux-powerpc64) | ||
108 | target=linux-ppc64 | ||
109 | ;; | ||
110 | linux-supersparc) | ||
111 | target=linux-sparcv8 | ||
112 | ;; | ||
113 | linux-sparc) | ||
114 | target=linux-sparcv8 | ||
115 | ;; | ||
116 | darwin-i386) | ||
117 | target=darwin-i386-cc | ||
118 | ;; | ||
119 | esac | ||
120 | # inject machine-specific flags | ||
121 | sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure | ||
122 | useprefix=${prefix} | ||
123 | if [ "x$useprefix" = "x" ]; then | ||
124 | useprefix=/ | ||
125 | fi | ||
126 | perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target | ||
127 | } | ||
128 | |||
129 | do_compile () { | ||
130 | oe_runmake | ||
131 | } | ||
132 | |||
133 | do_compile_ptest () { | ||
134 | oe_runmake buildtest | ||
135 | } | ||
136 | |||
137 | do_install () { | ||
138 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install | ||
139 | |||
140 | oe_libinstall -so libcrypto ${D}${libdir} | ||
141 | oe_libinstall -so libssl ${D}${libdir} | ||
142 | |||
143 | # Moving libcrypto to /lib | ||
144 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then | ||
145 | mkdir -p ${D}/${base_libdir}/ | ||
146 | mv ${D}${libdir}/libcrypto* ${D}${base_libdir}/ | ||
147 | sed -i s#libdir=\$\{exec_prefix\}\/lib#libdir=${base_libdir}# ${D}/${libdir}/pkgconfig/libcrypto.pc | ||
148 | fi | ||
149 | |||
150 | install -d ${D}${includedir} | ||
151 | cp --dereference -R include/openssl ${D}${includedir} | ||
152 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl | ||
153 | |||
154 | oe_multilib_header openssl/opensslconf.h | ||
155 | } | ||
156 | |||
157 | do_install_ptest () { | ||
158 | cp -r Makefile test ${D}${PTEST_PATH} | ||
159 | mkdir -p ${D}${PTEST_PATH}/apps | ||
160 | ln -sf /usr/lib/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps | ||
161 | ln -sf /usr/lib/ssl/openssl.cnf ${D}${PTEST_PATH}/apps | ||
162 | ln -sf /usr/bin/openssl ${D}${PTEST_PATH}/apps | ||
163 | cp apps/server2.pem ${D}${PTEST_PATH}/apps | ||
164 | mkdir -p ${D}${PTEST_PATH}/util | ||
165 | install util/opensslwrap.sh ${D}${PTEST_PATH}/util | ||
166 | install util/shlib_wrap.sh ${D}${PTEST_PATH}/util | ||
167 | } | ||
168 | |||
169 | BBCLASSEXTEND = "native nativesdk" | ||
170 | |||