From f7f82bfd40c0f98e22c11e19fb8fa02f8f17f1f8 Mon Sep 17 00:00:00 2001 From: Laszlo Valko Date: Wed, 20 Nov 2019 02:16:20 +0100 Subject: [PATCH] Added mongodb-3.4.16. --- app-admin/mongo-tools/Manifest | 2 + .../mongo-tools/mongo-tools-3.4.16.ebuild | 60 +++++++ dev-db/mongodb/Manifest | 5 + .../files/mongodb-3.4.0-fix-scons.patch | 35 ++++ .../mongodb-3.4.6-sysmacros-include.patch | 38 +++++ .../files/mongodb-3.4.7-no-boost-check.patch | 13 ++ dev-db/mongodb/mongodb-3.4.16.ebuild | 160 ++++++++++++++++++ 7 files changed, 313 insertions(+) create mode 100644 app-admin/mongo-tools/Manifest create mode 100644 app-admin/mongo-tools/mongo-tools-3.4.16.ebuild create mode 100644 dev-db/mongodb/Manifest create mode 100644 dev-db/mongodb/files/mongodb-3.4.0-fix-scons.patch create mode 100644 dev-db/mongodb/files/mongodb-3.4.6-sysmacros-include.patch create mode 100644 dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch create mode 100644 dev-db/mongodb/mongodb-3.4.16.ebuild diff --git a/app-admin/mongo-tools/Manifest b/app-admin/mongo-tools/Manifest new file mode 100644 index 0000000..1792207 --- /dev/null +++ b/app-admin/mongo-tools/Manifest @@ -0,0 +1,2 @@ +DIST mongo-tools-3.4.16.tar.gz 4697191 BLAKE2B 2e9a0e7dc8016d3e7d7c7f8d0cf80a97d3d199603c0b8b791df5a0d79d418ffaa232eee694047a7ca11fa7623023b4123becd437cfe3dec11e26cd525720bcad SHA512 b40c6dee75d860de1da73faf79f5f68c098ce7c80681486c66fff04a937474dcede91c7be907a8e36033b3898f7499e8f53271944c0df3360756c27361efb6f5 +EBUILD mongo-tools-3.4.16.ebuild 1191 BLAKE2B 0765a673d50d0d7c8a8dae14e28f5aa27f0bd5896273386700ea3a1e743514f248ed195208b0e4036ffddfe9955471cae138e03502d1e1a5405f5dba2f019663 SHA512 dcf2017a3bd22d0c45d99cf30810d4de6c577a9c9056df1bb2faf8c0466b1018444cb887b76f5711b30f845a9d46d4c03b8aac86be54aaf6d57c34b4715a613b diff --git a/app-admin/mongo-tools/mongo-tools-3.4.16.ebuild b/app-admin/mongo-tools/mongo-tools-3.4.16.ebuild new file mode 100644 index 0000000..2888ce9 --- /dev/null +++ b/app-admin/mongo-tools/mongo-tools-3.4.16.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +MY_PV=${PV/_rc/-rc} +MY_P=${PN}-r${MY_PV} + +DESCRIPTION="A high-performance, open source, schema-free document-oriented database" +HOMEPAGE="https://www.mongodb.com" +SRC_URI="https://github.com/mongodb/mongo-tools/archive/r${MY_PV}.tar.gz -> mongo-tools-${MY_PV}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64" +IUSE="sasl ssl" + +RDEPEND="! +Date: Mon, 26 Jun 2017 11:09:10 -0400 +Subject: [PATCH] SERVER-29855 Pull major/minor from sys/sysmacros.h + +Per newer versions of glibc: + +---- +error: In the GNU C Library, "major" is defined + by . For historical compatibility, it is + currently defined by as well, but we plan to + remove this soon. To use "major", include + directly. If you did not intend to use a system-defined macro + "major", you should undefine it after including . [-Werror] + string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev) +---- + +Including appears to be the correct solution to quiet +the warning +--- + src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp +index 5a784b25dc7..c43e148d3f4 100644 +--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp ++++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp +@@ -36,6 +36,10 @@ + #include + #include + ++#ifdef __linux__ ++#include ++#endif ++ + #include "mongo/db/mongod_options.h" + #include "mongo/db/storage/mmap_v1/data_file_sync.h" + #include "mongo/db/storage/mmap_v1/dur.h" diff --git a/dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch b/dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch new file mode 100644 index 0000000..1d908e7 --- /dev/null +++ b/dev-db/mongodb/files/mongodb-3.4.7-no-boost-check.patch @@ -0,0 +1,13 @@ +diff --git a/SConstruct b/SConstruct +index df92e41659..2c387d5a24 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -2831,8 +2831,6 @@ def doConfigure(myenv): + if use_system_version_of_library("boost"): + if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ): + myenv.ConfError("can't find boost headers") +- if not conf.CheckBoostMinVersion(): +- myenv.ConfError("system's version of boost is too old. version 1.49 or better required") + + # Note that on Windows with using-system-boost builds, the following + # FindSysLibDep calls do nothing useful (but nothing problematic either) diff --git a/dev-db/mongodb/mongodb-3.4.16.ebuild b/dev-db/mongodb/mongodb-3.4.16.ebuild new file mode 100644 index 0000000..574ba25 --- /dev/null +++ b/dev-db/mongodb/mongodb-3.4.16.ebuild @@ -0,0 +1,160 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) + +SCONS_MIN_VERSION="2.3.0" +CHECKREQS_DISK_BUILD="2400M" +CHECKREQS_DISK_USR="512M" +CHECKREQS_MEMORY="1024M" + +inherit check-reqs eapi7-ver eutils flag-o-matic multilib multiprocessing pax-utils python-single-r1 scons-utils systemd toolchain-funcs user + +MY_P=${PN}-src-r${PV/_rc/-rc} + +DESCRIPTION="A high-performance, open source, schema-free document-oriented database" +HOMEPAGE="https://www.mongodb.com" +SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" + +LICENSE="AGPL-3 Apache-2.0" +SLOT="0" +KEYWORDS="amd64" +IUSE="debug kerberos libressl mms-agent ssl test +tools" + +RDEPEND=">=app-arch/snappy-1.1.3 + >=dev-cpp/yaml-cpp-0.5.3:= + >=dev-libs/boost-1.60:=[threads(+)] + >=dev-libs/libpcre-8.41[cxx] + dev-libs/snowball-stemmer + net-libs/libpcap + >=sys-libs/zlib-1.2.8:= + kerberos? ( dev-libs/cyrus-sasl[kerberos] ) + mms-agent? ( app-admin/mms-agent ) + ssl? ( + !libressl? ( >=dev-libs/openssl-1.0.1g:0= ) + libressl? ( dev-libs/libressl:0= ) + )" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + dev-util/scons + sys-libs/ncurses:0= + sys-libs/readline:0= + debug? ( dev-util/valgrind ) + test? ( + dev-python/pymongo[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + )" +PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )" + +PATCHES=( + "${FILESDIR}/${PN}-3.4.0-fix-scons.patch" + "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch" + "${FILESDIR}/${PN}-3.4.7-no-boost-check.patch" +) + +S=${WORKDIR}/${MY_P} + +pkg_pretend() { + if [[ -n ${REPLACING_VERSIONS} ]]; then + if ver_test "$REPLACING_VERSIONS" -lt 3.2; then + ewarn "To upgrade from a version earlier than the 3.2-series, you must" + ewarn "successively upgrade major releases until you have upgraded" + ewarn "to 3.2-series. Then upgrade to 3.4 series." + fi + fi +} + +pkg_setup() { + enewgroup mongodb + enewuser mongodb -1 -1 /var/lib/${PN} mongodb + + python-single-r1_pkg_setup +} + +src_prepare() { + default + + # remove bundled libs + rm -r src/third_party/{boost-*,pcre-*,scons-*,snappy-*,yaml-cpp-*,zlib-*} || die +} + +src_configure() { + # https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source + # --use-system-icu fails tests + # --use-system-tcmalloc is strongly NOT recommended: + scons_opts=( + CC="$(tc-getCC)" + CXX="$(tc-getCXX)" + + --disable-warnings-as-errors + --use-system-boost + --use-system-pcre + --use-system-snappy + --use-system-stemmer + --use-system-yaml + --use-system-zlib + ) + + use debug && scons_opts+=( --dbg=on ) + use kerberos && scons_opts+=( --use-sasl-client ) + use ssl && scons_opts+=( --ssl ) + + # respect mongoDB upstream's basic recommendations + # see bug #536688 and #526114 + if ! use debug; then + filter-flags '-m*' + filter-flags '-O?' + fi + + default +} + +src_compile() { + escons "${scons_opts[@]}" core tools +} + +# FEATURES="test -usersandbox" emerge dev-db/mongodb +src_test() { + # this one test fails + rm jstests/core/jsHeapLimit.js || die + + "${EPYTHON}" ./buildscripts/resmoke.py --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed" +} + +src_install() { + escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr + + doman debian/mongo*.1 + dodoc README docs/building.md + + newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r3" ${PN} + newinitd "${FILESDIR}/mongos.initd-r3" ${PN/db/s} + newconfd "${FILESDIR}/mongos.confd-r3" ${PN/db/s} + + insinto /etc + newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf + newins "${FILESDIR}/mongos.conf-r2" ${PN/db/s}.conf + + systemd_dounit "${FILESDIR}/${PN}.service" + + insinto /etc/logrotate.d/ + newins "${FILESDIR}/${PN}.logrotate" ${PN} + + # see bug #526114 + pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos} + + local x + for x in /var/{lib,log}/${PN}; do + diropts -m0750 -o mongodb -g mongodb + keepdir "${x}" + done +} + +pkg_postinst() { + ewarn "Make sure to read the release notes and follow the upgrade process:" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/" + ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures" +}