aboutsummaryrefslogtreecommitdiffstats
path: root/community/mongodb
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-04-21 14:15:59 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-04-21 14:44:37 +0000
commita86740d743de969471c628c71c75d6d6678ca12c (patch)
tree3413d775d1ecfdebafae7d19b6ca6232aa1dc838 /community/mongodb
parent24bfdd2da0799ef4557fdc3588a701fcc0f6c8ee (diff)
downloadaports-a86740d743de969471c628c71c75d6d6678ca12c.tar.bz2
aports-a86740d743de969471c628c71c75d6d6678ca12c.tar.xz
community/mongodb: moved from testing
Diffstat (limited to 'community/mongodb')
-rw-r--r--community/mongodb/40-fix-elf-native-class.patch12
-rw-r--r--community/mongodb/APKBUILD117
-rw-r--r--community/mongodb/backtrace.patch14
-rw-r--r--community/mongodb/boost160.patch11
-rw-r--r--community/mongodb/boost162.patch15
-rw-r--r--community/mongodb/fix-asio-strerror_r.patch28
-rw-r--r--community/mongodb/fix-log.patch13
-rw-r--r--community/mongodb/fix-processinfo_linux.patch33
-rw-r--r--community/mongodb/mongodb.confd14
-rw-r--r--community/mongodb/mongodb.initd41
-rw-r--r--community/mongodb/mongodb.logrotate13
-rw-r--r--community/mongodb/mongodb.pre-install6
-rw-r--r--community/mongodb/mongos.confd16
-rw-r--r--community/mongodb/mongos.initd45
-rw-r--r--community/mongodb/set-default-stacksize.patch20
-rw-r--r--community/mongodb/wiredtiger-strtouq.patch11
16 files changed, 409 insertions, 0 deletions
diff --git a/community/mongodb/40-fix-elf-native-class.patch b/community/mongodb/40-fix-elf-native-class.patch
new file mode 100644
index 0000000000..badb712d8e
--- /dev/null
+++ b/community/mongodb/40-fix-elf-native-class.patch
@@ -0,0 +1,12 @@
+--- orig/mongodb-src-r3.0.2/src/mongo/util/stacktrace_posix.cpp
++++ mongodb-src-r3.0.2/src/mongo/util/stacktrace_posix.cpp
+@@ -209,6 +209,9 @@
+ #include <elf.h>
+ #include <link.h>
+
++// AlpineTODO: Better option??
++#define __ELF_NATIVE_CLASS 64
++
+ namespace mongo {
+ namespace {
+
diff --git a/community/mongodb/APKBUILD b/community/mongodb/APKBUILD
new file mode 100644
index 0000000000..2331b14f87
--- /dev/null
+++ b/community/mongodb/APKBUILD
@@ -0,0 +1,117 @@
+# Maintainer: Filipp Andronov <filipp.andronov@gmail.com>
+# Contributor: Marc Vertes <marc.vertes@ugrid.net>
+pkgname=mongodb
+pkgver=3.4.3
+pkgrel=1
+pkgdesc='A high-performance, open source, schema-free document-oriented database'
+url='http://www.mongodb.org'
+arch='x86_64'
+license='AGPL3'
+pkgusers="mongodb"
+pkggroups="mongodb"
+depends=
+makedepends="scons paxmark libressl-dev pcre-dev snappy-dev boost-dev asio-dev
+ libpcap-dev wiredtiger-dev zlib-dev cyrus-sasl-dev yaml-cpp-dev"
+install="$pkgname.pre-install"
+source="http://downloads.mongodb.org/src/mongodb-src-r${pkgver}.tar.gz
+ 40-fix-elf-native-class.patch
+ backtrace.patch
+ fix-asio-strerror_r.patch
+ fix-log.patch
+ fix-processinfo_linux.patch
+ set-default-stacksize.patch
+ wiredtiger-strtouq.patch
+ boost160.patch
+ boost162.patch
+
+ mongodb.confd
+ mongodb.initd
+ mongodb.logrotate
+ mongos.confd
+ mongos.initd
+ "
+#
+# 1. Force 64bits because of 40-fix-elf-native-class.patch
+# 2. Use system allocator as tc-malloc doesn't build
+# 2. Use as much system libs as possible, boost doesn't compile foe example
+#
+# TODO: proper elf-netive-class fix
+# TODO: check if there are more libs could be replaced by system counterparts (see libpcap does't use, for example)
+# TODO: proper fix for heap usage
+# Right now code patched to always return 0 for heap usage statistics. That is necessary because musl malloc info
+# isn't compatible with glibc and breaks build. It is _possible_ to patch code to return 0
+# because on 64bit platform statistics is broken and returns wrong numbers, see SERVER-9168 mongo bug.
+#
+# There is a way to return propper value when tc-malloc used, but it doesn't compile for libmusl. Work is in progress,
+# contribution strongly welcome :D
+#
+_builddir="$srcdir"/$pkgname-src-r$pkgver
+_buildopts="
+ --allocator=system \
+ --disable-warnings-as-errors \
+ --use-system-boost \
+ --use-system-pcre \
+ --use-system-wiredtiger \
+ --use-system-snappy \
+ --use-system-zlib \
+ --use-system-yaml \
+ --use-sasl-client \
+ --ssl \
+ "
+
+prepare() {
+ cd "$_builddir"
+
+ local i
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons $_buildopts --prefix=$pkgdir/usr core
+}
+
+package() {
+ cd "$_builddir"
+
+ # install mongo targets
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons $_buildopts --prefix=$pkgdir/usr install
+
+ # java jit requires paxmark
+ paxmark -m "$pkgdir"/usr/bin/mongo*
+
+ # install alpine specific files
+ install -dm700 "$pkgdir/var/lib/mongodb"
+ install -dm755 "$pkgdir/var/log/mongodb"
+ chown mongodb:mongodb "$pkgdir/var/lib/mongodb" "$pkgdir/var/log/mongodb"
+
+ install -Dm755 "$srcdir/mongodb.initd" "$pkgdir/etc/init.d/mongodb"
+ install -Dm644 "$srcdir/mongodb.confd" "$pkgdir/etc/conf.d/mongodb"
+ install -Dm644 "$srcdir/mongodb.logrotate" "$pkgdir/etc/logrotate.d/mongodb"
+
+ install -Dm755 "$srcdir/mongos.initd" "$pkgdir/etc/init.d/mongos"
+ install -Dm644 "$srcdir/mongos.confd" "$pkgdir/etc/conf.d/mongos"
+}
+
+sha512sums="e2fb5fc2f02e9dbca6c30d2e2aaf1569180ca15198226cdad46f47f44905293afe77763fe2e5c9add0b5bcbd62b7ce7905fb183068c0738cdeeae8d39f848cef mongodb-src-r3.4.3.tar.gz
+56db8f43afc94713ac65b174189e2dd903b5e1eff0b65f1bdac159e52ad4de6606c449865d73bd47bffad6a8fc339777e2b11395596e9a476867d94a219c7925 40-fix-elf-native-class.patch
+7d097f497cb910c9cb81086cd8c222e43456d1a6de4adfe3e97a4d99add454279350fdeb7305dab84b3deca04afd824036d4065ee0fb8cdd8c03e96d98ee86af backtrace.patch
+f829b1ad542db3ee776d444243b8b47ab4e48a7386d9b199d7b1adafd31556cf173a5683b78ee735d6a69999ad9af5ad152fde955bbe8865f7910718991ce97c fix-asio-strerror_r.patch
+9e109a9131e8466496e94f7046e13fd40ec750c8de703e31d65cf3f6e80830e67e1438debaefc0e1150fe2bb08dbb42cf95890c51e9d98f354cfbb396500b5d4 fix-log.patch
+026d20fa1a0f1e27150b833664300250386d7e0d73c0778f81f70242e93e8a16e5607716693bbcdd1efb328fa84c7284e2c6c7e1ac92259b97a9d402975cf709 fix-processinfo_linux.patch
+1492137b0e3456d90a79617c1cd5ead5c71b1cfaae9ee41c75d56cd25f404ec73a690f95ce0d8c064c0a14206daca8070aa769b7cdfa904a338a425b52c293fa set-default-stacksize.patch
+bbb323d428d59584703e8692bf4df7fe0d37c0324c23822bade2edd1ca78759191f778230b7107502a9d2f7f22afc84d4ea350139fc1d751ceb2fff219b9ddf8 wiredtiger-strtouq.patch
+385c82875174caae433a3b381eb10f98a6fed0c8943788ddefff1de80a898e480bdbbf094a7783285cf2ae11ce3fc6878e57d58183d05be2f0837b206aaa4da6 boost160.patch
+79edfd1a6eaba597b31a82e54722dccab288d8b8840a53f79140b5fca221b5acd9fbc770d99e46ea9fa0da502cdf18dd35d982c95a4aa341806c3d8b61fc732f boost162.patch
+9bcd870742c31bf25f34188ddc3c414de1103e9860dea9f54eee276b89bc2cf1226abab1749c5cda6a6fb0880e541373754e5e83d63cc7189d4b9c274fd555c3 mongodb.confd
+74009794d566dd9d70ec93ffd95c830ee4696165574ecf87398165637fb40799b38d182ef54c50fd0772d589be94ade7f7a49247f3d31c1f012cb4e44cc9f5df mongodb.initd
+8c089b1a11f494e4148fb4646265964c925bf937633a65e395ee1361d42facf837871dd493a9a2e0f480ae0e0829dbd3ed60794c5334e2716332e131fc5c2c51 mongodb.logrotate
+61d8734cef644187eeadc821c89e63a3fbf61860fe2db6e74557b1c6760fe83ba7549cb04f9e3aacea4d8e7e4d81a3b1bc0d5e29715eca33c4761adb17ea9ab7 mongos.confd
+13aad7247b848ac58b2bc0b40a0d30d909e950380abd0c83fab0e2a394a42dc268a66dac53cf9feec6971739977470082cc4339cca827f41044cfe43803ef3f7 mongos.initd"
diff --git a/community/mongodb/backtrace.patch b/community/mongodb/backtrace.patch
new file mode 100644
index 0000000000..f110c7484d
--- /dev/null
+++ b/community/mongodb/backtrace.patch
@@ -0,0 +1,14 @@
+diff --git a/SConstruct b/SConstruct
+index 64c8387..3db1f3e 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -2292,7 +2292,8 @@ def doConfigure(myenv):
+ if (conf.CheckCXXHeader( "execinfo.h" ) and
+ conf.CheckDeclaration('backtrace', includes='#include <execinfo.h>') and
+ conf.CheckDeclaration('backtrace_symbols', includes='#include <execinfo.h>') and
+- conf.CheckDeclaration('backtrace_symbols_fd', includes='#include <execinfo.h>')):
++ conf.CheckDeclaration('backtrace_symbols_fd', includes='#include <execinfo.h>') and
++ conf.CheckFunc('backtrace')):
+
+ conf.env.SetConfigHeaderDefine("MONGO_CONFIG_HAVE_EXECINFO_BACKTRACE")
+
diff --git a/community/mongodb/boost160.patch b/community/mongodb/boost160.patch
new file mode 100644
index 0000000000..3567c65f82
--- /dev/null
+++ b/community/mongodb/boost160.patch
@@ -0,0 +1,11 @@
+diff -uprb mongodb-src-r3.2.0.orig/SConstruct mongodb-src-r3.2.0/SConstruct
+--- mongodb-src-r3.2.0.orig/SConstruct 2015-12-02 21:01:34.000000000 +0200
++++ mongodb-src-r3.2.0/SConstruct 2015-12-22 11:18:23.613216445 +0200
+@@ -2245,6 +2245,7 @@ def doConfigure(myenv):
+ # permit more than four parameters.
+ "BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD",
+ "BOOST_SYSTEM_NO_DEPRECATED",
++ "BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE",
+ ]
+ )
+
diff --git a/community/mongodb/boost162.patch b/community/mongodb/boost162.patch
new file mode 100644
index 0000000000..30a3bdff45
--- /dev/null
+++ b/community/mongodb/boost162.patch
@@ -0,0 +1,15 @@
+Derived from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/mongodb/patches/patch-src_mongo_db_fts_unicode_string.cpp v1.1
+
+* Fix build with boost 1.62.0
+
+--- a/src/mongo/db/fts/unicode/string.cpp 2016-09-26 12:10:04.000000000 +0000
++++ b/src/mongo/db/fts/unicode/string.cpp
+@@ -274,7 +274,7 @@ bool String::substrMatch(const std::stri
+
+ // Case sensitive and diacritic sensitive.
+ return boost::algorithm::boyer_moore_search(
+- haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end();
++ haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end());
+ }
+
+ } // namespace unicode
diff --git a/community/mongodb/fix-asio-strerror_r.patch b/community/mongodb/fix-asio-strerror_r.patch
new file mode 100644
index 0000000000..f2fe5cb1eb
--- /dev/null
+++ b/community/mongodb/fix-asio-strerror_r.patch
@@ -0,0 +1,28 @@
+https://github.com/chriskohlhoff/asio/issues/94
+
+diff --git a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
+index 4e7badb..0eeae88 100644
+--- a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
++++ b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
+@@ -97,17 +97,14 @@ public:
+ #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
+ using namespace std;
+ return strerror(value);
+-#elif defined(__MACH__) && defined(__APPLE__) \
+- || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
+- || defined(_AIX) || defined(__hpux) || defined(__osf__) \
+- || defined(__ANDROID__)
++#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
++ char buf[256] = "";
++ return strerror_r(value, buf, sizeof(buf));
++#else
+ char buf[256] = "";
+ using namespace std;
+ strerror_r(value, buf, sizeof(buf));
+ return buf;
+-#else
+- char buf[256] = "";
+- return strerror_r(value, buf, sizeof(buf));
+ #endif
+ #endif // defined(ASIO_WINDOWS)
+ }
diff --git a/community/mongodb/fix-log.patch b/community/mongodb/fix-log.patch
new file mode 100644
index 0000000000..e7bc8bef5d
--- /dev/null
+++ b/community/mongodb/fix-log.patch
@@ -0,0 +1,13 @@
+--- a/src/mongo/util/log.cpp
++++ b/src/mongo/util/log.cpp
+@@ -101,9 +101,7 @@
+ char buf[kBuflen];
+ char* msg{nullptr};
+
+-#if defined(__GNUC__) && defined(_GNU_SOURCE)
+- msg = strerror_r(errNumber, buf, kBuflen);
+-#elif defined(_WIN32)
++#if defined(_WIN32)
+
+ LPWSTR errorText = nullptr;
+ FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER |
diff --git a/community/mongodb/fix-processinfo_linux.patch b/community/mongodb/fix-processinfo_linux.patch
new file mode 100644
index 0000000000..0c07fa4c81
--- /dev/null
+++ b/community/mongodb/fix-processinfo_linux.patch
@@ -0,0 +1,33 @@
+--- a/src/mongo/util/processinfo_linux.cpp
++++ b/src/mongo/util/processinfo_linux.cpp
+@@ -40,11 +40,11 @@
+ #include <sys/mman.h>
+ #include <sys/utsname.h>
+ #include <unistd.h>
+-#ifdef __UCLIBC__
++//#ifdef __UCLIBC__
+ #include <features.h>
+-#else
+-#include <gnu/libc-version.h>
+-#endif
++//#else
++//#include <gnu/libc-version.h>
++//#endif
+
+ #include <boost/filesystem.hpp>
+ #include <boost/none.hpp>
+@@ -487,13 +487,9 @@
+
+ BSONObjBuilder bExtra;
+ bExtra.append("versionString", LinuxSysHelper::readLineFromFile("/proc/version"));
+-#ifdef __UCLIBC__
+ stringstream ss;
+- ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
++ ss << "musl-1.1.16";
+ bExtra.append("libcVersion", ss.str());
+-#else
+- bExtra.append("libcVersion", gnu_get_libc_version());
+-#endif
+ if (!verSig.empty())
+ // optional
+ bExtra.append("versionSignature", verSig);
diff --git a/community/mongodb/mongodb.confd b/community/mongodb/mongodb.confd
new file mode 100644
index 0000000000..4f76c5a79f
--- /dev/null
+++ b/community/mongodb/mongodb.confd
@@ -0,0 +1,14 @@
+# Mongodb essentials
+MONGODB_EXEC="/usr/bin/mongod"
+MONGODB_RUN="/var/run/mongodb"
+MONGODB_DATA="/var/lib/mongodb"
+MONGODB_USER="mongodb"
+
+# Listen to specified IP, comment this to listen to all
+MONGODB_IP="127.0.0.1"
+
+# Listen to specified port
+MONGODB_PORT="27017"
+
+# Set extra options here, such as disabling the admin web server
+MONGODB_OPTIONS="--journal"
diff --git a/community/mongodb/mongodb.initd b/community/mongodb/mongodb.initd
new file mode 100644
index 0000000000..fede8f683c
--- /dev/null
+++ b/community/mongodb/mongodb.initd
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongodb.initd,v 1.5 2013/01/18 11:19:27 ultrabug Exp $
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ checkpath -d -m 0750 -o "${MONGODB_USER}":mongodb "${MONGODB_RUN}"
+
+ # Listen to MONGODB_IP if configured
+ [ -z "${MONGODB_IP}" ] || MONGODB_OPTIONS="--bind_ip ${MONGODB_IP} ${MONGODB_OPTIONS}"
+
+ # Baselayout-1 user should use --chuid instead of --user
+ local USEROPT="--user"
+ if [ ! -f /etc/init.d/sysfs ]; then
+ USEROPT="--chuid"
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --background --start --make-pidfile \
+ --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid \
+ ${USEROPT} ${MONGODB_USER:-mongodb} \
+ --exec ${MONGODB_EXEC:-/usr/bin/mongod} \
+ -- \
+ --port ${MONGODB_PORT:-27017} \
+ --dbpath ${MONGODB_DATA:-/var/lib/mongodb} \
+ --unixSocketPrefix ${MONGODB_RUN:-/var/run/mongodb} \
+ --logappend --logpath /var/log/mongodb/${SVCNAME}.log \
+ ${MONGODB_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid
+ eend $?
+}
diff --git a/community/mongodb/mongodb.logrotate b/community/mongodb/mongodb.logrotate
new file mode 100644
index 0000000000..f95a438b5b
--- /dev/null
+++ b/community/mongodb/mongodb.logrotate
@@ -0,0 +1,13 @@
+# Default log rotation / compression keeps 1 year of logs.
+/var/log/mongodb/*.log {
+ daily
+ rotate 365
+ dateext
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ extension gz
+ sharedscripts
+ missingok
+}
diff --git a/community/mongodb/mongodb.pre-install b/community/mongodb/mongodb.pre-install
new file mode 100644
index 0000000000..1ed56eb7f4
--- /dev/null
+++ b/community/mongodb/mongodb.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S mongodb 2>/dev/null
+adduser -S -D -h /var/lib/mongodb -s /sbin/nologin -G mongodb -g mongodb mongodb 2>/dev/null
+
+exit 0
diff --git a/community/mongodb/mongos.confd b/community/mongodb/mongos.confd
new file mode 100644
index 0000000000..644cd0a252
--- /dev/null
+++ b/community/mongodb/mongos.confd
@@ -0,0 +1,16 @@
+# Mongos essentials
+MONGOS_EXEC="/usr/bin/mongos"
+MONGOS_RUN="/var/run/mongodb"
+MONGOS_USER="mongodb"
+
+# Listen to specified IP, comment this to listen to all
+MONGOS_IP="127.0.0.1"
+
+# Listen to specified port
+MONGOS_PORT="27018"
+
+# 1 to 3 comma separated config servers (mandatory)
+MONGOS_CONFIGDB=""
+
+# Set extra options here
+MONGOS_OPTIONS=""
diff --git a/community/mongodb/mongos.initd b/community/mongodb/mongos.initd
new file mode 100644
index 0000000000..a38fc50569
--- /dev/null
+++ b/community/mongodb/mongos.initd
@@ -0,0 +1,45 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongos.initd,v 1.3 2013/01/18 11:19:27 ultrabug Exp $
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -z "${MONGOS_CONFIGDB}" ]; then
+ eerror "MONGOS_CONFIGDB is not defined, check your configuration file !"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ checkpath -d -m 0750 -o "${MONGOS_USER}":mongodb "${MONGOS_RUN}"
+
+ # Listen to MONGOS_IP if configured
+ [ -z "${MONGOS_IP}" ] || MONGOS_OPTIONS="--bind_ip ${MONGOS_IP} ${MONGOS_OPTIONS}"
+
+ local USEROPT="--user"
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --background --start --make-pidfile \
+ --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid \
+ ${USEROPT} ${MONGOS_USER:-mongodb} \
+ --exec ${MONGOS_EXEC:-/usr/bin/mongos} \
+ -- \
+ --port ${MONGOS_PORT:-27018} \
+ --unixSocketPrefix ${MONGOS_RUN:-/var/run/mongodb} \
+ --logappend --logpath /var/log/mongodb/${SVCNAME}.log \
+ --configdb ${MONGOS_CONFIGDB} \
+ ${MONGOS_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid
+ eend $?
+}
diff --git a/community/mongodb/set-default-stacksize.patch b/community/mongodb/set-default-stacksize.patch
new file mode 100644
index 0000000000..d40a2d4b6e
--- /dev/null
+++ b/community/mongodb/set-default-stacksize.patch
@@ -0,0 +1,20 @@
+diff -ru mongodb-src-r3.2.10.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp mongodb-src-r3.2.10/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
+--- mongodb-src-r3.2.10.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp 2016-09-26 15:10:04.000000000 +0300
++++ mongodb-src-r3.2.10/src/mongo/platform/stack_locator_pthread_getattr_np.cpp 2016-11-01 10:47:31.062284560 +0200
+@@ -35,6 +35,16 @@
+ #include "mongo/util/assert_util.h"
+ #include "mongo/util/scopeguard.h"
+
++__attribute__((constructor))
++static void set_default_stack_size(void)
++{
++ pthread_attr_t attr;
++ invariant(pthread_attr_init(&attr) == 0);
++ invariant(pthread_attr_setstacksize(&attr, 256*1024) == 0);
++ pthread_setattr_default_np(&attr);
++ invariant(pthread_attr_destroy(&attr) == 0);
++}
++
+ namespace mongo {
+
+ StackLocator::StackLocator() {
diff --git a/community/mongodb/wiredtiger-strtouq.patch b/community/mongodb/wiredtiger-strtouq.patch
new file mode 100644
index 0000000000..db66bcdec2
--- /dev/null
+++ b/community/mongodb/wiredtiger-strtouq.patch
@@ -0,0 +1,11 @@
+--- mongodb-src-r3.2.3/src/third_party/wiredtiger/build_linux/wiredtiger_config.h.orig
++++ mongodb-src-r3.2.3/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
+@@ -101,7 +101,7 @@
+ #define HAVE_STRING_H 1
+
+ /* Define to 1 if you have the `strtouq' function. */
+-#define HAVE_STRTOUQ 1
++/* #undef HAVE_STRTOUQ 1 */
+
+ /* Define to 1 if you have the `sync_file_range' function. */
+ /* #undef HAVE_SYNC_FILE_RANGE */