diff options
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq.inc')
-rw-r--r-- | recipes-connectivity/openssl/openssl-qoriq.inc | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq.inc b/recipes-connectivity/openssl/openssl-qoriq.inc new file mode 100644 index 0000000..87ba1c3 --- /dev/null +++ b/recipes-connectivity/openssl/openssl-qoriq.inc | |||
@@ -0,0 +1,184 @@ | |||
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 | PROVIDES = "openssl" | ||
12 | |||
13 | python() { | ||
14 | pkgs = d.getVar('PACKAGES', True).split() | ||
15 | for p in pkgs: | ||
16 | if 'openssl-qoriq' in p: | ||
17 | d.appendVar("RPROVIDES_%s" % p, p.replace('openssl-qoriq', 'openssl')) | ||
18 | d.appendVar("RCONFLICTS_%s" % p, p.replace('openssl-qoriq', 'openssl')) | ||
19 | d.appendVar("RREPLACES_%s" % p, p.replace('openssl-qoriq', 'openssl')) | ||
20 | } | ||
21 | |||
22 | DEPENDS = "perl-native-runtime" | ||
23 | |||
24 | SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ | ||
25 | " | ||
26 | S = "${WORKDIR}/openssl-${PV}" | ||
27 | |||
28 | PACKAGECONFIG[perl] = ",,," | ||
29 | |||
30 | AR_append = " r" | ||
31 | # Avoid binaries being marked as requiring an executable stack since it | ||
32 | # doesn't(which causes and this causes issues with SELinux | ||
33 | CFLAG = "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \ | ||
34 | -DTERMIO ${CFLAGS} -Wall -Wa,--noexecstack" | ||
35 | |||
36 | # -02 does not work on mipsel: ssh hangs when it tries to read /dev/urandom | ||
37 | CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}" | ||
38 | CFLAG_mtx-2 := "${@'${CFLAG}'.replace('-O2', '')}" | ||
39 | |||
40 | export DIRS = "crypto ssl apps" | ||
41 | export EX_LIBS = "-lgcc -ldl" | ||
42 | export AS = "${CC} -c" | ||
43 | EXTRA_OEMAKE = "-e MAKEFLAGS=" | ||
44 | |||
45 | inherit pkgconfig siteinfo multilib_header | ||
46 | |||
47 | PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf" | ||
48 | FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}" | ||
49 | FILES_libssl = "${libdir}/libssl.so.*" | ||
50 | FILES_${PN} =+ " ${libdir}/ssl/*" | ||
51 | FILES_${PN}-misc = "${libdir}/ssl/misc ${bindir}/c_rehash" | ||
52 | RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" | ||
53 | FILES_${PN}-dev += "${base_libdir}/libcrypto${SOLIBSDEV}" | ||
54 | |||
55 | # Add the openssl.cnf file to the openssl-conf package. Make the libcrypto | ||
56 | # package RRECOMMENDS on this package. This will enable the configuration | ||
57 | # file to be installed for both the base openssl package and the libcrypto | ||
58 | # package since the base openssl package depends on the libcrypto package. | ||
59 | FILES_openssl-conf = "${libdir}/ssl/openssl.cnf" | ||
60 | CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf" | ||
61 | RRECOMMENDS_libcrypto += "openssl-conf" | ||
62 | |||
63 | do_configure_prepend_darwin () { | ||
64 | sed -i -e '/version-script=openssl\.ld/d' Configure | ||
65 | } | ||
66 | |||
67 | do_configure () { | ||
68 | cd util | ||
69 | perl perlpath.pl ${STAGING_BINDIR_NATIVE} | ||
70 | cd .. | ||
71 | ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/ | ||
72 | |||
73 | os=${HOST_OS} | ||
74 | if [ "x$os" = "xlinux-uclibc" ]; then | ||
75 | os=linux | ||
76 | elif [ "x$os" = "xlinux-uclibceabi" ]; then | ||
77 | os=linux | ||
78 | elif [ "x$os" = "xlinux-uclibcspe" ]; then | ||
79 | os=linux | ||
80 | elif [ "x$os" = "xlinux-gnuspe" ]; then | ||
81 | os=linux | ||
82 | elif [ "x$os" = "xlinux-gnueabi" ]; then | ||
83 | os=linux | ||
84 | fi | ||
85 | target="$os-${HOST_ARCH}" | ||
86 | case $target in | ||
87 | linux-arm) | ||
88 | target=linux-armv4 | ||
89 | ;; | ||
90 | linux-armeb) | ||
91 | target=linux-elf-armeb | ||
92 | ;; | ||
93 | linux-aarch64*) | ||
94 | target=linux-generic64 | ||
95 | ;; | ||
96 | linux-sh3) | ||
97 | target=debian-sh3 | ||
98 | ;; | ||
99 | linux-sh4) | ||
100 | target=debian-sh4 | ||
101 | ;; | ||
102 | linux-i486) | ||
103 | target=debian-i386-i486 | ||
104 | ;; | ||
105 | linux-i586 | linux-viac3) | ||
106 | target=debian-i386-i586 | ||
107 | ;; | ||
108 | linux-i686) | ||
109 | target=debian-i386-i686/cmov | ||
110 | ;; | ||
111 | linux-gnux32-x86_64) | ||
112 | target=linux-x32 | ||
113 | ;; | ||
114 | linux-gnu64-x86_64) | ||
115 | target=linux-x86_64 | ||
116 | ;; | ||
117 | linux-mips) | ||
118 | target=debian-mips | ||
119 | ;; | ||
120 | linux-mipsel) | ||
121 | target=debian-mipsel | ||
122 | ;; | ||
123 | linux-*-mips64) | ||
124 | target=linux-mips | ||
125 | ;; | ||
126 | linux-powerpc) | ||
127 | target=linux-ppc | ||
128 | ;; | ||
129 | linux-powerpc64) | ||
130 | target=linux-ppc64 | ||
131 | ;; | ||
132 | linux-supersparc) | ||
133 | target=linux-sparcv8 | ||
134 | ;; | ||
135 | linux-sparc) | ||
136 | target=linux-sparcv8 | ||
137 | ;; | ||
138 | darwin-i386) | ||
139 | target=darwin-i386-cc | ||
140 | ;; | ||
141 | esac | ||
142 | # inject machine-specific flags | ||
143 | sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure | ||
144 | useprefix=${prefix} | ||
145 | if [ "x$useprefix" = "x" ]; then | ||
146 | useprefix=/ | ||
147 | fi | ||
148 | perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target | ||
149 | } | ||
150 | |||
151 | do_compile () { | ||
152 | oe_runmake | ||
153 | } | ||
154 | |||
155 | do_install () { | ||
156 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install | ||
157 | |||
158 | oe_libinstall -so libcrypto ${D}${libdir} | ||
159 | oe_libinstall -so libssl ${D}${libdir} | ||
160 | |||
161 | # Moving libcrypto to /lib | ||
162 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then | ||
163 | mkdir -p ${D}/${base_libdir}/ | ||
164 | mv ${D}${libdir}/libcrypto* ${D}${base_libdir}/ | ||
165 | sed -i s#libdir=\$\{exec_prefix\}\/lib#libdir=${base_libdir}# ${D}/${libdir}/pkgconfig/libcrypto.pc | ||
166 | fi | ||
167 | |||
168 | install -d ${D}${includedir} | ||
169 | cp --dereference -R include/openssl ${D}${includedir} | ||
170 | |||
171 | oe_multilib_header openssl/opensslconf.h | ||
172 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then | ||
173 | install -m 0755 ${S}/tools/c_rehash ${D}${bindir} | ||
174 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${bindir}/c_rehash | ||
175 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl | ||
176 | sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget | ||
177 | # The c_rehash utility isn't installed by the normal installation process. | ||
178 | else | ||
179 | rm -f ${D}${bindir}/c_rehash | ||
180 | rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget | ||
181 | fi | ||
182 | } | ||
183 | |||
184 | BBCLASSEXTEND = "native nativesdk" | ||