diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/mongodb/README | 2 | ||||
-rw-r--r-- | system/mongodb/doinst.sh | 26 | ||||
-rw-r--r-- | system/mongodb/mongodb.SlackBuild | 51 | ||||
-rw-r--r-- | system/mongodb/mongodb.info | 10 | ||||
-rw-r--r-- | system/mongodb/rc.mongodb | 49 | ||||
-rw-r--r-- | system/mongodb/slack-desc | 20 |
6 files changed, 158 insertions, 0 deletions
diff --git a/system/mongodb/README b/system/mongodb/README new file mode 100644 index 0000000000..8ab7036278 --- /dev/null +++ b/system/mongodb/README @@ -0,0 +1,2 @@ +MongoDB is a scalable, high-performance, open source document-oriented +database. diff --git a/system/mongodb/doinst.sh b/system/mongodb/doinst.sh new file mode 100644 index 0000000000..5b311f0a98 --- /dev/null +++ b/system/mongodb/doinst.sh @@ -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 + diff --git a/system/mongodb/mongodb.SlackBuild b/system/mongodb/mongodb.SlackBuild new file mode 100644 index 0000000000..abd346de8d --- /dev/null +++ b/system/mongodb/mongodb.SlackBuild @@ -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} diff --git a/system/mongodb/mongodb.info b/system/mongodb/mongodb.info new file mode 100644 index 0000000000..19471dee6e --- /dev/null +++ b/system/mongodb/mongodb.info @@ -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" diff --git a/system/mongodb/rc.mongodb b/system/mongodb/rc.mongodb new file mode 100644 index 0000000000..d4771ecd1a --- /dev/null +++ b/system/mongodb/rc.mongodb @@ -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 + diff --git a/system/mongodb/slack-desc b/system/mongodb/slack-desc new file mode 100644 index 0000000000..9c0dfb91b6 --- /dev/null +++ b/system/mongodb/slack-desc @@ -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: + |