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