diff options
author | 2013-05-17 21:54:52 +0200 | |
---|---|---|
committer | 2013-05-17 21:54:52 +0200 | |
commit | 49a96eafbe5dcc28a95d1809b97c095ce84d3698 (patch) | |
tree | 084f6785432b8d25cd2c71839ef7bb314034a90b | |
parent | ok (diff) | |
download | tocaro-49a96eafbe5dcc28a95d1809b97c095ce84d3698.tar.gz tocaro-49a96eafbe5dcc28a95d1809b97c095ce84d3698.tar.bz2 tocaro-49a96eafbe5dcc28a95d1809b97c095ce84d3698.zip |
ok
3 files changed, 200 insertions, 0 deletions
diff --git a/dev-db/couchbase-server-community/Manifest b/dev-db/couchbase-server-community/Manifest new file mode 100644 index 0000000..dffb6ca --- /dev/null +++ b/dev-db/couchbase-server-community/Manifest @@ -0,0 +1,4 @@ +AUX 2.0.1/couchbase-server 3956 SHA256 df2d03152bc183591a57f78ce3b50590fe0d91f8e6e36f66a45e9fc67faab0cc SHA512 01b2f1a0ca3e4c2f93ff37271979f434e7010b272bcfca1fa8b8e40c1115ae5750a3ec0d5efc13edb93e21b09a35cde71bfb6fb48465329c83528ead975d3f8c WHIRLPOOL 1f5293c7e5f64eaa3ee618d07b1911963f7187d00eec78c205e93341625f2917e466b074f85bd582584e6144cd42f57caa6d4852f115c1288a2c1e51ab132f07 +DIST couchbase-server-community_x86_2.0.1.deb 18874699 SHA256 6a66c24bf22bcb4b0e7ccf1e1f9ec803209ba93d2f93c734cea04dc7da72090f SHA512 8340ca7c5d53f7170a8eb9538e565c871d78ffdf72cacb67eb82b95a9cc428421eb8b8336776633554d1e4a74ba64112cbc9b8bcb4fe8ed25ad009d123be44bf WHIRLPOOL bc325f4b13cda9a15d42747e765020452eff986ea17c1c170cf885055d5f1b6567d85dfb6484e55e98e13ee99e16402ef6faf4f53718c7dc3941a6add352eef8 +DIST couchbase-server-community_x86_64_2.0.1.deb 120654626 SHA256 7bb4efb8df1ae0ecdbdc9e01194ac7f8cfe777e1bf84a3bd1ded37f903268508 SHA512 b3051abc2250a0798ec2b4b7706e6a3c71073f31dcd40f3f37e2b391f989e1f09bf4ddb96e3d93fa2afc040f463ab25373150d916de5cea25a79c420aaef821b WHIRLPOOL 7304ebad4e59e32ab94ca1d04ae7bd75ba6aa5710488ef8db5c53302d7184c259e402f8c499c4b5c64f0418f40d92c1e49e532fe3309757ab4e60e92d54e4ec4 +EBUILD couchbase-server-community-2.0.1.ebuild 1511 SHA256 e9ed24b6d5042d0cf0e14c2c60cfa54457d1f39e83133001768d63e952dddfee SHA512 be933e307fdaa0a7858329c788ddbae90c4621840c42e5a2da817ffc76905193e5b50aa60a4efb61c67ca3e62f090c1ea9bb107e000951f4cdc68c88502cb149 WHIRLPOOL 8dc95af59fc5fa00512c2a631bf37abc7f0bd7d9885a3355453657b488ae321b454c996db329317e80fdd5d675e95862b0cd6eaa05fb7d3f7f961e13671192db diff --git a/dev-db/couchbase-server-community/couchbase-server-community-2.0.1.ebuild b/dev-db/couchbase-server-community/couchbase-server-community-2.0.1.ebuild new file mode 100644 index 0000000..76b6df8 --- /dev/null +++ b/dev-db/couchbase-server-community/couchbase-server-community-2.0.1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header$ + +EAPI=2 +inherit eutils + +DESCRIPTION="Distributed key-value database management system" +HOMEPAGE="http://www.couchbase.com" +SRC_URI="x86? ( http://packages.couchbase.com/releases/${PV}/${PN}_x86_${PV}.deb ) + amd64? ( http://packages.couchbase.com/releases/${PV}/${PN}_x86_64_${PV}.deb )" + +#RESTRICT="fetch" + +LICENSE="COUCHBASE INC. COMMUNITY EDITION" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="" + +RDEPEND=">=sys-libs/ncurses-5 + >=dev-libs/libevent-1.4.13 + >=dev-libs/cyrus-sasl-2 + >=dev-libs/openssl-0.9.8e" +# !net-misc/memcached" +DEPEND="" + + +pkg_setup() { + enewuser couchbase -1 -1 /opt/couchbase daemon + enewgroup couchbase +} + +src_unpack() { + ar x "${DISTDIR}"/${A} + cd ${WORKDIR} + tar xzf data.tar.gz +} + +src_install() { + cp -pPR "${WORKDIR}"/opt "${D}" + rm -f "${D}"/opt/couchbase/${PV}/data + rm -f "${D}"/opt/couchbase/${PV}/tmp + + sed -i "s/\/opt\/couchbase\/var\/lib\/couchbase\/couchbase-server.pid/\/var\/run\/couchbase-server.pid/" "${D}/opt/couchbase/bin/couchbase-server" || die "Install failed!" + + dodir "/opt/couchbase/var/lib/couchbase/data" + keepdir "/opt/couchbase/var/lib/couchbase/data" + + dodir "/opt/couchbase/var/lib/couchbase/logs" + dodir "/opt/couchbase/var/lib/couchbase/mnesia" + dodir "/opt/couchbase/var/lib/couchbase/tmp" + + chown -R couchbase:daemon "${D}/opt/couchbase" || die "Install failed!" + + newinitd "${FILESDIR}/${PV}/couchbase-server" couchbase-server +} diff --git a/dev-db/couchbase-server-community/files/2.0.1/couchbase-server b/dev-db/couchbase-server-community/files/2.0.1/couchbase-server new file mode 100755 index 0000000..2c3eb50 --- /dev/null +++ b/dev-db/couchbase-server-community/files/2.0.1/couchbase-server @@ -0,0 +1,140 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +COUCHBASE_USER="couchbase" +COUCHBASE_PATH=/opt/couchbase +PIDFILE=/var/run/couchbase-server.pid + +DEFAULT_CONFIG_DIR="/opt/couchbase/etc/couchdb/default.d" +DEFAULT_CONFIG_FILE="/opt/couchbase/etc/couchdb/default.ini" +LOCAL_CONFIG_DIR="/opt/couchbase/etc/couchdb/local.d" +LOCAL_CONFIG_FILE="/opt/couchbase/etc/couchdb/local.ini" + +couch_start_arguments="" + +_add_config_file () { + couch_start_arguments="$couch_start_arguments $1" +} + +_add_config_dir () { + for file in "$1"/*.ini; do + if [ -r "$file" ]; then + _add_config_file "$file" + fi + done +} + +_load_config () { + _add_config_file "$DEFAULT_CONFIG_FILE" + _add_config_dir "$DEFAULT_CONFIG_DIR" + _add_config_file "$LOCAL_CONFIG_FILE" + _add_config_dir "$LOCAL_CONFIG_DIR" + if [ "$COUCHDB_ADDITIONAL_CONFIG_FILE" != '' ] + then + _add_config_file "$COUCHDB_ADDITIONAL_CONFIG_FILE" + fi +} + +start() { + ebegin "Starting couchbase server" + + touch $PIDFILE + chown $COUCHBASE_USER:daemon $PIDFILE + + # pam-limits (/etc/security/limits.d and limits.conf) aren't working with start-stop-daemon + ulimit -n 10240 + ulimit -c unlimited + + PATH="/opt/couchbase/bin":$PATH + export PATH + + if [ `ulimit -n` -lt 10240 ] + then +cat <<EOF +The maximum number of open files for the couchbase user is set too low. +It must be at least 10240. Normally this can be increased by adding +the following lines to /etc/security/limits.conf: + +couchbase soft nofile <value> +couchbase hard nofile <value> + +Where <value> is greater than 10240. +EOF + fi + + datadir="/opt/couchbase/var/lib/couchbase" + + test -d "$datadir" || mkdir -p "$datadir" + cd "$datadir" + + # Initialize distributed erlang on the system (i.e. epmd) + erl -noshell -setcookie nocookie -sname init -run init stop 2>&1 > /dev/null + if [ $? -ne 0 ] + then + exit 1 + fi + + ERL_LIBS="/opt/couchbase/lib/ns_server/erlang/lib:/opt/couchbase/lib/couchdb/erlang/lib:/opt/couchbase/lib/couchdb/plugins" + export ERL_LIBS + + LD_LIBRARY_PATH="/opt/couchbase/lib":"/opt/couchbase/lib/memcached":$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + + ERL_CRASH_DUMP=erl_crash.dump.$(date +%m-%d-%Y-%H:%M:%S).$$ + export ERL_CRASH_DUMP + + ERL_FULLSWEEP_AFTER=512 + export ERL_FULLSWEEP_AFTER + + _load_config + + # Set an ENV variable to force C++ STL and string classes to not use its + # default memory pooling allocator. + # For GCC 3.2.2 and later + GLIBCPP_FORCE_NEW=1 + export GLIBCPP_FORCE_NEW + # For GCC 3.4 and later + GLIBCXX_FORCE_NEW=1 + export GLIBCXX_FORCE_NEW + + start-stop-daemon --start -m --pidfile ${PIDFILE} --background \ + --chdir $COUCHBASE_PATH/bin -u "$COUCHBASE_USER" --name beam \ + --exec erl -- \ + +A 16 \ + +c \ + +S 16:16 \ + -smp auto \ + +sbt u \ + +P 327680 \ + +K true \ + -noinput \ + -setcookie nocookie \ + -kernel inet_dist_listen_min 21100 inet_dist_listen_max 21299 \ + error_logger false \ + -sasl sasl_error_logger false \ + -run ns_bootstrap -- \ + -couch_ini $couch_start_arguments \ + -ns_server config_path "\"/opt/couchbase/etc/couchbase/static_config\"" \ + -ns_server pidfile "\"/opt/couchbase/var/lib/couchbase/couchbase-server.pid\"" \ + -ns_server nodefile "\"/opt/couchbase/var/lib/couchbase/couchbase-server.node\"" \ + -ns_server cookiefile "\"/opt/couchbase/var/lib/couchbase/couchbase-server.cookie\"" 2>&1 > /dev/null + + local i=0 + local timeout=5 + while [ ! -f ${PIDFILE} ] && [ $i -le $timeout ]; do + sleep 1 + i=$(($i + 1)) + done + + [ $timeout -gt $i ] + eend $? + +} + +stop() { + ebegin "Stopping couchbase server" + start-stop-daemon --stop --pidfile ${PIDFILE} --name beam + rm -f ${PIDFILE} +} |