From 32b05a621cb20af1bd4b7cd6f5609b7512bb20f1 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Feb 2012 03:34:34 +0000 Subject: Wed Feb 29 03:34:34 UTC 2012 --- community-staging/mongodb/PKGBUILD | 73 +++++++++++++++++++++++++++++++ community-staging/mongodb/mongodb.conf | 8 ++++ community-staging/mongodb/mongodb.install | 32 ++++++++++++++ community-staging/mongodb/mongodb.rc | 39 +++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 community-staging/mongodb/PKGBUILD create mode 100644 community-staging/mongodb/mongodb.conf create mode 100644 community-staging/mongodb/mongodb.install create mode 100644 community-staging/mongodb/mongodb.rc (limited to 'community-staging/mongodb') diff --git a/community-staging/mongodb/PKGBUILD b/community-staging/mongodb/PKGBUILD new file mode 100644 index 000000000..1fa75aa93 --- /dev/null +++ b/community-staging/mongodb/PKGBUILD @@ -0,0 +1,73 @@ +# $Id: PKGBUILD 66732 2012-02-27 20:48:16Z tdziedzic $ +# Maintainer: Thomas Dziedzic < gostrc at gmail > +# Contributor: Mathias Stearn +# Contributor: Alec Thomas + +pkgname=mongodb +pkgver=2.0.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') +#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') +md5sums=('5dcf819249955a3e9cc61a341e45403a' + '9c67e00f4626ad761a8f7d4e037a54d7' + '4839fe1d638187ca3226e8267b947318') + +build() { + export SCONSFLAGS="$MAKEFLAGS" + + cd mongodb-src-r${pkgver} + + # fix python name for smoke tests + sed \ + -e 's/python/&2/' \ + -i SConstruct + + scons \ + all \ + --full +} + +< 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 +} diff --git a/community-staging/mongodb/mongodb.rc b/community-staging/mongodb/mongodb.rc new file mode 100644 index 000000000..30f2bbf79 --- /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 -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 -- cgit v1.2.3-54-g00ecf