system/mongodb: Added (Database Software)

Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
Miguel De Anda 2011-03-06 00:22:57 -03:00 committed by Niels Horn
parent 4a6ea94efa
commit 67d04ea4e2
6 changed files with 158 additions and 0 deletions

2
system/mongodb/README Normal file
View file

@ -0,0 +1,2 @@
MongoDB is a scalable, high-performance, open source document-oriented
database.

26
system/mongodb/doinst.sh Normal file
View file

@ -0,0 +1,26 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
preserve_perms etc/rc.d/rc.mongodb.new

View file

@ -0,0 +1,51 @@
#!/bin/sh
# Slackware Package Build Script for MongoDB
# Home Page http://www.mongodb.org
PRGNAM="mongodb"
VERSION="1.6.5"
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e
rm -fr $TMP/$PRGNAM-$VERSION $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
tar xvf $CWD/$PRGNAM-linux-$ARCH-$VERSION.tgz
cd $PRGNAM-linux-$ARCH-$VERSION
chown -R root.root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -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}
mkdir -p ${PKG}/usr/bin
cp bin/* ${PKG}/usr/bin
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.mongodb > $PKG/etc/rc.d/rc.mongodb.new
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -0,0 +1,10 @@
PRGNAM="mongodb"
VERSION="1.6.5"
HOMEPAGE="http://www.mongodb.org/"
DOWNLOAD="http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.5.tgz"
MD5SUM="c2b8dfed2c003ddfab535f0b6dff64d2"
DOWNLOAD_x86_64="http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.5.tgz"
MD5SUM_x86_64="0a64adafd9772b6b2d748c3b088bd895"
MAINTAINER="Miguel De Anda"
EMAIL="miguel@thedeanda.com"
APPROVED="Niels Horn"

49
system/mongodb/rc.mongodb Normal file
View file

@ -0,0 +1,49 @@
#!/bin/sh
#
# /etc/rc.d/rc.mongo
#
# Start/stop/restart the mongodb server.
#
#
PID=/var/state/mongodb.pid
LOG=/var/log/mongodb
DBPATH=/var/lib/mongodb
mongo_start() {
mkdir -p $DBPATH
/usr/bin/mongod \
--dbpath=$DBPATH \
--fork \
--pidfilepath=$PID \
--logpath=$LOG \
--nohttpinterface
}
mongo_stop() {
kill `cat $PID`
rm $PID
}
mongo_restart() {
mongo_stop
sleep 2
mongo_start
}
case "$1" in
'start')
mongo_start
;;
'stop')
mongo_stop
;;
'restart')
mongo_restart
;;
*)
# Default is "start", for backwards compatibility with previous
# Slackware versions. This may change to a 'usage' error someday.
mongo_start
esac

20
system/mongodb/slack-desc Normal file
View file

@ -0,0 +1,20 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
mongodb: mongodb (Database Software)
mongodb:
mongodb: MongoDB is a scalable, high-performance, open source
mongodb: document-oriented database.
mongodb:
mongodb: Homepage: http://www.mongodb.org/
mongodb:
mongodb:
mongodb:
mongodb:
mongodb: