summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl.inc
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-connectivity/openssl/openssl.inc
downloadpoky-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.inc204
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 @@
1SUMMARY = "Secure Socket Layer"
2DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
3HOMEPAGE = "http://www.openssl.org/"
4BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
5SECTION = "libs/network"
6
7# "openssl | SSLeay" dual license
8LICENSE = "openssl"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
10
11DEPENDS = "perl-native-runtime"
12DEPENDS_append_class-target = " openssl-native"
13
14SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
15 "
16S = "${WORKDIR}/openssl-${PV}"
17
18PACKAGECONFIG[perl] = ",,,"
19
20AR_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
23CFLAG = "${@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
27CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}"
28CFLAG_mtx-2 := "${@'${CFLAG}'.replace('-O2', '')}"
29
30export DIRS = "crypto ssl apps"
31export EX_LIBS = "-lgcc -ldl"
32export AS = "${CC} -c"
33
34inherit pkgconfig siteinfo multilib_header ptest
35
36PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
37FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}"
38FILES_libssl = "${libdir}/libssl.so.*"
39FILES_${PN} =+ " ${libdir}/ssl/*"
40FILES_${PN}-misc = "${libdir}/ssl/misc ${bindir}/c_rehash"
41RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}"
42FILES_${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.
48FILES_openssl-conf = "${libdir}/ssl/openssl.cnf"
49CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf"
50RRECOMMENDS_libcrypto += "openssl-conf"
51RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
52
53do_configure_prepend_darwin () {
54 sed -i -e '/version-script=openssl\.ld/d' Configure
55}
56
57do_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
142do_compile_prepend_class-target () {
143 sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
144}
145
146do_compile () {
147 oe_runmake
148}
149
150do_compile_ptest () {
151 oe_runmake buildtest
152}
153
154do_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
183do_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
196do_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
204BBCLASSEXTEND = "native nativesdk"