diff options
author | Nicolas Steinmetz <nsteinmetz@gmail.com> | 2010-05-13 00:57:51 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-13 00:57:51 +0200 |
commit | 70134d23096dc55c66ea9bb088aa19200be18e99 (patch) | |
tree | 6abe8c777b7ab0a89adfce448b2ed7c7fc052eaa | |
parent | 199a752bf47a887883f4afb5a896da638e7516f1 (diff) |
development/couchdb: Added to 13.0 repository
-rw-r--r-- | development/couchdb/README | 15 | ||||
-rw-r--r-- | development/couchdb/README.SLACKWARE | 14 | ||||
-rw-r--r-- | development/couchdb/couchdb.SlackBuild | 118 | ||||
-rw-r--r-- | development/couchdb/couchdb.info | 10 | ||||
-rw-r--r-- | development/couchdb/doinst.sh | 29 | ||||
-rw-r--r-- | development/couchdb/slack-desc | 19 |
6 files changed, 205 insertions, 0 deletions
diff --git a/development/couchdb/README b/development/couchdb/README new file mode 100644 index 0000000000000..89bcadef4e6ab --- /dev/null +++ b/development/couchdb/README @@ -0,0 +1,15 @@ +Apache CouchDB is a RESTFul document-oriented database. + +Apache CouchDB is a document-oriented database that can be queried +and indexed in a MapReduce fashion using JavaScript. CouchDB also +offers incremental replication with bi-directional conflict detection +and resolution. CouchDB provides a RESTful JSON API. + +This requires js (spidermonkey), icu4c, and erlang-otp. + +You must have a "couchdb" user and group before running this script; +something like this should suffice: + # groupadd -g 231 couchdb + # useradd -u 231 -g couchdb -d /var/lib/couchdb -s /bin/sh couchdb + +See README.SLACKWARE for further configuration information. diff --git a/development/couchdb/README.SLACKWARE b/development/couchdb/README.SLACKWARE new file mode 100644 index 0000000000000..d58e749736f31 --- /dev/null +++ b/development/couchdb/README.SLACKWARE @@ -0,0 +1,14 @@ +To start CouchDB automatically at system startup, add the following to +your system's /etc/rc.d/rc.local init script: + + if [ -x /etc/rc.d/rc.couchdb ]; then + /etc/rc.d/rc.couchdb start + fi + +To stop CouchDB automatically at system shutdown, add the following to +your system's /etc/rc.d/rc.local_shutdown script: + + if [ -x /etc/rc.d/rc.couchdb ]; then + /etc/rc.d/rc.couchdb stop + fi + diff --git a/development/couchdb/couchdb.SlackBuild b/development/couchdb/couchdb.SlackBuild new file mode 100644 index 0000000000000..9d840835184e5 --- /dev/null +++ b/development/couchdb/couchdb.SlackBuild @@ -0,0 +1,118 @@ +#!/bin/sh -e + +# SlackBuild for Apache CouchDB + +# Written by Nicolas Steinmetz (nsteinmetz@gmail.com) - 2010/01/03 +# Heavily modified by Robby Workman <rworkman@slackbuilds.org> + +PRGNAM=couchdb +VERSION=0.10.1 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +PKGSRC=apache-couchdb + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +## couchdb user & group *MUST* exist before package creation +# See http://slackbuilds.org/uid_gid.txt for current recomendations. +bailout() { + printf " The couchdb user and group do not exist. + You should create it/them with the following: + groupadd -g 231 couchdb + useradd -u 231 -g couchdb -d /var/lib/couchdb -s /bin/sh couchdb\n" +} + +if ! grep -q ^couchdb: /etc/group 2>/dev/null ; then + bailout + exit 1 +elif ! grep -q ^couchdb: /etc/passwd 2>/dev/null ; then + bailout + exit 1 +fi + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +rm -rf $TMP/$PKGSRC-$VERSION +cd $TMP +tar xvf $CWD/$PKGSRC-$VERSION.tar.gz +cd $PKGSRC-$VERSION +chown -R root:root . +chmod -R u+w,go+r-w,a-s . +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 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/man \ + --localstatedir=/var \ + --libdir=/usr/lib$LIBDIRSUFFIX \ + --with-erlang=/usr/lib$LIBDIRSUFFIX/erlang/usr/include \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +# Fixup some ownership and permissions stuffs +chown -R couchdb:couchdb $PKG/etc/couchdb $PKG/var/{lib,log,run}/couchdb +chmod 0770 $PKG/etc/couchdb $PKG/var/{lib,log,run}/couchdb + +# Use the correct name for the init script and don't clobber it on upgrades +mv $PKG/etc/rc.d/couchdb $PKG/etc/rc.d/rc.couchdb.new +chmod 0755 $PKG/etc/rc.d/rc.couchdb.new + +# Don't clobber a few other config files +mv $PKG/etc/couchdb/default.ini $PKG/etc/couchdb/default.ini.new +mv $PKG/etc/couchdb/local.ini $PKG/etc/couchdb/local.ini.new + +# Don't clobber the logrotate script either +mv $PKG/etc/logrotate.d/couchdb $PKG/etc/logrotate.d/couchdb.new + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true +) + +( cd $PKG/usr/man || exit 1 + find . -type f -exec gzip -9 {} \; + for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done +) + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + AUTHORS BUGS CHANGES LICENSE NEWS NOTICE README THANKS \ + $PKG/usr/doc/$PRGNAM-$VERSION +find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \; +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +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/development/couchdb/couchdb.info b/development/couchdb/couchdb.info new file mode 100644 index 0000000000000..66d14e7048764 --- /dev/null +++ b/development/couchdb/couchdb.info @@ -0,0 +1,10 @@ +PRGNAM="couchdb" +VERSION="0.10.1" +HOMEPAGE="http://couchdb.apache.org/" +DOWNLOAD="http://www.ecoficial.com/apachemirror/couchdb/0.10.1/apache-couchdb-0.10.1.tar.gz" +MD5SUM="a34dae8bf402299e378d7e8c13b7ba46" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Nicolas Steinmetz" +EMAIL="nsteinmetz@gmail.com" +APPROVED="rworkman" diff --git a/development/couchdb/doinst.sh b/development/couchdb/doinst.sh new file mode 100644 index 0000000000000..5e284380104aa --- /dev/null +++ b/development/couchdb/doinst.sh @@ -0,0 +1,29 @@ +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.couchdb.new +config etc/couchdb/default.ini.new +config etc/couchdb/local.ini.new +config etc/logrotate.d/couchdb.new + diff --git a/development/couchdb/slack-desc b/development/couchdb/slack-desc new file mode 100644 index 0000000000000..052668804c828 --- /dev/null +++ b/development/couchdb/slack-desc @@ -0,0 +1,19 @@ +# 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------------------------------------------------------| +couchdb: Apache CouchDB is a RESTFul document-oriented database. +couchdb: +couchdb: Apache CouchDB is a document-oriented database that can be queried +couchdb: and indexed in a MapReduce fashion using JavaScript. CouchDB also +couchdb: offers incremental replication with bi-directional conflict +couchdb: detection and resolution. CouchDB provides a RESTful JSON API. +couchdb: +couchdb: +couchdb: Homepage : http://couchdb.apache.org/ +couchdb: +couchdb: |