diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-connectivity/openssl/openssl.inc | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl.inc')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl.inc | 204 |
1 files changed, 204 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..31dfd8fea7 --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl.inc | |||
@@ -0,0 +1,204 @@ | |||
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 | # "openssl | SSLeay" dual license | ||
8 | LICENSE = "openssl" | ||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8" | ||
10 | |||
11 | DEPENDS = "perl-native-runtime" | ||
12 | DEPENDS_append_class-target = " openssl-native" | ||
13 | |||
14 | SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ | ||
15 | " | ||
16 | S = "${WORKDIR}/openssl-${PV}" | ||
17 | |||
18 | PACKAGECONFIG[perl] = ",,," | ||
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 openssl-conf" | ||
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 ${bindir}/c_rehash" | ||
41 | RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" | ||
42 | FILES_${PN}-dev += "${base_libdir}/libcrypto${SOLIBSDEV}" | ||
43 | |||
44 | # Add the openssl.cnf file to the openssl-conf package. Make the libcrypto | ||
45 | # package RRECOMMENDS on this package. This will enable the configuration | ||
46 | # file to be installed for both the base openssl package and the libcrypto | ||
47 | # package since the base openssl package depends on the libcrypto package. | ||
48 | FILES_openssl-conf = "${libdir}/ssl/openssl.cnf" | ||
49 | CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf" | ||
50 | RRECOMMENDS_libcrypto += "openssl-conf" | ||
51 | RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc" | ||
52 | |||
53 | do_configure_prepend_darwin () { | ||
54 | sed -i -e '/version-script=openssl\.ld/d' Configure | ||
55 | } | ||
56 | |||
57 | do_configure () { | ||
58 | cd util | ||
59 | perl perlpath.pl ${STAGING_BINDIR_NATIVE} | ||
60 | cd .. | ||
61 | ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/ | ||
62 | |||
63 | os=${HOST_OS} | ||
64 | case $os in | ||
65 | linux-uclibc |\ | ||
66 | linux-uclibceabi |\ | ||
67 | linux-gnueabi |\ | ||
68 | linux-uclibcspe |\ | ||
69 | linux-gnuspe |\ | ||
70 | linux-musl*) | ||
71 | os=linux | ||
72 | ;; | ||
73 | *) | ||
74 | ;; | ||
75 | esac | ||
76 | target="$os-${HOST_ARCH}" | ||
77 | case $target in | ||
78 | linux-arm) | ||
79 | target=linux-armv4 | ||
80 | ;; | ||
81 | linux-armeb) | ||
82 | target=linux-elf-armeb | ||
83 | ;; | ||
84 | linux-aarch64*) | ||
85 | target=linux-generic64 | ||
86 | ;; | ||
87 | linux-sh3) | ||
88 | target=debian-sh3 | ||
89 | ;; | ||
90 | linux-sh4) | ||
91 | target=debian-sh4 | ||
92 | ;; | ||
93 | linux-i486) | ||
94 | target=debian-i386-i486 | ||
95 | ;; | ||
96 | linux-i586 | linux-viac3) | ||
97 | target=debian-i386-i586 | ||
98 | ;; | ||
99 | linux-i686) | ||
100 | target=debian-i386-i686/cmov | ||
101 | ;; | ||
102 | linux-gnux32-x86_64) | ||
103 | target=linux-x32 | ||
104 | ;; | ||
105 | linux-gnu64-x86_64) | ||
106 | target=linux-x86_64 | ||
107 | ;; | ||
108 | linux-mips) | ||
109 | target=debian-mips | ||
110 | ;; | ||
111 | linux-mipsel) | ||
112 | target=debian-mipsel | ||
113 | ;; | ||
114 | linux-*-mips64) | ||
115 | target=linux-mips | ||
116 | ;; | ||
117 | linux-powerpc) | ||
118 | target=linux-ppc | ||
119 | ;; | ||
120 | linux-powerpc64) | ||
121 | target=linux-ppc64 | ||
122 | ;; | ||
123 | linux-supersparc) | ||
124 | target=linux-sparcv8 | ||
125 | ;; | ||
126 | linux-sparc) | ||
127 | target=linux-sparcv8 | ||
128 | ;; | ||
129 | darwin-i386) | ||
130 | target=darwin-i386-cc | ||
131 | ;; | ||
132 | esac | ||
133 | # inject machine-specific flags | ||
134 | sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure | ||
135 | useprefix=${prefix} | ||
136 | if [ "x$useprefix" = "x" ]; then | ||
137 | useprefix=/ | ||
138 | fi | ||
139 | perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target | ||
140 | } | ||
141 | |||
142 | do_compile_prepend_class-target () { | ||
143 | sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile | ||
144 | } | ||
145 | |||
146 | do_compile () { | ||
147 | oe_runmake | ||
148 | } | ||
149 | |||
150 | do_compile_ptest () { | ||
151 | oe_runmake buildtest | ||
152 | } | ||
153 | |||
154 | do_install () { | ||
155 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install | ||
156 | |||
157 | oe_libinstall -so libcrypto ${D}${libdir} | ||
158 | oe_libinstall -so libssl ${D}${libdir} | ||
159 | |||
160 | # Moving libcrypto to /lib | ||
161 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then | ||
162 | mkdir -p ${D}/${base_libdir}/ | ||
163 | mv ${D}${libdir}/libcrypto* ${D}${base_libdir}/ | ||
164 | sed -i s#libdir=\$\{exec_prefix\}\/lib#libdir=${base_libdir}# ${D}/${libdir}/pkgconfig/libcrypto.pc | ||
165 | fi | ||
166 | |||
167 | install -d ${D}${includedir} | ||
168 | cp --dereference -R include/openssl ${D}${includedir} | ||
169 | |||
170 | oe_multilib_header openssl/opensslconf.h | ||
171 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then | ||
172 | install -m 0755 ${S}/tools/c_rehash ${D}${bindir} | ||
173 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${bindir}/c_rehash | ||
174 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl | ||
175 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget | ||
176 | # The c_rehash utility isn't installed by the normal installation process. | ||
177 | else | ||
178 | rm -f ${D}${bindir}/c_rehash | ||
179 | rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget | ||
180 | fi | ||
181 | } | ||
182 | |||
183 | do_install_ptest () { | ||
184 | cp -r Makefile test ${D}${PTEST_PATH} | ||
185 | cp -r certs ${D}${PTEST_PATH} | ||
186 | mkdir -p ${D}${PTEST_PATH}/apps | ||
187 | ln -sf /usr/lib/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps | ||
188 | ln -sf /usr/lib/ssl/openssl.cnf ${D}${PTEST_PATH}/apps | ||
189 | ln -sf /usr/bin/openssl ${D}${PTEST_PATH}/apps | ||
190 | cp apps/server2.pem ${D}${PTEST_PATH}/apps | ||
191 | mkdir -p ${D}${PTEST_PATH}/util | ||
192 | install util/opensslwrap.sh ${D}${PTEST_PATH}/util | ||
193 | install util/shlib_wrap.sh ${D}${PTEST_PATH}/util | ||
194 | } | ||
195 | |||
196 | do_install_append_virtclass-native() { | ||
197 | create_wrapper ${D}${bindir}/openssl \ | ||
198 | OPENSSL_CONF=${libdir}/ssl/openssl.cnf \ | ||
199 | SSL_CERT_DIR=${libdir}/ssl/certs \ | ||
200 | SSL_CERT_FILE=${libdir}/ssl/cert.pem \ | ||
201 | OPENSSL_ENGINES=${libdir}/ssl/engines | ||
202 | } | ||
203 | |||
204 | BBCLASSEXTEND = "native nativesdk" | ||