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