diff options
author | root <root@rshg047.dnsready.net> | 2011-05-25 22:48:05 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-05-25 22:48:05 +0000 |
commit | 6e35be4b44d90f92ddceb8b067cbbf03fc652a35 (patch) | |
tree | 5a27309f3fe126e49f5a2f08f08b2526bc8d4dc2 /community-staging/mongodb | |
parent | 363d953113a327863013a9422c8212654a86a209 (diff) |
Wed May 25 22:48:05 UTC 2011
Diffstat (limited to 'community-staging/mongodb')
-rw-r--r-- | community-staging/mongodb/PKGBUILD | 61 | ||||
-rw-r--r-- | community-staging/mongodb/gcc46fixes.diff | 132 | ||||
-rw-r--r-- | community-staging/mongodb/gcc46fixes2.diff | 26 | ||||
-rw-r--r-- | community-staging/mongodb/mongodb.conf | 6 | ||||
-rwxr-xr-x | community-staging/mongodb/mongodb.install | 31 | ||||
-rwxr-xr-x | community-staging/mongodb/mongodb.rc | 39 |
6 files changed, 295 insertions, 0 deletions
diff --git a/community-staging/mongodb/PKGBUILD b/community-staging/mongodb/PKGBUILD new file mode 100644 index 000000000..c3e44c8fa --- /dev/null +++ b/community-staging/mongodb/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Thomas Dziedzic < gostrc at gmail > +# Contributor: Mathias Stearn <mathias@10gen.com> +# Contributor: Alec Thomas + +pkgname=mongodb +pkgver=1.8.1 +pkgrel=2 +pkgdesc='A high-performance, open source, schema-free document-oriented database.' +arch=('i686' 'x86_64') +url='http://www.mongodb.org' +license=('AGPL3') +depends=('boost-libs' 'spidermonkey' 'pcre') +makedepends=('scons' 'boost') +optdepends=('libpcap: needed for mongosniff') +backup=('etc/mongodb.conf') +install="mongodb.install" +source=("http://downloads.mongodb.org/src/mongodb-src-r${pkgver}.tar.gz" + 'mongodb.rc' + 'mongodb.conf' + 'gcc46fixes.diff' + 'gcc46fixes2.diff') +md5sums=('e75a5cae641a53760df8cb866ad5d929' + '859f8f9bb32ef2bd21fec55ae9a87d0a' + '9e0ea3f96732bb7811f0b64dace56440' + 'e90c78350e25df2d24f98e4767677d4b' + '5097de6ce2c347c3703ab8cf5a611052') + +build() { + export SCONSFLAGS="$MAKEFLAGS" + + cd ${pkgname}-src-r${pkgver} + + patch -Np1 -i ${srcdir}/gcc46fixes.diff + patch -Np1 -i ${srcdir}/gcc46fixes2.diff + + # scons is "special" + sed -i 's/-Wall -Wsign-compare/& -DBOOST_FILESYSTEM_VERSION=2/' SConstruct + + scons \ + all \ + --full +} + +package() { + cd ${pkgname}-src-r${pkgver} + + scons \ + install \ + --full \ + --prefix=${pkgdir}/usr + + install -D -m755 ${srcdir}/mongodb.rc \ + ${pkgdir}/etc/rc.d/mongodb + install -D -m644 ${srcdir}/mongodb.conf \ + ${pkgdir}/etc/mongodb.conf + install -d -m700 ${pkgdir}/var/state/mongodb + + if [ -d ${pkgdir}/usr/lib64 ]; then + mv ${pkgdir}/usr/lib64 ${pkgdir}/usr/lib + fi +} diff --git a/community-staging/mongodb/gcc46fixes.diff b/community-staging/mongodb/gcc46fixes.diff new file mode 100644 index 000000000..487c88f16 --- /dev/null +++ b/community-staging/mongodb/gcc46fixes.diff @@ -0,0 +1,132 @@ +commit fa7cd65e480d80ba1cd196bdcec8f4714e361e8e +Author: Mathias Stearn <redbeard0531@gmail.com> +Date: Sun Apr 3 19:10:36 2011 -0400 + + g++ 4.6 compile (new -Wunused-but-set-variable warning) + +diff --git a/db/btree.cpp b/db/btree.cpp +index 2758f72..4162d6a 100644 +--- a/db/btree.cpp ++++ b/db/btree.cpp +@@ -1226,8 +1226,6 @@ namespace mongo { + out() << " " << thisLoc.toString() << ".insertHere " << key.toString() << '/' << recordLoc.toString() << ' ' + << lchild.toString() << ' ' << rchild.toString() << " keypos:" << keypos << endl; + +- DiskLoc oldLoc = thisLoc; +- + if ( !basicInsert(thisLoc, keypos, recordLoc, key, order) ) { + // If basicInsert() fails, the bucket will be packed as required by split(). + thisLoc.btreemod()->split(thisLoc, keypos, recordLoc, key, order, lchild, rchild, idx); +diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp +index 2580f86..56c0fce 100644 +--- a/db/dbcommands.cpp ++++ b/db/dbcommands.cpp +@@ -1460,7 +1460,7 @@ namespace mongo { + uassert( 13049, "godinsert must specify a collection", !coll.empty() ); + string ns = dbname + "." + coll; + BSONObj obj = cmdObj[ "obj" ].embeddedObjectUserCheck(); +- DiskLoc loc = theDataFileMgr.insertWithObjMod( ns.c_str(), obj, true ); ++ theDataFileMgr.insertWithObjMod( ns.c_str(), obj, true ); + return true; + } + } cmdGodInsert; +diff --git a/db/index.cpp b/db/index.cpp +index c696e27..218ecb3 100644 +--- a/db/index.cpp ++++ b/db/index.cpp +@@ -127,7 +127,6 @@ namespace mongo { + void getIndexChanges(vector<IndexChanges>& v, NamespaceDetails& d, BSONObj newObj, BSONObj oldObj, bool &changedId) { + int z = d.nIndexesBeingBuilt(); + v.resize(z); +- NamespaceDetails::IndexIterator i = d.ii(); + for( int i = 0; i < z; i++ ) { + IndexDetails& idx = d.idx(i); + BSONObj idxKey = idx.info.obj().getObjectField("key"); // eg { ts : 1 } +diff --git a/db/update.cpp b/db/update.cpp +index e173902..85c3f9c 100644 +--- a/db/update.cpp ++++ b/db/update.cpp +@@ -992,7 +992,7 @@ namespace mongo { + BSONObj newObj = mss->createNewFromMods(); + checkTooLarge(newObj); + assert(nsdt); +- DiskLoc newLoc = theDataFileMgr.updateRecord(ns, d, nsdt, r, loc , newObj.objdata(), newObj.objsize(), debug); ++ theDataFileMgr.updateRecord(ns, d, nsdt, r, loc , newObj.objdata(), newObj.objsize(), debug); + } + + if ( logop ) { +diff --git a/dbtests/queryoptimizertests.cpp b/dbtests/queryoptimizertests.cpp +index acf9217..2d6f752 100644 +--- a/dbtests/queryoptimizertests.cpp ++++ b/dbtests/queryoptimizertests.cpp +@@ -1558,7 +1558,6 @@ namespace QueryOptimizerTests { + theDataFileMgr.insertWithObjMod( ns(), temp ); + } + BSONObj hint = fromjson( "{$hint:{a:1,b:1}}" ); +- BSONElement hintElt = hint.firstElement(); + auto_ptr< FieldRangeSet > frs( new FieldRangeSet( ns(), fromjson( "{a:5,b:{$in:[2,3,6,9,11]}}" ) ) ); + QueryPlan qp( nsd(), 1, *frs, *frs, fromjson( "{a:5,b:{$in:[2,3,6,9,11]}}" ), BSONObj() ); + boost::shared_ptr<Cursor> c = qp.newCursor(); +@@ -1581,7 +1580,6 @@ namespace QueryOptimizerTests { + theDataFileMgr.insertWithObjMod( ns(), temp ); + } + BSONObj hint = fromjson( "{$hint:{a:1,b:1}}" ); +- BSONElement hintElt = hint.firstElement(); + auto_ptr< FieldRangeSet > frs( new FieldRangeSet( ns(), fromjson( "{a:{$gte:5},b:{$in:[2,3,6,9,11]}}" ) ) ); + QueryPlan qp( nsd(), 1, *frs, *frs, fromjson( "{a:{$gte:5},b:{$in:[2,3,6,9,11]}}" ), BSONObj() ); + boost::shared_ptr<Cursor> c = qp.newCursor(); +diff --git a/shell/shell_utils.cpp b/shell/shell_utils.cpp +index 6c398ef..53484fd 100644 +--- a/shell/shell_utils.cpp ++++ b/shell/shell_utils.cpp +@@ -260,7 +260,7 @@ namespace mongo { + BSONElement e = oneArg(args); + bool found = false; + +- path root( args.firstElement().valuestrsafe() ); ++ path root( e.valuestrsafe() ); + if ( boost::filesystem::exists( root ) ) { + found = true; + boost::filesystem::remove_all( root ); +diff --git a/tools/tool.cpp b/tools/tool.cpp +index 92a4bd4..150481b 100644 +--- a/tools/tool.cpp ++++ b/tools/tool.cpp +@@ -413,14 +413,14 @@ namespace mongo { + ProgressMeter m( fileLength ); + + while ( read < fileLength ) { +- int readlen = fread(buf, 4, 1, file); ++ fread(buf, 4, 1, file); + int size = ((int*)buf)[0]; + if ( size >= BUF_SIZE ) { + cerr << "got an object of size: " << size << " terminating..." << endl; + } + uassert( 10264 , "invalid object size" , size < BUF_SIZE ); + +- readlen = fread(buf+4, size-4, 1, file); ++ fread(buf+4, size-4, 1, file); + + BSONObj o( buf ); + if ( _objcheck && ! o.valid() ) { +diff --git a/util/ramlog.h b/util/ramlog.h +index fc588e6..b2f3aa0 100644 +--- a/util/ramlog.h ++++ b/util/ramlog.h +@@ -108,7 +108,6 @@ namespace mongo { + vector<const char*> v; + get( v ); + +- bool first = true; + s << "<pre>\n"; + for( int i = 0; i < (int)v.size(); i++ ) { + assert( strlen(v[i]) > 20 ); +@@ -126,7 +125,7 @@ namespace mongo { + stringstream r; + if( nr == 1 ) r << "repeat last line"; + else r << "repeats last " << nr << " lines; ends " << string(v[last]+4,0,15); +- first = false; s << html::a("", r.str(), clean(v,i,x.str())); ++ s << html::a("", r.str(), clean(v,i,x.str())); + } + else s << x.str(); + s << '\n'; diff --git a/community-staging/mongodb/gcc46fixes2.diff b/community-staging/mongodb/gcc46fixes2.diff new file mode 100644 index 000000000..17257b136 --- /dev/null +++ b/community-staging/mongodb/gcc46fixes2.diff @@ -0,0 +1,26 @@ +commit 5931bc0231c91ecdfc5dd313d8cce578eae426bb +Author: Eliot Horowitz <eliot@10gen.com> +Date: Wed Mar 30 01:01:18 2011 -0400 + + remove unused variable + +diff --git a/db/commands.cpp b/db/commands.cpp +index c301fb3..0bbd765 100644 +--- a/db/commands.cpp ++++ b/db/commands.cpp +@@ -127,7 +127,6 @@ namespace mongo { + if ( strcmp(p, ".$cmd") != 0 ) return false; + + bool ok = false; +- bool valid = false; + + BSONElement e = jsobj.firstElement(); + map<string,Command*>::iterator i; +@@ -138,7 +137,6 @@ namespace mongo { + migrated over to the command object format. + */ + else if ( (i = _commands->find(e.fieldName())) != _commands->end() ) { +- valid = true; + string errmsg; + Command *c = i->second; + if ( c->adminOnly() && !startsWith(ns, "admin.") ) { diff --git a/community-staging/mongodb/mongodb.conf b/community-staging/mongodb/mongodb.conf new file mode 100644 index 000000000..60d73eae8 --- /dev/null +++ b/community-staging/mongodb/mongodb.conf @@ -0,0 +1,6 @@ +# 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/state/mongodb diff --git a/community-staging/mongodb/mongodb.install b/community-staging/mongodb/mongodb.install new file mode 100755 index 000000000..152f36515 --- /dev/null +++ b/community-staging/mongodb/mongodb.install @@ -0,0 +1,31 @@ +# vim: syntax=sh + +show_msg(){ + if [ "$(arch)" != "x86_64" ] + then + cat <<END +########################################################################### +# Warning: the 32 bit version of MongoDB is limited to about 2GB of data. # +# See http://blog.mongodb.org/post/137788967/32-bit-limitations # +########################################################################### +END + fi +} + +post_install() { + useradd -r -g daemon -d /var/state/mongodb -s /bin/false mongodb + chown -R mongodb:daemon /var/state/mongodb + + show_msg +} + +post_upgrade() { + chown -R mongodb:daemon /var/state/mongodb + + show_msg +} + +pre_remove() { + /etc/rc.d/mongodb stop + userdel mongodb +} diff --git a/community-staging/mongodb/mongodb.rc b/community-staging/mongodb/mongodb.rc new file mode 100755 index 000000000..b808a2fb0 --- /dev/null +++ b/community-staging/mongodb/mongodb.rc @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: syntax=sh + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof /usr/bin/mongod` +case "$1" in + start) + stat_busy "Starting mongodb" + [ -z "$PID" ] && /bin/su mongodb -s /bin/bash -c "/usr/bin/mongod --config /etc/mongodb.conf &" > /var/log/mongod 2>&1 + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon mongodb + stat_done + fi + ;; + stop) + stat_busy "Stopping mongodb" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon mongodb + while [ ! -z "$(pidof /usr/bin/mongod)" ]; do + sleep 1; + done + stat_done + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |