Brad Bishop | 220d553 | 2018-08-14 00:59:39 +0100 | [diff] [blame^] | 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=d57d511030c9d66ef5f5966bee5a7eff" |
| 10 | |
| 11 | DEPENDS = "hostperl-runtime-native" |
| 12 | |
| 13 | SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ |
| 14 | file://run-ptest \ |
| 15 | file://openssl-c_rehash.sh \ |
| 16 | file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \ |
| 17 | " |
| 18 | |
| 19 | SRC_URI_append_class-nativesdk = " \ |
| 20 | file://environment.d-openssl.sh \ |
| 21 | " |
| 22 | |
| 23 | SRC_URI[md5sum] = "9495126aafd2659d357ea66a969c3fe1" |
| 24 | SRC_URI[sha256sum] = "ebbfc844a8c8cc0ea5dc10b86c9ce97f401837f3fa08c17b2cdadc118253cf99" |
| 25 | |
| 26 | inherit lib_package multilib_header ptest |
| 27 | |
| 28 | #| engines/afalg/e_afalg.c: In function 'eventfd': |
| 29 | #| engines/afalg/e_afalg.c:110:20: error: '__NR_eventfd' undeclared (first use in this function) |
| 30 | #| return syscall(__NR_eventfd, n); |
| 31 | #| ^~~~~~~~~~~~ |
| 32 | EXTRA_OECONF_append_aarch64 = " no-afalgeng" |
| 33 | |
| 34 | #| ./libcrypto.so: undefined reference to `getcontext' |
| 35 | #| ./libcrypto.so: undefined reference to `setcontext' |
| 36 | #| ./libcrypto.so: undefined reference to `makecontext' |
| 37 | EXTRA_OECONF_append_libc-musl = " -DOPENSSL_NO_ASYNC" |
| 38 | |
| 39 | do_configure () { |
| 40 | os=${HOST_OS} |
| 41 | case $os in |
| 42 | linux-gnueabi |\ |
| 43 | linux-gnuspe |\ |
| 44 | linux-musleabi |\ |
| 45 | linux-muslspe |\ |
| 46 | linux-musl ) |
| 47 | os=linux |
| 48 | ;; |
| 49 | *) |
| 50 | ;; |
| 51 | esac |
| 52 | target="$os-${HOST_ARCH}" |
| 53 | case $target in |
| 54 | linux-arm) |
| 55 | target=linux-armv4 |
| 56 | ;; |
| 57 | linux-armeb) |
| 58 | target=linux-armv4 |
| 59 | ;; |
| 60 | linux-aarch64*) |
| 61 | target=linux-aarch64 |
| 62 | ;; |
| 63 | linux-sh3) |
| 64 | target=linux-generic32 |
| 65 | ;; |
| 66 | linux-sh4) |
| 67 | target=linux-generic32 |
| 68 | ;; |
| 69 | linux-i486) |
| 70 | target=linux-elf |
| 71 | ;; |
| 72 | linux-i586 | linux-viac3) |
| 73 | target=linux-elf |
| 74 | ;; |
| 75 | linux-i686) |
| 76 | target=linux-elf |
| 77 | ;; |
| 78 | linux-gnux32-x86_64 | linux-muslx32-x86_64 ) |
| 79 | target=linux-x32 |
| 80 | ;; |
| 81 | linux-gnu64-x86_64) |
| 82 | target=linux-x86_64 |
| 83 | ;; |
| 84 | linux-mips) |
| 85 | # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags |
| 86 | target="linux-mips32 ${TARGET_CC_ARCH}" |
| 87 | ;; |
| 88 | linux-mipsel) |
| 89 | target="linux-mips32 ${TARGET_CC_ARCH}" |
| 90 | ;; |
| 91 | linux-gnun32-mips*) |
| 92 | target=linux-mips64 |
| 93 | ;; |
| 94 | linux-*-mips64 | linux-mips64) |
| 95 | target=linux64-mips64 |
| 96 | ;; |
| 97 | linux-*-mips64el | linux-mips64el) |
| 98 | target=linux64-mips64 |
| 99 | ;; |
| 100 | linux-microblaze*|linux-nios2*) |
| 101 | target=linux-generic32 |
| 102 | ;; |
| 103 | linux-powerpc) |
| 104 | target=linux-ppc |
| 105 | ;; |
| 106 | linux-powerpc64) |
| 107 | target=linux-ppc64 |
| 108 | ;; |
| 109 | linux-riscv32) |
| 110 | target=linux-generic32 |
| 111 | ;; |
| 112 | linux-riscv64) |
| 113 | target=linux-generic64 |
| 114 | ;; |
| 115 | linux-supersparc) |
| 116 | target=linux-sparcv9 |
| 117 | ;; |
| 118 | linux-sparc) |
| 119 | target=linux-sparcv9 |
| 120 | ;; |
| 121 | darwin-i386) |
| 122 | target=darwin-i386-cc |
| 123 | ;; |
| 124 | esac |
| 125 | |
| 126 | useprefix=${prefix} |
| 127 | if [ "x$useprefix" = "x" ]; then |
| 128 | useprefix=/ |
| 129 | fi |
| 130 | libdirleaf="$(echo ${libdir} | sed s:$useprefix::)" |
| 131 | perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=$libdirleaf $target |
| 132 | } |
| 133 | |
| 134 | do_install () { |
| 135 | oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install |
| 136 | oe_multilib_header openssl/opensslconf.h |
| 137 | } |
| 138 | |
| 139 | do_install_append_class-native () { |
| 140 | # Install a custom version of c_rehash that can handle sysroots properly. |
| 141 | # This version is used for example when installing ca-certificates during |
| 142 | # image creation. |
| 143 | install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash |
| 144 | sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash |
| 145 | } |
| 146 | |
| 147 | do_install_append_class-nativesdk () { |
| 148 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 149 | install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh |
| 150 | } |
| 151 | |
| 152 | do_install_ptest() { |
| 153 | cp -r * ${D}${PTEST_PATH} |
| 154 | |
| 155 | # Putting .so files in ptest package will mess up the dependencies of the main openssl package |
| 156 | # so we rename them to .so.ptest and patch the test accordingly |
| 157 | mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest |
| 158 | mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest |
| 159 | sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t |
| 160 | } |
| 161 | |
| 162 | PACKAGES =+ "${PN}-engines" |
| 163 | |
| 164 | FILES_${PN} =+ "${libdir}/ssl-1.1/*" |
| 165 | FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" |
| 166 | FILES_${PN}-engines = "${libdir}/engines-1.1" |
| 167 | |
| 168 | RDEPENDS_${PN}-ptest += "perl-module-file-spec-functions bash python" |
| 169 | |
| 170 | BBCLASSEXTEND = "native nativesdk" |