summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc')
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc267
1 files changed, 267 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc b/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc
new file mode 100644
index 00000000..db768084
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq_1.1.0h.inc
@@ -0,0 +1,267 @@
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 = "makedepend-native hostperl-runtime-native"
12DEPENDS_append_class-target = " openssl-native"
13
14PROVIDES = "openssl"
15
16python() {
17 pkgs = d.getVar('PACKAGES', True).split()
18 for p in pkgs:
19 if 'openssl-qoriq' in p:
20 d.appendVar("RPROVIDES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
21 d.appendVar("RCONFLICTS_%s" % p, p.replace('openssl-qoriq', 'openssl'))
22 d.appendVar("RREPLACES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
23}
24
25SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/openssl;nobranch=1"
26
27S = "${WORKDIR}/git"
28
29PACKAGECONFIG[perl] = ",,,"
30
31TERMIO_libc-musl = "-DTERMIOS"
32TERMIO ?= "-DTERMIO"
33# Avoid binaries being marked as requiring an executable stack since it
34# doesn't(which causes and this causes issues with SELinux
35CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
36 ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
37
38export DIRS = "crypto ssl apps"
39export EX_LIBS = "-lgcc -ldl"
40export AS = "${CC} -c"
41
42inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
43
44PACKAGES =+ "libcrypto libssl ${PN}-misc ${PN}-conf"
45FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
46FILES_libssl = "${libdir}/libssl${SOLIBS}"
47FILES_${PN} =+ " ${libdir}/ssl/*"
48FILES_${PN}-misc = "${libdir}/ssl/misc"
49RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
50
51PROVIDES += "openssl10"
52
53# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
54# package RRECOMMENDS on this package. This will enable the configuration
55# file to be installed for both the base openssl package and the libcrypto
56# package since the base openssl package depends on the libcrypto package.
57FILES_${PN}-conf = "${sysconfdir}/ssl/openssl.cnf"
58CONFFILES_${PN}-conf = "${sysconfdir}/ssl/openssl.cnf"
59RRECOMMENDS_libcrypto += "${PN}-conf"
60RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
61
62# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
63# vulnerability
64EXTRA_OECONF = " -no-ssl3"
65
66do_configure_prepend_darwin () {
67 sed -i -e '/version-script=openssl\.ld/d' Configure
68}
69
70do_configure () {
71 cd util
72 perl perlpath.pl ${STAGING_BINDIR_NATIVE}
73 cd ..
74 ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
75
76 os=${HOST_OS}
77 case $os in
78 linux-uclibc |\
79 linux-uclibceabi |\
80 linux-gnueabi |\
81 linux-uclibcspe |\
82 linux-gnuspe |\
83 linux-musl*)
84 os=linux
85 ;;
86 *)
87 ;;
88 esac
89 target="$os-${HOST_ARCH}"
90 case $target in
91 linux-arm)
92 target=linux-armv4
93 ;;
94 linux-armeb)
95 target=linux-elf-armeb
96 ;;
97 linux-aarch64*)
98 target=linux-aarch64
99 ;;
100 linux-sh3)
101 target=debian-sh3
102 ;;
103 linux-sh4)
104 target=debian-sh4
105 ;;
106 linux-i486)
107 target=debian-i386-i486
108 ;;
109 linux-i586 | linux-viac3)
110 target=debian-i386-i586
111 ;;
112 linux-i686)
113 target=debian-i386-i686/cmov
114 ;;
115 linux-gnux32-x86_64)
116 target=linux-x32
117 ;;
118 linux-gnu64-x86_64)
119 target=linux-x86_64
120 ;;
121 linux-gnun32-mips*el)
122 target=debian-mipsn32el
123 ;;
124 linux-gnun32-mips*)
125 target=debian-mipsn32
126 ;;
127 linux-mips*64*el)
128 target=debian-mips64el
129 ;;
130 linux-mips*64*)
131 target=debian-mips64
132 ;;
133 linux-mips*el)
134 target=debian-mipsel
135 ;;
136 linux-mips*)
137 target=debian-mips
138 ;;
139 linux-microblaze*|linux-nios2*)
140 target=linux-generic32
141 ;;
142 linux-powerpc)
143 target=linux-ppc
144 ;;
145 linux-powerpc64)
146 target=linux-ppc64
147 ;;
148 linux-supersparc)
149 target=linux-sparcv8
150 ;;
151 linux-sparc)
152 target=linux-sparcv8
153 ;;
154 darwin-i386)
155 target=darwin-i386-cc
156 ;;
157 esac
158 # inject machine-specific flags
159 sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
160 useprefix=${prefix}
161 if [ "x$useprefix" = "x" ]; then
162 useprefix=/
163 fi
164 perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target
165}
166
167do_compile_prepend_class-target () {
168 sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
169}
170
171do_compile () {
172 oe_runmake depend
173 oe_runmake
174}
175
176do_compile_ptest () {
177 # build dependencies for test directory too
178 rm -rf test/ssltest_old
179 rm -rf test/x509aux
180 rm -rf test/v3ext
181 export DIRS="$DIRS test"
182 oe_runmake depend
183 oe_runmake buildtest
184}
185
186do_install () {
187 # Create ${D}/${prefix} to fix parallel issues
188 mkdir -p ${D}/${prefix}/
189
190 oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" DESTDIR="${D}" install
191
192 oe_libinstall -so libcrypto ${D}${libdir}
193 oe_libinstall -so libssl ${D}${libdir}
194 oe_libinstall -so capi ${D}${libdir}
195 oe_libinstall -so padlock ${D}${libdir}
196
197 install -d ${D}${includedir}
198 cp --dereference -R include/openssl ${D}${includedir}
199
200 install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
201 sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
202
203 oe_multilib_header openssl/opensslconf.h
204 if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
205 sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
206 sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
207 else
208 rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
209 fi
210
211 # Create SSL structure
212 install -d ${D}${sysconfdir}/ssl/
213 mv ${D}${libdir}/ssl/openssl.cnf \
214 ${D}${libdir}/ssl/certs \
215 ${D}${libdir}/ssl/private \
216 \
217 ${D}${sysconfdir}/ssl/
218 ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
219 ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
220 ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
221}
222
223do_install_ptest () {
224 # cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
225 cp -r -L Makefile test ${D}${PTEST_PATH}
226
227 # Replace the path to native perl with the path to target perl
228 sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
229
230 cp Configure config e_os.h ${D}${PTEST_PATH}
231 cp -r -L include ${D}${PTEST_PATH}
232 ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
233 ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
234 mkdir -p ${D}${PTEST_PATH}/crypto
235 cp include/internal/constant_time_locl.h ${D}${PTEST_PATH}/crypto
236 cp -r demos/certs ${D}${PTEST_PATH}
237 mkdir -p ${D}${PTEST_PATH}/apps
238 ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
239 ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
240 ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
241 cp apps/server.pem ${D}${PTEST_PATH}/apps
242 cp apps/server2.pem ${D}${PTEST_PATH}/apps
243 mkdir -p ${D}${PTEST_PATH}/util
244 install util/opensslwrap.sh ${D}${PTEST_PATH}/util
245 install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
246 # Time stamps are relevant for "make alltests", otherwise
247 # make may try to recompile binaries. Not only must the
248 # binary files be newer than the sources, they also must
249 # be more recent than the header files in /usr/include.
250 #
251 # Using "cp -a" is not sufficient, because do_install
252 # does not preserve the original time stamps.
253 #
254 # So instead of using the original file stamps, we set
255 # the current time for all files. Binaries will get
256 # modified again later when stripping them, but that's okay.
257 touch ${D}${PTEST_PATH}
258 find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
259}
260
261do_install_append_class-native() {
262 create_wrapper ${D}${bindir}/openssl \
263 OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
264 SSL_CERT_DIR=${libdir}/ssl/certs \
265 SSL_CERT_FILE=${libdir}/ssl/cert.pem \
266 OPENSSL_ENGINES=${libdir}/ssl/engines
267}