summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-db/mongodb/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-db/mongodb/files')
-rw-r--r--dev-db/mongodb/files/mms-agent.confd9
-rw-r--r--dev-db/mongodb/files/mms-agent.initd41
-rw-r--r--dev-db/mongodb/files/mms-agent.initd-r131
-rw-r--r--dev-db/mongodb/files/mms-agent.initd-r225
-rw-r--r--dev-db/mongodb/files/mongodb-2.0-fix-scons.patch36
-rw-r--r--dev-db/mongodb/files/mongodb-2.0-r1-boost-1.50.patch245
-rw-r--r--dev-db/mongodb/files/mongodb-2.2-r1-fix-boost.patch13
-rw-r--r--dev-db/mongodb/files/mongodb-2.4-fix-sasl.patch33
-rw-r--r--dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch11
-rw-r--r--dev-db/mongodb/files/mongodb-2.4.11-fix-scons.patch23
-rw-r--r--dev-db/mongodb/files/mongodb-2.4.5-fix-scons.patch28
-rw-r--r--dev-db/mongodb/files/mongodb-2.6.1-fix-scons.patch35
-rw-r--r--dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch13
-rw-r--r--dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch35
-rw-r--r--dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch35
-rw-r--r--dev-db/mongodb/files/mongodb.conf8
-rw-r--r--dev-db/mongodb/files/mongodb.conf-r233
-rw-r--r--dev-db/mongodb/files/mongodb.conf-r334
-rw-r--r--dev-db/mongodb/files/mongodb.confd14
-rw-r--r--dev-db/mongodb/files/mongodb.confd-r212
-rw-r--r--dev-db/mongodb/files/mongodb.initd-r140
-rw-r--r--dev-db/mongodb/files/mongodb.initd-r227
-rw-r--r--dev-db/mongodb/files/mongodb.logrotate13
-rw-r--r--dev-db/mongodb/files/mongodb.service10
-rw-r--r--dev-db/mongodb/files/mongos.conf-r230
-rw-r--r--dev-db/mongodb/files/mongos.confd16
-rw-r--r--dev-db/mongodb/files/mongos.confd-r212
-rw-r--r--dev-db/mongodb/files/mongos.initd-r150
-rw-r--r--dev-db/mongodb/files/mongos.initd-r227
29 files changed, 939 insertions, 0 deletions
diff --git a/dev-db/mongodb/files/mms-agent.confd b/dev-db/mongodb/files/mms-agent.confd
new file mode 100644
index 000000000000..d19b21e2d32b
--- /dev/null
+++ b/dev-db/mongodb/files/mms-agent.confd
@@ -0,0 +1,9 @@
+# Your API key - See: http://mms.10gen.com/settings
+API_KEY=""
+SECRET_KEY=""
+
+# Seconds between Mongo status checks
+#COLLECTION_INTERVAL=56
+
+# Seconds between cloud configuration checks
+#CONF_INTERVAL=120 \ No newline at end of file
diff --git a/dev-db/mongodb/files/mms-agent.initd b/dev-db/mongodb/files/mms-agent.initd
new file mode 100644
index 000000000000..7f7196501639
--- /dev/null
+++ b/dev-db/mongodb/files/mms-agent.initd
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+ROOTDIR=/opt/mms-agent
+PIDFILE=/var/run/mm-agent.pid
+EXEC="/usr/bin/env python agent.py"
+LOGFILE=/var/log/mongodb/mms-agent.log
+
+depend() {
+ need net
+ use syslog
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ checkpath -d -m 0755 -o root:root /var/run/
+
+ # Setup API/SECRETY KEYS
+ sed -i -e "s/^mms_key.*/mms_key = '${API_KEY}'/g" \
+ -e "s/^secret_key.*/secret_key = '${SECRET_KEY}'/g" ${ROOTDIR}/settings.py &>/dev/null
+
+ # Tune the agent
+ [ -z "${COLLECTION_INTERVAL}" ] || sed -i \
+ -e "s/^collection_interval.*/collection_interval = ${COLLECTION_INTERVAL}/g" ${ROOTDIR}/settings.py &>/dev/null
+ [ -z "${CONF_INTERVAL}" ] || sed -i \
+ -e "s/^conf_interval.*/conf_interval = ${CONF_INTERVAL}/g" ${ROOTDIR}/settings.py &>/dev/null
+
+ start-stop-daemon --start --chdir ${ROOTDIR} --exec ${EXEC} \
+ --pidfile "${PIDFILE}" --make-pidfile --background \
+ --user mongodb:mongodb --stdout ${LOGFILE} --stderr ${LOGFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Requesting ${SVCNAME} to stop"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/dev-db/mongodb/files/mms-agent.initd-r1 b/dev-db/mongodb/files/mms-agent.initd-r1
new file mode 100644
index 000000000000..66d408b08322
--- /dev/null
+++ b/dev-db/mongodb/files/mms-agent.initd-r1
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+ROOTDIR=/opt/mms-agent
+PIDFILE=/var/run/mm-agent.pid
+EXEC="/usr/bin/env python agent.py"
+LOGFILE=/var/log/mongodb/mms-agent.log
+
+depend() {
+ need net
+ use syslog
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ checkpath -d -m 0755 -o root:root /var/run/
+
+ start-stop-daemon --start --chdir ${ROOTDIR} --exec ${EXEC} \
+ --pidfile "${PIDFILE}" --make-pidfile --background \
+ --user mongodb:mongodb --stdout ${LOGFILE} --stderr ${LOGFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Requesting ${SVCNAME} to stop"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/dev-db/mongodb/files/mms-agent.initd-r2 b/dev-db/mongodb/files/mms-agent.initd-r2
new file mode 100644
index 000000000000..9c63be02245d
--- /dev/null
+++ b/dev-db/mongodb/files/mms-agent.initd-r2
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+logfile=/var/log/mongodb/mms-agent.log
+run_dir=${run_dir:-/run/mongodb}
+
+command="/usr/bin/python2 agent.py &>${logfile}"
+command_background="true"
+
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-mongodb}
+group=${group:-mongodb}
+start_stop_daemon_args="--user ${user} --group ${group}"
+
+depend() {
+ need net
+ use syslog
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ cd /opt/mms-agent
+}
diff --git a/dev-db/mongodb/files/mongodb-2.0-fix-scons.patch b/dev-db/mongodb/files/mongodb-2.0-fix-scons.patch
new file mode 100644
index 000000000000..a52e3a30a77d
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.0-fix-scons.patch
@@ -0,0 +1,36 @@
+--- a/SConstruct 2011-11-16 22:11:39.000000000 +0100
++++ b/SConstruct 2011-11-17 16:30:16.144117550 +0100
+@@ -688,7 +688,7 @@
+ env["CXX"] = "distcc " + env["CXX"]
+
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+- env.Append( CPPFLAGS="-fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch" )
++ env.Append( CPPFLAGS="-fPIC -fno-strict-aliasing -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch" )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux:
+ env.Append( CPPFLAGS=" -Werror " )
+@@ -696,7 +696,9 @@
+ env.Append( CPPFLAGS=" -fno-builtin-memcmp " ) # glibc's memcmp is faster than gcc's
+
+ env.Append( CPPDEFINES="_FILE_OFFSET_BITS=64" )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'])
+ env.Append( CXXFLAGS=" -Wnon-virtual-dtor " )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+ env.Append( LINKFLAGS=" -fPIC -pthread -rdynamic" )
+ env.Append( LIBS=[] )
+
+@@ -706,12 +708,13 @@
+
+ if linux and has_option( "sharedclient" ):
+ env.Append( LINKFLAGS=" -Wl,--as-needed -Wl,-zdefs " )
++ env.Append( SHLINKFLAGS=" -Wl,-soname=libmongoclient.so " )
+
+ if debugBuild:
+ env.Append( CPPFLAGS=" -O0 -fstack-protector " );
+ env['ENV']['GLIBCXX_FORCE_NEW'] = 1; # play nice with valgrind
+ else:
+- env.Append( CPPFLAGS=" -O3 " )
++ env.Append( CXXFLAGS=" -O3 " )
+ #env.Append( CPPFLAGS=" -fprofile-generate" )
+ #env.Append( LINKFLAGS=" -fprofile-generate" )
+ # then:
diff --git a/dev-db/mongodb/files/mongodb-2.0-r1-boost-1.50.patch b/dev-db/mongodb/files/mongodb-2.0-r1-boost-1.50.patch
new file mode 100644
index 000000000000..4ccb898ec6fd
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.0-r1-boost-1.50.patch
@@ -0,0 +1,245 @@
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/db/db.cpp mongodb-src-r2.0.6-patched/db/db.cpp
+--- mongodb-src-r2.0.6/db/db.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/db/db.cpp 2012-07-10 22:27:16.496886220 +0200
+@@ -326,7 +326,7 @@
+ boost::filesystem::path path( dbpath );
+ for ( boost::filesystem::directory_iterator i( path );
+ i != boost::filesystem::directory_iterator(); ++i ) {
+- string fileName = boost::filesystem::path(*i).leaf();
++ string fileName = boost::filesystem::path(*i).leaf().string();
+ if ( boost::filesystem::is_directory( *i ) &&
+ fileName.length() && fileName[ 0 ] == '$' )
+ boost::filesystem::remove_all( *i );
+@@ -655,11 +655,6 @@
+ dbExecCommand = argv[0];
+
+ srand(curTimeMicros());
+-#if( BOOST_VERSION >= 104500 )
+- boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
+-#else
+- boost::filesystem::path::default_name_check( boost::filesystem::no_check );
+-#endif
+
+ {
+ unsigned x = 0x12345678;
+@@ -976,7 +971,7 @@
+ if (params.count("shutdown")){
+ bool failed = false;
+
+- string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
++ string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).string();
+ if ( !boost::filesystem::exists( name ) || boost::filesystem::file_size( name ) == 0 )
+ failed = true;
+
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/db/dur.cpp mongodb-src-r2.0.6-patched/db/dur.cpp
+--- mongodb-src-r2.0.6/db/dur.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/db/dur.cpp 2012-07-10 21:56:28.866778732 +0200
+@@ -692,7 +692,7 @@
+
+ bool samePartition = true;
+ try {
+- const string dbpathDir = boost::filesystem::path(dbpath).native_directory_string();
++ const string dbpathDir = boost::filesystem::path(dbpath).string();
+ samePartition = onSamePartition(getJournalDir().string(), dbpathDir);
+ }
+ catch(...) {
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/db/dur_journal.cpp mongodb-src-r2.0.6-patched/db/dur_journal.cpp
+--- mongodb-src-r2.0.6/db/dur_journal.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/db/dur_journal.cpp 2012-07-10 22:04:18.583472723 +0200
+@@ -169,7 +169,7 @@
+ for ( boost::filesystem::directory_iterator i( getJournalDir() );
+ i != boost::filesystem::directory_iterator();
+ ++i ) {
+- string fileName = boost::filesystem::path(*i).leaf();
++ string fileName = boost::filesystem::path(*i).leaf().string();
+ if( str::startsWith(fileName, "j._") )
+ return true;
+ }
+@@ -185,7 +185,7 @@
+ for ( boost::filesystem::directory_iterator i( getJournalDir() );
+ i != boost::filesystem::directory_iterator();
+ ++i ) {
+- string fileName = boost::filesystem::path(*i).leaf();
++ string fileName = boost::filesystem::path(*i).leaf().string();
+ if( str::startsWith(fileName, "j._") ) {
+ try {
+ removeOldJournalFile(*i);
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/db/dur_recover.cpp mongodb-src-r2.0.6-patched/db/dur_recover.cpp
+--- mongodb-src-r2.0.6/db/dur_recover.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/db/dur_recover.cpp 2012-07-10 22:02:18.226799055 +0200
+@@ -71,7 +71,7 @@
+ i != filesystem::directory_iterator();
+ ++i ) {
+ filesystem::path filepath = *i;
+- string fileName = filesystem::path(*i).leaf();
++ string fileName = filesystem::path(*i).leaf().string();
+ if( str::startsWith(fileName, "j._") ) {
+ unsigned u = str::toUnsigned( str::after(fileName, '_') );
+ if( m.count(u) ) {
+@@ -84,7 +84,7 @@
+ if( i != m.begin() && m.count(i->first - 1) == 0 ) {
+ uasserted(13532,
+ str::stream() << "unexpected file in journal directory " << dir.string()
+- << " : " << filesystem::path(i->second).leaf() << " : can't find its preceeding file");
++ << " : " << filesystem::path(i->second).leaf().string() << " : can't find its preceeding file");
+ }
+ files.push_back(i->second);
+ }
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/db/instance.cpp mongodb-src-r2.0.6-patched/db/instance.cpp
+--- mongodb-src-r2.0.6/db/instance.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/db/instance.cpp 2012-07-10 22:08:55.213488817 +0200
+@@ -645,13 +645,13 @@
+ i != boost::filesystem::directory_iterator(); ++i ) {
+ if ( directoryperdb ) {
+ boost::filesystem::path p = *i;
+- string dbName = p.leaf();
++ string dbName = p.leaf().string();
+ p /= ( dbName + ".ns" );
+ if ( MMF::exists( p ) )
+ names.push_back( dbName );
+ }
+ else {
+- string fileName = boost::filesystem::path(*i).leaf();
++ string fileName = boost::filesystem::path(*i).leaf().string();
+ if ( fileName.length() > 3 && fileName.substr( fileName.length() - 3, 3 ) == ".ns" )
+ names.push_back( fileName.substr( 0, fileName.length() - 3 ) );
+ }
+@@ -893,7 +893,7 @@
+ }
+
+ void acquirePathLock(bool doingRepair) {
+- string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
++ string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).string();
+
+ bool oldFile = false;
+
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/db/pdfile.cpp mongodb-src-r2.0.6-patched/db/pdfile.cpp
+--- mongodb-src-r2.0.6/db/pdfile.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/db/pdfile.cpp 2012-07-10 22:11:44.103498643 +0200
+@@ -1987,7 +1987,7 @@
+ virtual bool apply( const Path &p ) {
+ if ( !boost::filesystem::exists( p ) )
+ return false;
+- boostRenameWrapper( p, newPath_ / ( p.leaf() + ".bak" ) );
++ boostRenameWrapper( p, newPath_ / ( p.leaf().string() + ".bak" ) );
+ return true;
+ }
+ virtual const char * op() const {
+@@ -2093,7 +2093,7 @@
+ uniqueReservedPath( ( preserveClonedFilesOnFailure || backupOriginalFiles ) ?
+ "backup" : "$tmp" );
+ BOOST_CHECK_EXCEPTION( boost::filesystem::create_directory( reservedPath ) );
+- string reservedPathString = reservedPath.native_directory_string();
++ string reservedPathString = reservedPath.string();
+
+ bool res;
+ {
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/dbtests/framework.cpp mongodb-src-r2.0.6-patched/dbtests/framework.cpp
+--- mongodb-src-r2.0.6/dbtests/framework.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/dbtests/framework.cpp 2012-07-10 22:29:20.610226773 +0200
+@@ -281,7 +281,7 @@
+ boost::filesystem::create_directory(p);
+ }
+
+- string dbpathString = p.native_directory_string();
++ string dbpathString = p.string();
+ dbpath = dbpathString.c_str();
+
+ cmdLine.prealloc = false;
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/pch.h mongodb-src-r2.0.6-patched/pch.h
+--- mongodb-src-r2.0.6/pch.h 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/pch.h 2012-07-10 21:35:57.133373738 +0200
+@@ -79,7 +79,7 @@
+ //#include <boost/any.hpp>
+ #include "boost/thread/once.hpp"
+ //#include <boost/archive/iterators/transform_width.hpp>
+-#define BOOST_FILESYSTEM_VERSION 2
++#define BOOST_FILESYSTEM_VERSION 3
+ #include <boost/filesystem/convenience.hpp>
+ #include <boost/filesystem/exception.hpp>
+ #include <boost/filesystem/operations.hpp>
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/shell/shell_utils.cpp mongodb-src-r2.0.6-patched/shell/shell_utils.cpp
+--- mongodb-src-r2.0.6/shell/shell_utils.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/shell/shell_utils.cpp 2012-07-10 22:38:58.443593723 +0200
+@@ -388,7 +388,7 @@
+ #endif
+ }
+
+- argv_.push_back( programPath.native_file_string() );
++ argv_.push_back( programPath.string() );
+
+ port_ = -1;
+
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/tools/restore.cpp mongodb-src-r2.0.6-patched/tools/restore.cpp
+--- mongodb-src-r2.0.6/tools/restore.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/tools/restore.cpp 2012-07-10 22:45:00.046948094 +0200
+@@ -131,7 +131,7 @@
+ log(2) << "drillDown: " << root.string() << endl;
+
+ // skip hidden files and directories
+- if (root.leaf()[0] == '.' && root.leaf() != ".")
++ if (root.leaf().string()[0] == '.' && root.leaf().string() != ".")
+ return;
+
+ if ( is_directory( root ) ) {
+@@ -210,7 +210,7 @@
+ ns += "." + _coll;
+ }
+ else {
+- string l = root.leaf();
++ string l = root.leaf().string();
+ l = l.substr( 0 , l.find_last_of( "." ) );
+ ns += "." + l;
+ }
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/tools/tool.cpp mongodb-src-r2.0.6-patched/tools/tool.cpp
+--- mongodb-src-r2.0.6/tools/tool.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/tools/tool.cpp 2012-07-10 22:23:53.356874403 +0200
+@@ -113,12 +113,6 @@
+ // we want durability to be disabled.
+ cmdLine.dur = false;
+
+-#if( BOOST_VERSION >= 104500 )
+- boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
+-#else
+- boost::filesystem::path::default_name_check( boost::filesystem::no_check );
+-#endif
+-
+ _name = argv[0];
+
+ /* using the same style as db.cpp */
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/util/background.cpp mongodb-src-r2.0.6-patched/util/background.cpp
+--- mongodb-src-r2.0.6/util/background.cpp 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/util/background.cpp 2012-07-10 21:47:40.420081320 +0200
+@@ -89,7 +89,7 @@
+ if ( msTimeOut ) {
+ // add msTimeOut millisecond to current time
+ boost::xtime xt;
+- boost::xtime_get( &xt, boost::TIME_UTC );
++ boost::xtime_get( &xt, boost::TIME_UTC_ );
+
+ unsigned long long ns = msTimeOut * 1000000ULL; // milli to nano
+ if ( xt.nsec + ns < 1000000000 ) {
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/util/concurrency/mutex.h mongodb-src-r2.0.6-patched/util/concurrency/mutex.h
+--- mongodb-src-r2.0.6/util/concurrency/mutex.h 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/util/concurrency/mutex.h 2012-07-10 21:45:51.333408307 +0200
+@@ -29,7 +29,7 @@
+
+ inline boost::xtime incxtimemillis( long long s ) {
+ boost::xtime xt;
+- boost::xtime_get(&xt, boost::TIME_UTC);
++ boost::xtime_get(&xt, boost::TIME_UTC_);
+ xt.sec += (int)( s / 1000 );
+ xt.nsec += (int)(( s % 1000 ) * 1000000);
+ if ( xt.nsec >= 1000000000 ) {
+diff -ru '--exclude=mongo_vstudio.cpp' mongodb-src-r2.0.6/util/queue.h mongodb-src-r2.0.6-patched/util/queue.h
+--- mongodb-src-r2.0.6/util/queue.h 2012-06-04 15:42:54.000000000 +0200
++++ mongodb-src-r2.0.6-patched/util/queue.h 2012-07-10 22:14:00.243506560 +0200
+@@ -82,7 +82,7 @@
+ Timer timer;
+
+ boost::xtime xt;
+- boost::xtime_get(&xt, boost::TIME_UTC);
++ boost::xtime_get(&xt, boost::TIME_UTC_);
+ xt.sec += maxSecondsToWait;
+
+ scoped_lock l( _lock );
diff --git a/dev-db/mongodb/files/mongodb-2.2-r1-fix-boost.patch b/dev-db/mongodb/files/mongodb-2.2-r1-fix-boost.patch
new file mode 100644
index 000000000000..b6c9a1eb55df
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.2-r1-fix-boost.patch
@@ -0,0 +1,13 @@
+--- mongodb-src-r2.2.0/SConstruct.old 2012-10-09 12:41:25.000000000 -0400
++++ mongodb-src-r2.2.0/SConstruct 2012-10-09 12:41:41.000000000 -0400
+@@ -171,8 +171,8 @@
+ add_option( "extrapathdyn", "comma separated list of add'l paths (--extrapath /opt/foo/,/foo) dynamic linking" , 1 , True )
+ add_option( "extralib", "comma separated list of libraries (--extralib js_static,readline" , 1 , True )
+
+-add_option( "boost-compiler", "compiler used for boost (gcc41)" , 1 , True , "boostCompiler" )
+-add_option( "boost-version", "boost version for linking(1_38)" , 1 , True , "boostVersion" )
++add_option( "boost-compiler", "compiler used for boost (gcc41)" , 1 , False , "boostCompiler" )
++add_option( "boost-version", "boost version for linking(1_38)" , 1 , False , "boostVersion" )
+
+ add_option( "no-glibc-check" , "don't check for new versions of glibc" , 0 , False )
+
diff --git a/dev-db/mongodb/files/mongodb-2.4-fix-sasl.patch b/dev-db/mongodb/files/mongodb-2.4-fix-sasl.patch
new file mode 100644
index 000000000000..553967e8dedd
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.4-fix-sasl.patch
@@ -0,0 +1,33 @@
+--- a/src/mongo/client/sasl_client_session.cpp 2014-10-15 00:40:29.000000000 +0400
++++ b/src/mongo/client/sasl_client_session.cpp 2015-02-07 18:56:02.287762467 +0300
+@@ -29,17 +29,26 @@
+ * doesn't initialize the library for us.
+ */
+
+- void* saslOurMalloc(unsigned long sz) {
++// Version 2.1.26 is the first version to use size_t in the allocator signatures
++#if (SASL_VERSION_FULL >= ((2 << 16) | (1 << 8) | 26))
++ typedef size_t SaslAllocSize;
++#else
++ typedef unsigned long SaslAllocSize;
++#endif
++
++ typedef int(*SaslCallbackFn)();
++
++ void* saslOurMalloc(SaslAllocSize sz) {
+ return ourmalloc(sz);
+ }
+
+- void* saslOurCalloc(unsigned long count, unsigned long size) {
++ void* saslOurCalloc(SaslAllocSize count, SaslAllocSize size) {
+ void* ptr = calloc(count, size);
+- if (!ptr) printStackAndExit(0);
++ if (!ptr) abort();
+ return ptr;
+ }
+
+- void* saslOurRealloc(void* ptr, unsigned long sz) {
++ void* saslOurRealloc(void* ptr, SaslAllocSize sz) {
+ return ourrealloc(ptr, sz);
+ }
+
diff --git a/dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch b/dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch
new file mode 100644
index 000000000000..19efad676839
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.4-fix-v8-pythonpath.patch
@@ -0,0 +1,11 @@
+--- a/src/third_party/v8/SConscript 2014-05-26 11:00:37.725508098 +0200
++++ b/src/third_party/v8/SConscript 2014-05-26 11:01:13.265029083 +0200
+@@ -29,7 +29,7 @@
+ import sys
+ from os.path import join, dirname, abspath
+ root_dir = dirname(File('SConscript').rfile().abspath)
+-sys.path.append(join(root_dir, 'tools'))
++sys.path.insert(0, join(root_dir, 'tools'))
+ import js2c
+
+ Import("env windows linux darwin solaris freebsd debugBuild")
diff --git a/dev-db/mongodb/files/mongodb-2.4.11-fix-scons.patch b/dev-db/mongodb/files/mongodb-2.4.11-fix-scons.patch
new file mode 100644
index 000000000000..5050fe7daa35
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.4.11-fix-scons.patch
@@ -0,0 +1,23 @@
+--- b/SConstruct 2014-09-01 19:12:24.289585592 +0200
++++ a/SConstruct 2014-09-01 19:14:12.550312261 +0200
+@@ -704,7 +704,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -719,9 +718,10 @@
+ env.Append( CCFLAGS=["-fno-builtin-memcmp"] ) # glibc's memcmp is faster than gcc's
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread", "-rdynamic"] )
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-2.4.5-fix-scons.patch b/dev-db/mongodb/files/mongodb-2.4.5-fix-scons.patch
new file mode 100644
index 000000000000..4f4c13455430
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.4.5-fix-scons.patch
@@ -0,0 +1,28 @@
+--- a/SConstruct 2013-06-26 10:31:56.209089504 +0200
++++ b/SConstruct 2013-06-26 10:33:59.177045991 +0200
+@@ -702,7 +702,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -710,14 +709,14 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux:
+- env.Append( CCFLAGS=["-Werror", "-pipe"] )
+ if not has_option('clang'):
+ env.Append( CCFLAGS=["-fno-builtin-memcmp"] ) # glibc's memcmp is faster than gcc's
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'])
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread", "-rdynamic"] )
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-2.6.1-fix-scons.patch b/dev-db/mongodb/files/mongodb-2.6.1-fix-scons.patch
new file mode 100644
index 000000000000..031d84373b71
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.6.1-fix-scons.patch
@@ -0,0 +1,35 @@
+diff --git SConstruct SConstruct
+index 3886d1b..81c59a9 100644
+--- SConstruct
++++ SConstruct
+@@ -811,19 +811,17 @@ if nix:
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+ "-Wno-unknown-pragmas",
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+- if linux or darwin:
+- env.Append( CCFLAGS=["-Werror", "-pipe"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'])
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -840,7 +838,7 @@ if nix:
+ if not darwin:
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch b/dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch
new file mode 100644
index 000000000000..5f289c078831
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.6.10-fix-boost-1.57.patch
@@ -0,0 +1,13 @@
+diff -up mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h\~ mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h
+--- mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h~ 2015-01-13 18:12:06.000000000 +0100
++++ mongodb-src-r2.6.7/src/mongo/shell/linenoise_utf8.h 2015-01-28 22:22:50.538934558 +0100
+@@ -17,6 +17,7 @@
+
+ #include <boost/smart_ptr/scoped_array.hpp>
+ #include <string.h>
++#include <algorithm>
+
+ namespace linenoise_utf8 {
+
+
+Diff finished. Wed Jan 28 22:24:47 2015
diff --git a/dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch b/dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch
new file mode 100644
index 000000000000..76feba7bfe76
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-2.6.2-fix-scons.patch
@@ -0,0 +1,35 @@
+--- a/SConstruct 2014-06-16 19:32:46.274507258 +0200
++++ b/SConstruct 2014-06-16 19:34:04.763586829 +0200
+@@ -813,7 +813,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -821,13 +820,13 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux or darwin:
+- env.Append( CCFLAGS=["-pipe"] )
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -844,7 +843,7 @@
+ if not darwin:
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch b/dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch
new file mode 100644
index 000000000000..b7378d8ac416
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb-3.0.0-fix-scons.patch
@@ -0,0 +1,35 @@
+--- SConstruct.orig 2015-02-05 16:33:41.000000000 +0000
++++ SConstruct 2015-02-18 08:21:23.120134258 +0000
+@@ -1008,7 +1008,6 @@
+ # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
+ env.Append( CCFLAGS=["-fPIC",
+ "-fno-strict-aliasing",
+- "-ggdb",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -1016,13 +1015,13 @@
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+ if linux or darwin:
+- env.Append( CCFLAGS=["-pipe"] )
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
+- env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -1039,7 +1038,7 @@
+ if not darwin:
+ env.Append( LINKFLAGS=["-rdynamic"] )
+
+- env.Append( LIBS=[] )
++ env.Append( LIBS=['pcre', 'pcrecpp', 'snappy', 'yaml-cpp'] )
+
+ #make scons colorgcc friendly
+ for key in ('HOME', 'TERM'):
diff --git a/dev-db/mongodb/files/mongodb.conf b/dev-db/mongodb/files/mongodb.conf
new file mode 100644
index 000000000000..c5272b7f2df3
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.conf
@@ -0,0 +1,8 @@
+# See http://www.mongodb.org/display/DOCS/File+Based+Configuration for format details
+# Run mongod --help to see a list of options
+
+bind_ip = 127.0.0.1
+quiet = true
+dbpath = /var/lib/mongodb
+logpath = /var/log/mongodb/mongod.log
+logappend = true
diff --git a/dev-db/mongodb/files/mongodb.conf-r2 b/dev-db/mongodb/files/mongodb.conf-r2
new file mode 100644
index 000000000000..8e8a64408cdf
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.conf-r2
@@ -0,0 +1,33 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+storage:
+ dbPath: "/var/lib/mongodb"
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongodb.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+# ssl:
+# mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#replication:
+ #replSetName:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/dev-db/mongodb/files/mongodb.conf-r3 b/dev-db/mongodb/files/mongodb.conf-r3
new file mode 100644
index 000000000000..83b4cc0589ad
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.conf-r3
@@ -0,0 +1,34 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+storage:
+ dbPath: "/var/lib/mongodb"
+ #engine: wiredTiger
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongodb.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+ #ssl:
+ # mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#replication:
+ #replSetName:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/dev-db/mongodb/files/mongodb.confd b/dev-db/mongodb/files/mongodb.confd
new file mode 100644
index 000000000000..4f76c5a79f9f
--- /dev/null
+++ b/dev-db/mongodb/files/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/dev-db/mongodb/files/mongodb.confd-r2 b/dev-db/mongodb/files/mongodb.confd-r2
new file mode 100644
index 000000000000..dddb67e9301d
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.confd-r2
@@ -0,0 +1,12 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your mongodb instance,
+# see the /etc/mongodb.conf file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/mongodb.conf)
+# - user : the user used to run your mongodb instance (default : mongodb)
+# - group : the group used to run your mongodb instance (default : mongodb)
+# - run_dir : the run directory for your PID files (default : /run/mongodb)
diff --git a/dev-db/mongodb/files/mongodb.initd-r1 b/dev-db/mongodb/files/mongodb.initd-r1
new file mode 100644
index 000000000000..f52cca2fd408
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.initd-r1
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+}
+
+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/dev-db/mongodb/files/mongodb.initd-r2 b/dev-db/mongodb/files/mongodb.initd-r2
new file mode 100644
index 000000000000..fd78ed578881
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.initd-r2
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+config_file=${config_file:-/etc/${SVCNAME}.conf}
+run_dir=${run_dir:-/run/mongodb}
+
+command="/usr/bin/mongod"
+command_args="--config ${config_file}"
+command_background="true"
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-mongodb}
+group=${group:-mongodb}
+start_stop_daemon_args="--user ${user} --group ${group}"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ if [ ! -f ${config_file} ]; then
+ eerror "Missing configuration file ${config_file}"
+ return 1
+ fi
+}
diff --git a/dev-db/mongodb/files/mongodb.logrotate b/dev-db/mongodb/files/mongodb.logrotate
new file mode 100644
index 000000000000..f95a438b5b2c
--- /dev/null
+++ b/dev-db/mongodb/files/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/dev-db/mongodb/files/mongodb.service b/dev-db/mongodb/files/mongodb.service
new file mode 100644
index 000000000000..78d551183838
--- /dev/null
+++ b/dev-db/mongodb/files/mongodb.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=High-performance, schema-free document-oriented database
+After=network.target
+
+[Service]
+User=mongodb
+ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-db/mongodb/files/mongos.conf-r2 b/dev-db/mongodb/files/mongos.conf-r2
new file mode 100644
index 000000000000..fc0068962cfd
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.conf-r2
@@ -0,0 +1,30 @@
+# !! IMPORTANT !!
+#
+# This file uses the YAML format as described in the documentation:
+# http://docs.mongodb.org/manual/reference/configuration-options/
+
+systemLog:
+ destination: file
+ path: "/var/log/mongodb/mongos.log"
+ quiet: true
+ logAppend: true
+
+net:
+ port: 27017
+ bindIp: 127.0.0.1
+ ssl:
+ mode: disabled
+
+#security:
+ #keyFile:
+ #clusterAuthMode:
+
+#sharding:
+ #configDB:
+
+# Specifies one of the MongoDB parameters described here:
+# http://docs.mongodb.org/manual/reference/parameters/
+#
+# You can specify multiple setParameter fields such as:
+# setParameter: {enableTestCommands: 1}
+#setParameter:
diff --git a/dev-db/mongodb/files/mongos.confd b/dev-db/mongodb/files/mongos.confd
new file mode 100644
index 000000000000..644cd0a2522d
--- /dev/null
+++ b/dev-db/mongodb/files/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/dev-db/mongodb/files/mongos.confd-r2 b/dev-db/mongodb/files/mongos.confd-r2
new file mode 100644
index 000000000000..0dc2a189ff67
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.confd-r2
@@ -0,0 +1,12 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your mongos instance,
+# see the /etc/mongos.conf file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/mongos.conf)
+# - user : the user used to run your mongodb instance (default : mongodb)
+# - group : the group used to run your mongodb instance (default : mongodb)
+# - run_dir : the run directory for your PID files (default : /run/mongodb)
diff --git a/dev-db/mongodb/files/mongos.initd-r1 b/dev-db/mongodb/files/mongos.initd-r1
new file mode 100644
index 000000000000..c72292573a45
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.initd-r1
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use 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}"
+
+ # 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 ${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/dev-db/mongodb/files/mongos.initd-r2 b/dev-db/mongodb/files/mongos.initd-r2
new file mode 100644
index 000000000000..e8845a0555dc
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.initd-r2
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+config_file=${config_file:-/etc/${SVCNAME}.conf}
+run_dir=${run_dir:-/run/mongodb}
+
+command="/usr/bin/mongos"
+command_args="--config ${config_file}"
+command_background="true"
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-mongodb}
+group=${group:-mongodb}
+start_stop_daemon_args="--user ${user} --group ${group}"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ if [ ! -f ${config_file} ]; then
+ eerror "Missing configuration file ${config_file}"
+ return 1
+ fi
+}