system/mongodb: Updated for version 2.6.3.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Miguel De Anda 2014-07-05 07:58:12 +07:00 committed by Willy Sudiarto Raharjo
parent 3f7c0a401f
commit b46b769505
5 changed files with 59 additions and 13 deletions

View file

@ -1,2 +1,13 @@
MongoDB is a scalable, high-performance, open source document-oriented
database.
MongoDB is a scalable, high-performance, open source document-oriented database.
You'll need to create a mongo user and group in order to run mongo with the provided init script:
# groupadd -g 285 mongo
# useradd -u 285 -d /var/lib/mongodb -s /bin/false -g mongo mongo
You'll also need to add the following to /etc/rc.d/rc.local
if [ -x /etc/rc.d/rc.mongodb ]; then
/etc/rc.d/rc.mongodb start
fi

View file

@ -23,4 +23,3 @@ preserve_perms() {
}
preserve_perms etc/rc.d/rc.mongodb.new

View file

@ -4,7 +4,7 @@
# Home Page http://www.mongodb.org
PRGNAM="mongodb"
VERSION=${VERSION:-2.6.1}
VERSION=${VERSION:-2.6.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@ -21,8 +21,35 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
MONGO_USER=${MONGO_USER:-285}
MONGO_GROUP=${MONGO_GROUP:-285}
set -e
# Bail if user or group isn't valid on your system
if ! getent passwd mongo 1>/dev/null 2>/dev/null; then
cat << EOF
You must have a mongo user to run this script
# groupadd -g $MONGO_USER mongo
# useradd -u $MONGO_USER -d /var/lib/$PRGNAM -s /bin/false -g mongo mongo
EOF
exit
elif ! getent group mongo 1>/dev/null 2>/dev/null; then
cat << EOF
You must have a mongo group to run this script
# groupadd -g $MONGO_GROUP mongo
EOF
exit
fi
rm -fr $TMP/$PRGNAM-$VERSION $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@ -33,7 +60,7 @@ find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
mkdir -p ${PKG}/usr/doc/${PRGNAM}-${VERSION}
cp GNU-AGPL-3.0 README THIRD-PARTY-NOTICES ${PKG}/usr/doc/${PRGNAM}-${VERSION}
@ -47,5 +74,8 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
mkdir -p $PKG/var/lib/mongodb
chown mongo.mongo $PKG/var/lib/mongodb
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -1,10 +1,10 @@
PRGNAM="mongodb"
VERSION="2.6.1"
VERSION="2.6.3"
HOMEPAGE="http://www.mongodb.org/"
DOWNLOAD="https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.1.tgz"
MD5SUM="fb3c5fb843344c0a94f8de667f373629"
DOWNLOAD_x86_64="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgz"
MD5SUM_x86_64="d3e5505d95c67ba52206960995655ec7"
DOWNLOAD="https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.3.tgz"
MD5SUM="a82ff1787472399178589df5d8d45c81"
DOWNLOAD_x86_64="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.3.tgz"
MD5SUM_x86_64="9b3db9b6d889e6bc0d6e3bfe4316a85a"
REQUIRES=""
MAINTAINER="Miguel De Anda"
EMAIL="miguel@thedeanda.com"

View file

@ -9,20 +9,26 @@
PID=/var/state/mongodb.pid
LOG=/var/log/mongodb
DBPATH=/var/lib/mongodb
USER=mongo
GROUP=mongo
mongo_start() {
mkdir -p $DBPATH
/usr/bin/mongod \
touch $LOG
chown $GROUP.$USER $LOG
touch $PID
chown $GROUP.$USER $PID
sudo -u $USER /usr/bin/mongod \
--dbpath=$DBPATH \
--fork \
--pidfilepath=$PID \
--logappend \
--logpath=$LOG \
--nohttpinterface
}
mongo_stop() {
kill `cat $PID`
rm $PID
# rm $PID
}
mongo_restart() {