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 | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 14 | PV = "4.4.1" |
| 15 | #v4.4.1 |
| 16 | SRCREV = "ad91a93a5a31e175f5cbf8c69561e788bbc55ce1" |
| 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 | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 31 | " |
| 32 | SRC_URI_append_libc-musl ="\ |
| 33 | file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \ |
| 34 | file://0002-Fix-default-stack-size-to-256K.patch \ |
| 35 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ |
| 36 | " |
| 37 | |
| 38 | SRC_URI_append_toolchain-clang = "\ |
| 39 | file://0001-asio-Dont-use-experimental-with-clang.patch \ |
| 40 | " |
| 41 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 42 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | S = "${WORKDIR}/git" |
| 44 | |
| 45 | COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux' |
| 46 | |
| 47 | PACKAGECONFIG ??= "tcmalloc system-pcre" |
| 48 | # gperftools compilation fails for arm below v7 because of missing support of |
| 49 | # dmb operation. So we use system-allocator instead of tcmalloc |
| 50 | PACKAGECONFIG_remove_armv6 = "tcmalloc" |
| 51 | PACKAGECONFIG_remove_libc-musl = "tcmalloc" |
| 52 | PACKAGECONFIG_remove_riscv64 = "tcmalloc" |
| 53 | PACKAGECONFIG_remove_riscv32 = "tcmalloc" |
| 54 | |
| 55 | PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools," |
| 56 | PACKAGECONFIG[shell] = ",--js-engine=none,," |
| 57 | PACKAGECONFIG[system-pcre] = "--use-system-pcre,,libpcre," |
| 58 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 59 | EXTRA_OESCONS = "PREFIX=${prefix} \ |
| 60 | DESTDIR=${D} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 61 | LIBPATH=${STAGING_LIBDIR} \ |
| 62 | LINKFLAGS='${LDFLAGS}' \ |
| 63 | CXXFLAGS='${CXXFLAGS}' \ |
| 64 | TARGET_ARCH=${TARGET_ARCH} \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 65 | MONGO_VERSION=${PV} \ |
| 66 | OBJCOPY=${OBJCOPY} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 67 | --ssl \ |
| 68 | --disable-warnings-as-errors \ |
| 69 | --use-system-zlib \ |
| 70 | --nostrip \ |
| 71 | --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ |
| 72 | --wiredtiger=${@['off','on'][d.getVar('SITEINFO_BITS') != '32']} \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 73 | --separate-debug \ |
| 74 | ${PACKAGECONFIG_CONFARGS}" |
| 75 | |
| 76 | |
| 77 | USERADD_PACKAGES = "${PN}" |
| 78 | USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" |
| 79 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 80 | |
| 81 | scons_do_compile() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 82 | ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core || \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 83 | die "scons build execution failed." |
| 84 | } |
| 85 | |
| 86 | scons_do_install() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 87 | # install binaries |
| 88 | install -d ${D}${bindir} |
| 89 | for i in mongod mongos mongo |
| 90 | do |
| 91 | if [ -f ${B}/build/opt/mongo/${i} ] |
| 92 | then |
| 93 | install -m 0755 ${B}/build/opt/mongo/${i} ${D}${bindir}/${i} |
| 94 | else |
| 95 | bbnote "${i} does not exist" |
| 96 | fi |
| 97 | done |
| 98 | |
| 99 | # install config |
| 100 | install -d ${D}${sysconfdir} |
| 101 | install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir}/ |
| 102 | |
| 103 | # install systemd service |
| 104 | install -d ${D}${systemd_system_unitdir} |
| 105 | install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir} |
| 106 | |
| 107 | # install mongo data folder |
| 108 | install -m 755 -d ${D}${localstatedir}/lib/${BPN} |
| 109 | chown ${PN}:${PN} ${D}${localstatedir}/lib/${BPN} |
| 110 | |
| 111 | # Log files |
| 112 | install -m 755 -d ${D}${localstatedir}/log/${BPN} |
| 113 | chown ${PN}:${PN} ${D}${localstatedir}/log/${BPN} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 114 | } |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 115 | |
| 116 | CONFFILES_${PN} = "${sysconfdir}/mongod.conf" |
| 117 | |
| 118 | SYSTEMD_SERVICE_${PN} = "mongod.service" |
| 119 | |
| 120 | |