Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "mongodb" |
| 2 | LICENSE = "SSPL-1 & Apache-2.0 & Zlib" |
| 3 | LIC_FILES_CHKSUM = "file://LICENSE-Community.txt;md5=3a865f27f11f43ecbe542d9ea387dcf1 \ |
| 4 | file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" |
| 5 | |
| 6 | DEPENDS = "openssl libpcap zlib boost curl python3 \ |
| 7 | python3-setuptools-native \ |
| 8 | python3-pyyaml-native python3-cheetah-native \ |
| 9 | python3-psutil-native python3-regex-native \ |
| 10 | " |
| 11 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 12 | inherit scons dos2unix siteinfo python3native systemd useradd |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 14 | PV = "4.4.4" |
| 15 | #v4.4.4 |
| 16 | SRCREV = "8db30a63db1a9d84bdcad0c83369623f708e0397" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 17 | SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4 \ |
| 18 | file://0001-kms-message-bump-libmongocrypto-to-v1.0.4.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \ |
| 20 | file://0001-Use-long-long-instead-of-int64_t.patch \ |
| 21 | file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \ |
| 22 | file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \ |
| 23 | file://arm64-support.patch \ |
| 24 | file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \ |
| 25 | file://0001-Support-deprecated-resolver-functions.patch \ |
| 26 | file://0003-Fix-unknown-prefix-env.patch \ |
| 27 | file://1296.patch \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 28 | file://0001-Fix-compilation-with-fno-common.patch \ |
| 29 | file://0001-stacktrace-Define-ARCH_BITS-for-x86.patch \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 30 | file://0001-include-needed-c-header.patch \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 31 | file://disable_runtime_check.patch \ |
| 32 | file://ppc64_ARCH_BITS.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 33 | " |
| 34 | SRC_URI_append_libc-musl ="\ |
| 35 | file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \ |
| 36 | file://0002-Fix-default-stack-size-to-256K.patch \ |
| 37 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ |
| 38 | " |
| 39 | |
| 40 | SRC_URI_append_toolchain-clang = "\ |
| 41 | file://0001-asio-Dont-use-experimental-with-clang.patch \ |
| 42 | " |
| 43 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 44 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 45 | S = "${WORKDIR}/git" |
| 46 | |
| 47 | COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux' |
| 48 | |
| 49 | PACKAGECONFIG ??= "tcmalloc system-pcre" |
| 50 | # gperftools compilation fails for arm below v7 because of missing support of |
| 51 | # dmb operation. So we use system-allocator instead of tcmalloc |
| 52 | PACKAGECONFIG_remove_armv6 = "tcmalloc" |
| 53 | PACKAGECONFIG_remove_libc-musl = "tcmalloc" |
| 54 | PACKAGECONFIG_remove_riscv64 = "tcmalloc" |
| 55 | PACKAGECONFIG_remove_riscv32 = "tcmalloc" |
| 56 | |
| 57 | PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools," |
| 58 | PACKAGECONFIG[shell] = ",--js-engine=none,," |
| 59 | PACKAGECONFIG[system-pcre] = "--use-system-pcre,,libpcre," |
| 60 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 61 | MONGO_ARCH ?= "${HOST_ARCH}" |
| 62 | MONGO_ARCH_powerpc64le = "ppc64le" |
| 63 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 64 | EXTRA_OESCONS = "PREFIX=${prefix} \ |
| 65 | DESTDIR=${D} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 66 | LIBPATH=${STAGING_LIBDIR} \ |
| 67 | LINKFLAGS='${LDFLAGS}' \ |
| 68 | CXXFLAGS='${CXXFLAGS}' \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 69 | TARGET_ARCH=${MONGO_ARCH} \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 70 | MONGO_VERSION=${PV} \ |
| 71 | OBJCOPY=${OBJCOPY} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 72 | --ssl \ |
| 73 | --disable-warnings-as-errors \ |
| 74 | --use-system-zlib \ |
| 75 | --nostrip \ |
| 76 | --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ |
| 77 | --wiredtiger=${@['off','on'][d.getVar('SITEINFO_BITS') != '32']} \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 78 | --separate-debug \ |
| 79 | ${PACKAGECONFIG_CONFARGS}" |
| 80 | |
| 81 | |
| 82 | USERADD_PACKAGES = "${PN}" |
| 83 | USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" |
| 84 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 85 | |
| 86 | scons_do_compile() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 87 | ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core || \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 88 | die "scons build execution failed." |
| 89 | } |
| 90 | |
| 91 | scons_do_install() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 92 | # install binaries |
| 93 | install -d ${D}${bindir} |
| 94 | for i in mongod mongos mongo |
| 95 | do |
| 96 | if [ -f ${B}/build/opt/mongo/${i} ] |
| 97 | then |
| 98 | install -m 0755 ${B}/build/opt/mongo/${i} ${D}${bindir}/${i} |
| 99 | else |
| 100 | bbnote "${i} does not exist" |
| 101 | fi |
| 102 | done |
| 103 | |
| 104 | # install config |
| 105 | install -d ${D}${sysconfdir} |
| 106 | install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir}/ |
| 107 | |
| 108 | # install systemd service |
| 109 | install -d ${D}${systemd_system_unitdir} |
| 110 | install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir} |
| 111 | |
| 112 | # install mongo data folder |
| 113 | install -m 755 -d ${D}${localstatedir}/lib/${BPN} |
| 114 | chown ${PN}:${PN} ${D}${localstatedir}/lib/${BPN} |
| 115 | |
| 116 | # Log files |
| 117 | install -m 755 -d ${D}${localstatedir}/log/${BPN} |
| 118 | chown ${PN}:${PN} ${D}${localstatedir}/log/${BPN} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 119 | } |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 120 | |
| 121 | CONFFILES_${PN} = "${sysconfdir}/mongod.conf" |
| 122 | |
| 123 | SYSTEMD_SERVICE_${PN} = "mongod.service" |