[arch-commits] Commit in mongodb/repos (16 files)

fyan at nymeria.archlinux.org fyan at nymeria.archlinux.org
Tue Jan 22 06:43:59 UTC 2013


    Date: Tuesday, January 22, 2013 @ 07:43:59
  Author: fyan
Revision: 82631

archrelease: copy trunk to community-staging-i686, community-staging-x86_64

Added:
  mongodb/repos/community-staging-i686/
  mongodb/repos/community-staging-i686/PKGBUILD
    (from rev 82630, mongodb/trunk/PKGBUILD)
  mongodb/repos/community-staging-i686/SConscript.client.patch
    (from rev 82630, mongodb/trunk/SConscript.client.patch)
  mongodb/repos/community-staging-i686/boost1.50.patch
    (from rev 82630, mongodb/trunk/boost1.50.patch)
  mongodb/repos/community-staging-i686/mongodb.conf
    (from rev 82630, mongodb/trunk/mongodb.conf)
  mongodb/repos/community-staging-i686/mongodb.install
    (from rev 82630, mongodb/trunk/mongodb.install)
  mongodb/repos/community-staging-i686/mongodb.rc
    (from rev 82630, mongodb/trunk/mongodb.rc)
  mongodb/repos/community-staging-i686/mongodb.service
    (from rev 82630, mongodb/trunk/mongodb.service)
  mongodb/repos/community-staging-x86_64/
  mongodb/repos/community-staging-x86_64/PKGBUILD
    (from rev 82630, mongodb/trunk/PKGBUILD)
  mongodb/repos/community-staging-x86_64/SConscript.client.patch
    (from rev 82630, mongodb/trunk/SConscript.client.patch)
  mongodb/repos/community-staging-x86_64/boost1.50.patch
    (from rev 82630, mongodb/trunk/boost1.50.patch)
  mongodb/repos/community-staging-x86_64/mongodb.conf
    (from rev 82630, mongodb/trunk/mongodb.conf)
  mongodb/repos/community-staging-x86_64/mongodb.install
    (from rev 82630, mongodb/trunk/mongodb.install)
  mongodb/repos/community-staging-x86_64/mongodb.rc
    (from rev 82630, mongodb/trunk/mongodb.rc)
  mongodb/repos/community-staging-x86_64/mongodb.service
    (from rev 82630, mongodb/trunk/mongodb.service)

--------------------------------------------------+
 community-staging-i686/PKGBUILD                  |   74 ++++++
 community-staging-i686/SConscript.client.patch   |   13 +
 community-staging-i686/boost1.50.patch           |  237 +++++++++++++++++++++
 community-staging-i686/mongodb.conf              |    8 
 community-staging-i686/mongodb.install           |   32 ++
 community-staging-i686/mongodb.rc                |   39 +++
 community-staging-i686/mongodb.service           |   10 
 community-staging-x86_64/PKGBUILD                |   74 ++++++
 community-staging-x86_64/SConscript.client.patch |   13 +
 community-staging-x86_64/boost1.50.patch         |  237 +++++++++++++++++++++
 community-staging-x86_64/mongodb.conf            |    8 
 community-staging-x86_64/mongodb.install         |   32 ++
 community-staging-x86_64/mongodb.rc              |   39 +++
 community-staging-x86_64/mongodb.service         |   10 
 14 files changed, 826 insertions(+)

Copied: mongodb/repos/community-staging-i686/PKGBUILD (from rev 82630, mongodb/trunk/PKGBUILD)
===================================================================
--- community-staging-i686/PKGBUILD	                        (rev 0)
+++ community-staging-i686/PKGBUILD	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,74 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at gmail.com>
+# Contributor: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+# Contributor: Mathias Stearn <mathias at 10gen.com>
+# Contributor: Alec Thomas
+
+pkgname=mongodb
+pkgver=2.2.2
+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')
+makedepends=('scons' 'boost' 'libpcap')
+checkdepends=('python2-pymongo')
+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' 'mongodb.service'
+        'SConscript.client.patch' 'boost1.50.patch')
+
+build() {
+  # fucking mongo aint no fun to package
+  export SCONSFLAGS="$MAKEFLAGS"
+
+  cd mongodb-src-r${pkgver}
+
+  # fix https://jira.mongodb.org/browse/SERVER-5575
+  patch -Np1 -i ${srcdir}/SConscript.client.patch
+
+  # fix boost incompatibility
+  patch -Np1 -i ${srcdir}/boost1.50.patch
+
+  scons all --use-system-boost # --sharedclient currently fails
+}
+
+<<COMMENT
+check() {
+  export SCONSFLAGS="$MAKEFLAGS"
+
+  cd mongodb-src-r${pkgver}
+
+  scons smokeAll --smokedbprefix=$srcdir
+}
+COMMENT
+
+package() {
+  export SCONSFLAGS="$MAKEFLAGS"
+
+  cd mongodb-src-r${pkgver}
+
+  scons install --use-system-boost --full --prefix=$pkgdir/usr # --sharedclient currently fails
+
+  install -Dm755 $srcdir/mongodb.rc $pkgdir/etc/rc.d/mongodb
+  install -Dm644 $srcdir/mongodb.conf $pkgdir/etc/mongodb.conf
+  [[ -f $pkgdir/usr/lib ]] && rm $pkgdir/usr/lib # wtf mongo
+  install -Dm644 $srcdir/mongodb.service $pkgdir/usr/lib/systemd/system/mongodb.service
+  install -dm700 $pkgdir/var/lib/mongodb
+  install -dm755 $pkgdir/var/log/mongodb
+
+  # the earlier SConscript patch actually gives us some trouble on x86_64 so we need to hack it out again
+  mv ${pkgdir}/usr/lib64/libmongoclient.a ${pkgdir}/usr/lib/ || true
+  rm -r ${pkgdir}/usr/lib64 || true
+
+}
+md5sums=('697c448271358545a8a40a973f88edf4'
+         '9c67e00f4626ad761a8f7d4e037a54d7'
+         '4839fe1d638187ca3226e8267b947318'
+         '96ab4517b48974ce0e566d9746a75a4f'
+         'a9529e2a6e392ffecef7a9178394c814'
+         'da8a9d78e4a38d1ed8e92a210d4b5ba7')

Copied: mongodb/repos/community-staging-i686/SConscript.client.patch (from rev 82630, mongodb/trunk/SConscript.client.patch)
===================================================================
--- community-staging-i686/SConscript.client.patch	                        (rev 0)
+++ community-staging-i686/SConscript.client.patch	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,13 @@
+diff --git a/src/SConscript.client b/src/SConscript.client
+index 7a6bdc9..3fb55e5 100644
+--- a/src/SConscript.client
++++ b/src/SConscript.client
+@@ -134,7 +134,7 @@ env.Install(
+ # install
+ prefix = GetOption("prefix")
+ 
+-env.Install(prefix + "/lib", '${LIBPREFIX}mongoclient${LIBSUFFIX}')
++env.InstallAs(prefix + "/lib", '${LIBPREFIX}mongoclient${LIBSUFFIX}')
+ 
+ for x in clientHeaderDirectories:
+     env.Install(prefix + "/include/mongo/" + x,

Copied: mongodb/repos/community-staging-i686/boost1.50.patch (from rev 82630, mongodb/trunk/boost1.50.patch)
===================================================================
--- community-staging-i686/boost1.50.patch	                        (rev 0)
+++ community-staging-i686/boost1.50.patch	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,237 @@
+diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
+index 6a80fe9..4a42e73 100644
+--- a/src/mongo/db/db.cpp
++++ b/src/mongo/db/db.cpp
+@@ -18,6 +18,7 @@
+ 
+ #include "mongo/pch.h"
+ 
++#include <boost/version.hpp>
+ #include <boost/thread/thread.hpp>
+ #include <boost/filesystem/operations.hpp>
+ #include <fstream>
+@@ -348,7 +349,7 @@ namespace mongo {
+         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 );
+@@ -748,11 +749,6 @@ static int mongoDbMain(int argc, char* argv[]) {
+     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;
+@@ -1083,7 +1079,7 @@ static int mongoDbMain(int argc, char* argv[]) {
+         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 --git a/src/mongo/db/dur.cpp b/src/mongo/db/dur.cpp
+index b83957b..242fe00 100644
+--- a/src/mongo/db/dur.cpp
++++ b/src/mongo/db/dur.cpp
+@@ -770,7 +770,7 @@ namespace mongo {
+ 
+             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 --git a/src/mongo/db/dur_journal.cpp b/src/mongo/db/dur_journal.cpp
+index 9957d41..9f693b9 100644
+--- a/src/mongo/db/dur_journal.cpp
++++ b/src/mongo/db/dur_journal.cpp
+@@ -176,7 +176,7 @@ namespace mongo {
+                 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( anyFiles || str::startsWith(fileName, "j._") )
+                         return true;
+                 }
+@@ -194,7 +194,7 @@ namespace mongo {
+                 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 --git a/src/mongo/db/dur_recover.cpp b/src/mongo/db/dur_recover.cpp
+index a7efd4d..e352db6 100644
+--- a/src/mongo/db/dur_recover.cpp
++++ b/src/mongo/db/dur_recover.cpp
+@@ -72,7 +72,7 @@ namespace mongo {
+                     i != boost::filesystem::directory_iterator();
+                     ++i ) {
+                 boost::filesystem::path filepath = *i;
+-                string fileName = boost::filesystem::path(*i).leaf();
++                string fileName = boost::filesystem::path(*i).leaf().string();
+                 if( str::startsWith(fileName, "j._") ) {
+                     unsigned u = str::toUnsigned( str::after(fileName, '_') );
+                     if( m.count(u) ) {
+@@ -85,7 +85,7 @@ namespace mongo {
+                 if( i != m.begin() && m.count(i->first - 1) == 0 ) {
+                     uasserted(13532,
+                     str::stream() << "unexpected file in journal directory " << dir.string()
+-                      << " : " << boost::filesystem::path(i->second).leaf() << " : can't find its preceeding file");
++                      << " : " << boost::filesystem::path(i->second).leaf().string() << " : can't find its preceeding file");
+                 }
+                 files.push_back(i->second);
+             }
+diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
+index 218fb9e..42794f0 100644
+--- a/src/mongo/db/instance.cpp
++++ b/src/mongo/db/instance.cpp
+@@ -833,13 +833,13 @@ namespace mongo {
+                 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 ( 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 ) );
+             }
+@@ -1102,7 +1102,7 @@ namespace mongo {
+     }
+ 
+     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 --git a/src/mongo/db/pdfile.cpp b/src/mongo/db/pdfile.cpp
+index 0c424f0..9fbbde7 100644
+--- a/src/mongo/db/pdfile.cpp
++++ b/src/mongo/db/pdfile.cpp
+@@ -1675,7 +1675,7 @@ namespace mongo {
+             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 {
+@@ -1783,7 +1783,7 @@ namespace mongo {
+             uniqueReservedPath( ( preserveClonedFilesOnFailure || backupOriginalFiles ) ?
+                                 "backup" : "_tmp" );
+         MONGO_ASSERT_ON_EXCEPTION( boost::filesystem::create_directory( reservedPath ) );
+-        string reservedPathString = reservedPath.native_directory_string();
++        string reservedPathString = reservedPath.string();
+ 
+         bool res;
+         {
+diff --git a/src/mongo/dbtests/framework.cpp b/src/mongo/dbtests/framework.cpp
+index 813705a..d0a3ba4 100644
+--- a/src/mongo/dbtests/framework.cpp
++++ b/src/mongo/dbtests/framework.cpp
+@@ -199,7 +199,7 @@ namespace mongo {
+                 boost::filesystem::create_directory(p);
+             }
+ 
+-            string dbpathString = p.native_directory_string();
++            string dbpathString = p.string();
+             dbpath = dbpathString.c_str();
+ 
+             cmdLine.prealloc = false;
+diff --git a/src/mongo/pch.h b/src/mongo/pch.h
+index 7044097..6bb9df6 100644
+--- a/src/mongo/pch.h
++++ b/src/mongo/pch.h
+@@ -44,7 +44,7 @@
+ #include "string.h"
+ #include "limits.h"
+ 
+-#define BOOST_FILESYSTEM_VERSION 2
++#define BOOST_FILESYSTEM_VERSION 3
+ #include <boost/shared_ptr.hpp>
+ #include <boost/smart_ptr.hpp>
+ #include <boost/function.hpp>
+diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
+index 60af4f3..fa0d6ad 100644
+--- a/src/mongo/shell/shell_utils_launcher.cpp
++++ b/src/mongo/shell/shell_utils_launcher.cpp
+@@ -184,7 +184,7 @@ namespace mongo {
+             }
+ #endif
+ 
+-            _argv.push_back( programPath.native_file_string() );
++            _argv.push_back( programPath.string() );
+ 
+             _port = -1;
+ 
+diff --git a/src/mongo/tools/restore.cpp b/src/mongo/tools/restore.cpp
+index d7779e6..5c68bde 100644
+--- a/src/mongo/tools/restore.cpp
++++ b/src/mongo/tools/restore.cpp
+@@ -174,7 +174,7 @@ public:
+         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 ) ) {
+@@ -255,7 +255,7 @@ public:
+ 
+         verify( ns.size() );
+ 
+-        string oldCollName = root.leaf(); // Name of the collection that was dumped from
++        string oldCollName = root.leaf().string(); // Name of the collection that was dumped from
+         oldCollName = oldCollName.substr( 0 , oldCollName.find_last_of( "." ) );
+         if (use_coll) {
+             ns += "." + _coll;
+@@ -287,7 +287,7 @@ public:
+             if (!boost::filesystem::exists(metadataFile.string())) {
+                 // This is fine because dumps from before 2.1 won't have a metadata file, just print a warning.
+                 // System collections shouldn't have metadata so don't warn if that file is missing.
+-                if (!startsWith(metadataFile.leaf(), "system.")) {
++                if (!startsWith(metadataFile.leaf().string(), "system.")) {
+                     log() << metadataFile.string() << " not found. Skipping." << endl;
+                 }
+             } else {
+diff --git a/src/mongo/tools/tool.cpp b/src/mongo/tools/tool.cpp
+index c092cdb..76834fa 100644
+--- a/src/mongo/tools/tool.cpp
++++ b/src/mongo/tools/tool.cpp
+@@ -118,12 +118,6 @@ namespace mongo {
+         // 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 */

Copied: mongodb/repos/community-staging-i686/mongodb.conf (from rev 82630, mongodb/trunk/mongodb.conf)
===================================================================
--- community-staging-i686/mongodb.conf	                        (rev 0)
+++ community-staging-i686/mongodb.conf	2013-01-22 06:43:59 UTC (rev 82631)
@@ -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

Copied: mongodb/repos/community-staging-i686/mongodb.install (from rev 82630, mongodb/trunk/mongodb.install)
===================================================================
--- community-staging-i686/mongodb.install	                        (rev 0)
+++ community-staging-i686/mongodb.install	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,32 @@
+# vim: syntax=sh
+
+post_install() {
+  useradd -r -g daemon -d /var/lib/mongodb -s /bin/bash mongodb
+  chown -R mongodb:daemon /var/lib/mongodb
+  chown -R mongodb:daemon /var/log/mongodb
+
+  if [ "$(uname -m)" != "x86_64" ]
+  then
+    echo '==> Warning: the 32 bit version of MongoDB is limited to about 2GB of data.'
+    echo '==> See http://blog.mongodb.org/post/137788967/32-bit-limitations'
+  fi
+}
+
+post_upgrade() {
+  chown -R mongodb:daemon /var/lib/mongodb
+  chown -R mongodb:daemon /var/log/mongodb
+
+  if [ "$(vercmp $2 1.8.2-3)" -lt 0 ]
+  then
+    # have to fix my fudge up in 1.8.2-2 and 1.8.2-3
+    # added july 5th, 2011
+    usermod -s /bin/bash mongodb >& /dev/null
+    echo 'The dbpath has changed from /var/state/mongodb to /var/lib/mongodb'
+    echo 'Make sure you move your data files to the new dbpath before you start/restart mongodb'
+    echo 'The logpath has changed from /var/log/mongod to /var/log/mongodb/mongod.log'
+  fi
+}
+
+pre_remove() {
+  userdel mongodb
+}

Copied: mongodb/repos/community-staging-i686/mongodb.rc (from rev 82630, mongodb/trunk/mongodb.rc)
===================================================================
--- community-staging-i686/mongodb.rc	                        (rev 0)
+++ community-staging-i686/mongodb.rc	2013-01-22 06:43:59 UTC (rev 82631)
@@ -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 -c "/usr/bin/mongod --config /etc/mongodb.conf --fork" > /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon mongodb
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping mongodb"
+    [ ! -z "$PID" ] && /bin/su mongodb -c "/usr/bin/mongod --config /etc/mongodb.conf --shutdown" &> /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

Copied: mongodb/repos/community-staging-i686/mongodb.service (from rev 82630, mongodb/trunk/mongodb.service)
===================================================================
--- community-staging-i686/mongodb.service	                        (rev 0)
+++ community-staging-i686/mongodb.service	2013-01-22 06:43:59 UTC (rev 82631)
@@ -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

Copied: mongodb/repos/community-staging-x86_64/PKGBUILD (from rev 82630, mongodb/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,74 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at gmail.com>
+# Contributor: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+# Contributor: Mathias Stearn <mathias at 10gen.com>
+# Contributor: Alec Thomas
+
+pkgname=mongodb
+pkgver=2.2.2
+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')
+makedepends=('scons' 'boost' 'libpcap')
+checkdepends=('python2-pymongo')
+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' 'mongodb.service'
+        'SConscript.client.patch' 'boost1.50.patch')
+
+build() {
+  # fucking mongo aint no fun to package
+  export SCONSFLAGS="$MAKEFLAGS"
+
+  cd mongodb-src-r${pkgver}
+
+  # fix https://jira.mongodb.org/browse/SERVER-5575
+  patch -Np1 -i ${srcdir}/SConscript.client.patch
+
+  # fix boost incompatibility
+  patch -Np1 -i ${srcdir}/boost1.50.patch
+
+  scons all --use-system-boost # --sharedclient currently fails
+}
+
+<<COMMENT
+check() {
+  export SCONSFLAGS="$MAKEFLAGS"
+
+  cd mongodb-src-r${pkgver}
+
+  scons smokeAll --smokedbprefix=$srcdir
+}
+COMMENT
+
+package() {
+  export SCONSFLAGS="$MAKEFLAGS"
+
+  cd mongodb-src-r${pkgver}
+
+  scons install --use-system-boost --full --prefix=$pkgdir/usr # --sharedclient currently fails
+
+  install -Dm755 $srcdir/mongodb.rc $pkgdir/etc/rc.d/mongodb
+  install -Dm644 $srcdir/mongodb.conf $pkgdir/etc/mongodb.conf
+  [[ -f $pkgdir/usr/lib ]] && rm $pkgdir/usr/lib # wtf mongo
+  install -Dm644 $srcdir/mongodb.service $pkgdir/usr/lib/systemd/system/mongodb.service
+  install -dm700 $pkgdir/var/lib/mongodb
+  install -dm755 $pkgdir/var/log/mongodb
+
+  # the earlier SConscript patch actually gives us some trouble on x86_64 so we need to hack it out again
+  mv ${pkgdir}/usr/lib64/libmongoclient.a ${pkgdir}/usr/lib/ || true
+  rm -r ${pkgdir}/usr/lib64 || true
+
+}
+md5sums=('697c448271358545a8a40a973f88edf4'
+         '9c67e00f4626ad761a8f7d4e037a54d7'
+         '4839fe1d638187ca3226e8267b947318'
+         '96ab4517b48974ce0e566d9746a75a4f'
+         'a9529e2a6e392ffecef7a9178394c814'
+         'da8a9d78e4a38d1ed8e92a210d4b5ba7')

Copied: mongodb/repos/community-staging-x86_64/SConscript.client.patch (from rev 82630, mongodb/trunk/SConscript.client.patch)
===================================================================
--- community-staging-x86_64/SConscript.client.patch	                        (rev 0)
+++ community-staging-x86_64/SConscript.client.patch	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,13 @@
+diff --git a/src/SConscript.client b/src/SConscript.client
+index 7a6bdc9..3fb55e5 100644
+--- a/src/SConscript.client
++++ b/src/SConscript.client
+@@ -134,7 +134,7 @@ env.Install(
+ # install
+ prefix = GetOption("prefix")
+ 
+-env.Install(prefix + "/lib", '${LIBPREFIX}mongoclient${LIBSUFFIX}')
++env.InstallAs(prefix + "/lib", '${LIBPREFIX}mongoclient${LIBSUFFIX}')
+ 
+ for x in clientHeaderDirectories:
+     env.Install(prefix + "/include/mongo/" + x,

Copied: mongodb/repos/community-staging-x86_64/boost1.50.patch (from rev 82630, mongodb/trunk/boost1.50.patch)
===================================================================
--- community-staging-x86_64/boost1.50.patch	                        (rev 0)
+++ community-staging-x86_64/boost1.50.patch	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,237 @@
+diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
+index 6a80fe9..4a42e73 100644
+--- a/src/mongo/db/db.cpp
++++ b/src/mongo/db/db.cpp
+@@ -18,6 +18,7 @@
+ 
+ #include "mongo/pch.h"
+ 
++#include <boost/version.hpp>
+ #include <boost/thread/thread.hpp>
+ #include <boost/filesystem/operations.hpp>
+ #include <fstream>
+@@ -348,7 +349,7 @@ namespace mongo {
+         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 );
+@@ -748,11 +749,6 @@ static int mongoDbMain(int argc, char* argv[]) {
+     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;
+@@ -1083,7 +1079,7 @@ static int mongoDbMain(int argc, char* argv[]) {
+         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 --git a/src/mongo/db/dur.cpp b/src/mongo/db/dur.cpp
+index b83957b..242fe00 100644
+--- a/src/mongo/db/dur.cpp
++++ b/src/mongo/db/dur.cpp
+@@ -770,7 +770,7 @@ namespace mongo {
+ 
+             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 --git a/src/mongo/db/dur_journal.cpp b/src/mongo/db/dur_journal.cpp
+index 9957d41..9f693b9 100644
+--- a/src/mongo/db/dur_journal.cpp
++++ b/src/mongo/db/dur_journal.cpp
+@@ -176,7 +176,7 @@ namespace mongo {
+                 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( anyFiles || str::startsWith(fileName, "j._") )
+                         return true;
+                 }
+@@ -194,7 +194,7 @@ namespace mongo {
+                 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 --git a/src/mongo/db/dur_recover.cpp b/src/mongo/db/dur_recover.cpp
+index a7efd4d..e352db6 100644
+--- a/src/mongo/db/dur_recover.cpp
++++ b/src/mongo/db/dur_recover.cpp
+@@ -72,7 +72,7 @@ namespace mongo {
+                     i != boost::filesystem::directory_iterator();
+                     ++i ) {
+                 boost::filesystem::path filepath = *i;
+-                string fileName = boost::filesystem::path(*i).leaf();
++                string fileName = boost::filesystem::path(*i).leaf().string();
+                 if( str::startsWith(fileName, "j._") ) {
+                     unsigned u = str::toUnsigned( str::after(fileName, '_') );
+                     if( m.count(u) ) {
+@@ -85,7 +85,7 @@ namespace mongo {
+                 if( i != m.begin() && m.count(i->first - 1) == 0 ) {
+                     uasserted(13532,
+                     str::stream() << "unexpected file in journal directory " << dir.string()
+-                      << " : " << boost::filesystem::path(i->second).leaf() << " : can't find its preceeding file");
++                      << " : " << boost::filesystem::path(i->second).leaf().string() << " : can't find its preceeding file");
+                 }
+                 files.push_back(i->second);
+             }
+diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
+index 218fb9e..42794f0 100644
+--- a/src/mongo/db/instance.cpp
++++ b/src/mongo/db/instance.cpp
+@@ -833,13 +833,13 @@ namespace mongo {
+                 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 ( 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 ) );
+             }
+@@ -1102,7 +1102,7 @@ namespace mongo {
+     }
+ 
+     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 --git a/src/mongo/db/pdfile.cpp b/src/mongo/db/pdfile.cpp
+index 0c424f0..9fbbde7 100644
+--- a/src/mongo/db/pdfile.cpp
++++ b/src/mongo/db/pdfile.cpp
+@@ -1675,7 +1675,7 @@ namespace mongo {
+             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 {
+@@ -1783,7 +1783,7 @@ namespace mongo {
+             uniqueReservedPath( ( preserveClonedFilesOnFailure || backupOriginalFiles ) ?
+                                 "backup" : "_tmp" );
+         MONGO_ASSERT_ON_EXCEPTION( boost::filesystem::create_directory( reservedPath ) );
+-        string reservedPathString = reservedPath.native_directory_string();
++        string reservedPathString = reservedPath.string();
+ 
+         bool res;
+         {
+diff --git a/src/mongo/dbtests/framework.cpp b/src/mongo/dbtests/framework.cpp
+index 813705a..d0a3ba4 100644
+--- a/src/mongo/dbtests/framework.cpp
++++ b/src/mongo/dbtests/framework.cpp
+@@ -199,7 +199,7 @@ namespace mongo {
+                 boost::filesystem::create_directory(p);
+             }
+ 
+-            string dbpathString = p.native_directory_string();
++            string dbpathString = p.string();
+             dbpath = dbpathString.c_str();
+ 
+             cmdLine.prealloc = false;
+diff --git a/src/mongo/pch.h b/src/mongo/pch.h
+index 7044097..6bb9df6 100644
+--- a/src/mongo/pch.h
++++ b/src/mongo/pch.h
+@@ -44,7 +44,7 @@
+ #include "string.h"
+ #include "limits.h"
+ 
+-#define BOOST_FILESYSTEM_VERSION 2
++#define BOOST_FILESYSTEM_VERSION 3
+ #include <boost/shared_ptr.hpp>
+ #include <boost/smart_ptr.hpp>
+ #include <boost/function.hpp>
+diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
+index 60af4f3..fa0d6ad 100644
+--- a/src/mongo/shell/shell_utils_launcher.cpp
++++ b/src/mongo/shell/shell_utils_launcher.cpp
+@@ -184,7 +184,7 @@ namespace mongo {
+             }
+ #endif
+ 
+-            _argv.push_back( programPath.native_file_string() );
++            _argv.push_back( programPath.string() );
+ 
+             _port = -1;
+ 
+diff --git a/src/mongo/tools/restore.cpp b/src/mongo/tools/restore.cpp
+index d7779e6..5c68bde 100644
+--- a/src/mongo/tools/restore.cpp
++++ b/src/mongo/tools/restore.cpp
+@@ -174,7 +174,7 @@ public:
+         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 ) ) {
+@@ -255,7 +255,7 @@ public:
+ 
+         verify( ns.size() );
+ 
+-        string oldCollName = root.leaf(); // Name of the collection that was dumped from
++        string oldCollName = root.leaf().string(); // Name of the collection that was dumped from
+         oldCollName = oldCollName.substr( 0 , oldCollName.find_last_of( "." ) );
+         if (use_coll) {
+             ns += "." + _coll;
+@@ -287,7 +287,7 @@ public:
+             if (!boost::filesystem::exists(metadataFile.string())) {
+                 // This is fine because dumps from before 2.1 won't have a metadata file, just print a warning.
+                 // System collections shouldn't have metadata so don't warn if that file is missing.
+-                if (!startsWith(metadataFile.leaf(), "system.")) {
++                if (!startsWith(metadataFile.leaf().string(), "system.")) {
+                     log() << metadataFile.string() << " not found. Skipping." << endl;
+                 }
+             } else {
+diff --git a/src/mongo/tools/tool.cpp b/src/mongo/tools/tool.cpp
+index c092cdb..76834fa 100644
+--- a/src/mongo/tools/tool.cpp
++++ b/src/mongo/tools/tool.cpp
+@@ -118,12 +118,6 @@ namespace mongo {
+         // 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 */

Copied: mongodb/repos/community-staging-x86_64/mongodb.conf (from rev 82630, mongodb/trunk/mongodb.conf)
===================================================================
--- community-staging-x86_64/mongodb.conf	                        (rev 0)
+++ community-staging-x86_64/mongodb.conf	2013-01-22 06:43:59 UTC (rev 82631)
@@ -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

Copied: mongodb/repos/community-staging-x86_64/mongodb.install (from rev 82630, mongodb/trunk/mongodb.install)
===================================================================
--- community-staging-x86_64/mongodb.install	                        (rev 0)
+++ community-staging-x86_64/mongodb.install	2013-01-22 06:43:59 UTC (rev 82631)
@@ -0,0 +1,32 @@
+# vim: syntax=sh
+
+post_install() {
+  useradd -r -g daemon -d /var/lib/mongodb -s /bin/bash mongodb
+  chown -R mongodb:daemon /var/lib/mongodb
+  chown -R mongodb:daemon /var/log/mongodb
+
+  if [ "$(uname -m)" != "x86_64" ]
+  then
+    echo '==> Warning: the 32 bit version of MongoDB is limited to about 2GB of data.'
+    echo '==> See http://blog.mongodb.org/post/137788967/32-bit-limitations'
+  fi
+}
+
+post_upgrade() {
+  chown -R mongodb:daemon /var/lib/mongodb
+  chown -R mongodb:daemon /var/log/mongodb
+
+  if [ "$(vercmp $2 1.8.2-3)" -lt 0 ]
+  then
+    # have to fix my fudge up in 1.8.2-2 and 1.8.2-3
+    # added july 5th, 2011
+    usermod -s /bin/bash mongodb >& /dev/null
+    echo 'The dbpath has changed from /var/state/mongodb to /var/lib/mongodb'
+    echo 'Make sure you move your data files to the new dbpath before you start/restart mongodb'
+    echo 'The logpath has changed from /var/log/mongod to /var/log/mongodb/mongod.log'
+  fi
+}
+
+pre_remove() {
+  userdel mongodb
+}

Copied: mongodb/repos/community-staging-x86_64/mongodb.rc (from rev 82630, mongodb/trunk/mongodb.rc)
===================================================================
--- community-staging-x86_64/mongodb.rc	                        (rev 0)
+++ community-staging-x86_64/mongodb.rc	2013-01-22 06:43:59 UTC (rev 82631)
@@ -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 -c "/usr/bin/mongod --config /etc/mongodb.conf --fork" > /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon mongodb
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping mongodb"
+    [ ! -z "$PID" ] && /bin/su mongodb -c "/usr/bin/mongod --config /etc/mongodb.conf --shutdown" &> /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

Copied: mongodb/repos/community-staging-x86_64/mongodb.service (from rev 82630, mongodb/trunk/mongodb.service)
===================================================================
--- community-staging-x86_64/mongodb.service	                        (rev 0)
+++ community-staging-x86_64/mongodb.service	2013-01-22 06:43:59 UTC (rev 82631)
@@ -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




More information about the arch-commits mailing list