summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl10.inc
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2018-07-23 19:38:47 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-26 13:16:41 +0100
commitcfbe08fba26447faf7bf003ddecd8819eedeb21d (patch)
tree0585085bb288275606ba0c7b4cbc1a25cc11eeb1 /meta/recipes-connectivity/openssl/openssl10.inc
parentb22e18b7a0e5979c7f80f8ca0ce1e21c8f04aa3c (diff)
downloadpoky-cfbe08fba26447faf7bf003ddecd8819eedeb21d.tar.gz
openssl_1.0: merge openssl10.inc into the openssl_1.0.2o.bb recipe
The openssl10.inc include file only has one user, so we can improve maintainability by merging the include file into the recipe which uses it. (From OE-Core rev: f5568740d5ff72090c3ca894ddfdc3078169da25) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl10.inc')
-rw-r--r--meta/recipes-connectivity/openssl/openssl10.inc296
1 files changed, 0 insertions, 296 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl10.inc b/meta/recipes-connectivity/openssl/openssl10.inc
deleted file mode 100644
index 1f8834f2e8..0000000000
--- a/meta/recipes-connectivity/openssl/openssl10.inc
+++ /dev/null
@@ -1,296 +0,0 @@
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 += "openssl10"
15
16SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
17 "
18S = "${WORKDIR}/openssl-${PV}"
19UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar"
20
21PACKAGECONFIG ?= "cryptodev-linux"
22PACKAGECONFIG[perl] = ",,,"
23PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux"
24
25TERMIO_libc-musl = "-DTERMIOS"
26TERMIO ?= "-DTERMIO"
27# Avoid binaries being marked as requiring an executable stack since it
28# doesn't(which causes and this causes issues with SELinux
29CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
30 ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
31
32export DIRS = "crypto ssl apps"
33export EX_LIBS = "-lgcc -ldl"
34export AS = "${CC} -c"
35
36# openssl fails with ccache: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12810
37CCACHE = ""
38
39inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
40
41PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
42FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
43FILES_libssl = "${libdir}/libssl${SOLIBS}"
44FILES_${PN} =+ " ${libdir}/ssl/*"
45FILES_${PN}-misc = "${libdir}/ssl/misc"
46RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
47
48# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
49# package RRECOMMENDS on this package. This will enable the configuration
50# file to be installed for both the base openssl package and the libcrypto
51# package since the base openssl package depends on the libcrypto package.
52FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
53CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
54RRECOMMENDS_libcrypto += "openssl-conf"
55RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
56
57# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
58# vulnerability
59EXTRA_OECONF = " -no-ssl3"
60
61do_configure_prepend_darwin () {
62 sed -i -e '/version-script=openssl\.ld/d' Configure
63}
64
65do_configure () {
66 cd util
67 perl perlpath.pl ${STAGING_BINDIR_NATIVE}
68 cd ..
69 ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
70
71 os=${HOST_OS}
72 case $os in
73 linux-gnueabi |\
74 linux-gnuspe |\
75 linux-musleabi |\
76 linux-muslspe |\
77 linux-musl )
78 os=linux
79 ;;
80 *)
81 ;;
82 esac
83 target="$os-${HOST_ARCH}"
84 case $target in
85 linux-arm)
86 target=linux-armv4
87 ;;
88 linux-armeb)
89 target=linux-elf-armeb
90 ;;
91 linux-aarch64*)
92 target=linux-aarch64
93 ;;
94 linux-sh3)
95 target=debian-sh3
96 ;;
97 linux-sh4)
98 target=debian-sh4
99 ;;
100 linux-i486)
101 target=debian-i386-i486
102 ;;
103 linux-i586 | linux-viac3)
104 target=debian-i386-i586
105 ;;
106 linux-i686)
107 target=debian-i386-i686/cmov
108 ;;
109 linux-gnux32-x86_64 | linux-muslx32-x86_64 )
110 target=linux-x32
111 ;;
112 linux-gnu64-x86_64)
113 target=linux-x86_64
114 ;;
115 linux-gnun32-mips*el)
116 target=debian-mipsn32el
117 ;;
118 linux-gnun32-mips*)
119 target=debian-mipsn32
120 ;;
121 linux-mips*64*el)
122 target=debian-mips64el
123 ;;
124 linux-mips*64*)
125 target=debian-mips64
126 ;;
127 linux-mips*el)
128 target=debian-mipsel
129 ;;
130 linux-mips*)
131 target=debian-mips
132 ;;
133 linux-microblaze*|linux-nios2*|linux-gnu*ilp32**)
134 target=linux-generic32
135 ;;
136 linux-powerpc)
137 target=linux-ppc
138 ;;
139 linux-powerpc64)
140 target=linux-ppc64
141 ;;
142 linux-riscv64)
143 target=linux-generic64
144 ;;
145 linux-riscv32)
146 target=linux-generic32
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 libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
165 perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target
166}
167
168do_compile_prepend_class-target () {
169 sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
170 oe_runmake depend
171 cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
172 oe_runmake CC_INFO="${cc_sanitized}"
173}
174
175do_compile () {
176 oe_runmake depend
177 oe_runmake
178}
179
180do_compile_ptest () {
181 # build dependencies for test directory too
182 export DIRS="$DIRS test"
183 oe_runmake depend
184 oe_runmake buildtest
185}
186
187do_install () {
188 # Create ${D}/${prefix} to fix parallel issues
189 mkdir -p ${D}/${prefix}/
190
191 oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install
192
193 oe_libinstall -so libcrypto ${D}${libdir}
194 oe_libinstall -so libssl ${D}${libdir}
195
196 install -d ${D}${includedir}
197 cp --dereference -R include/openssl ${D}${includedir}
198
199 install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
200 sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
201
202 oe_multilib_header openssl/opensslconf.h
203 if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
204 sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
205 sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
206 else
207 rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
208 fi
209
210 # Create SSL structure
211 install -d ${D}${sysconfdir}/ssl/
212 mv ${D}${libdir}/ssl/openssl.cnf \
213 ${D}${libdir}/ssl/certs \
214 ${D}${libdir}/ssl/private \
215 \
216 ${D}${sysconfdir}/ssl/
217 ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
218 ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
219 ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
220
221 # Rename man pages to prefix openssl10-*
222 for f in `find ${D}${mandir} -type f`; do
223 mv $f $(dirname $f)/openssl10-$(basename $f)
224 done
225 for f in `find ${D}${mandir} -type l`; do
226 ln_f=`readlink $f`
227 rm -f $f
228 ln -s openssl10-$ln_f $(dirname $f)/openssl10-$(basename $f)
229 done
230}
231
232do_install_ptest () {
233 cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
234
235 # Replace the path to native perl with the path to target perl
236 sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
237
238 cp Configure config e_os.h ${D}${PTEST_PATH}
239 cp -r -L include ${D}${PTEST_PATH}
240 ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
241 ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
242 mkdir -p ${D}${PTEST_PATH}/crypto
243 cp crypto/constant_time_locl.h ${D}${PTEST_PATH}/crypto
244 cp -r certs ${D}${PTEST_PATH}
245 mkdir -p ${D}${PTEST_PATH}/apps
246 ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
247 ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
248 ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
249 cp apps/server.pem ${D}${PTEST_PATH}/apps
250 cp apps/server2.pem ${D}${PTEST_PATH}/apps
251 mkdir -p ${D}${PTEST_PATH}/util
252 install util/opensslwrap.sh ${D}${PTEST_PATH}/util
253 install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
254 # Time stamps are relevant for "make alltests", otherwise
255 # make may try to recompile binaries. Not only must the
256 # binary files be newer than the sources, they also must
257 # be more recent than the header files in /usr/include.
258 #
259 # Using "cp -a" is not sufficient, because do_install
260 # does not preserve the original time stamps.
261 #
262 # So instead of using the original file stamps, we set
263 # the current time for all files. Binaries will get
264 # modified again later when stripping them, but that's okay.
265 touch ${D}${PTEST_PATH}
266 find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
267
268 # exclude binary files or the package won't install
269 for d in ssltest_old v3ext x509aux; do
270 rm -rf ${D}${libdir}/${BPN}/ptest/test/$d
271 done
272
273 # Remove build host references
274 sed -i \
275 -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
276 -e 's|${DEBUG_PREFIX_MAP}||g' \
277 ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure
278}
279
280do_install_append_class-native() {
281 create_wrapper ${D}${bindir}/openssl \
282 OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
283 SSL_CERT_DIR=${libdir}/ssl/certs \
284 SSL_CERT_FILE=${libdir}/ssl/cert.pem \
285 OPENSSL_ENGINES=${libdir}/ssl/engines
286}
287
288do_install_append_class-nativesdk() {
289 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
290 install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
291}
292
293FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
294
295BBCLASSEXTEND = "native nativesdk"
296