diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-12-20 19:19:34 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-12-20 19:19:34 +0000 |
commit | 2db6a4af4f3393cb03ea8a5b3bbfaee0f65721e5 (patch) | |
tree | 8aabd3d4f6b42e70e61994576d4c2be36ab3b4ef /sys-cluster | |
parent | Drop net-analyzer/cacti-cactid mask since package was removed from the tree. (diff) | |
download | gentoo-2-2db6a4af4f3393cb03ea8a5b3bbfaee0f65721e5.tar.gz gentoo-2-2db6a4af4f3393cb03ea8a5b3bbfaee0f65721e5.tar.bz2 gentoo-2-2db6a4af4f3393cb03ea8a5b3bbfaee0f65721e5.zip |
Initial import of gearmand, thanks to Pavel Stratil (who's co-maintaining the package) who wrote the basic ebuild and init script. Closes bug #279413, reported by Rob Peck (who also wrote an alternative ebuild).
(Portage version: 2.2_rc60/cvs/Linux x86_64)
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/gearmand/ChangeLog | 13 | ||||
-rw-r--r-- | sys-cluster/gearmand/files/gearmand.conf.d | 38 | ||||
-rw-r--r-- | sys-cluster/gearmand/files/gearmand.init.d | 76 | ||||
-rw-r--r-- | sys-cluster/gearmand/gearmand-0.11-r1.ebuild | 75 | ||||
-rw-r--r-- | sys-cluster/gearmand/metadata.xml | 24 |
5 files changed, 226 insertions, 0 deletions
diff --git a/sys-cluster/gearmand/ChangeLog b/sys-cluster/gearmand/ChangeLog new file mode 100644 index 000000000000..1f770ada606c --- /dev/null +++ b/sys-cluster/gearmand/ChangeLog @@ -0,0 +1,13 @@ +# ChangeLog for sys-cluster/gearmand +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gearmand/ChangeLog,v 1.1 2009/12/20 19:19:34 flameeyes Exp $ + +*gearmand-0.11-r1 (20 Dec 2009) + + 20 Dec 2009; Diego E. Pettenò <flameeyes@gentoo.org> + +gearmand-0.11-r1.ebuild, +files/gearmand.conf.d, +files/gearmand.init.d, + +metadata.xml: + Initial import of gearmand, thanks to Pavel Stratil (who's co-maintaining + the package) who wrote the basic ebuild and init script. Closes bug + #279413, reported by Rob Peck (who also wrote an alternative ebuild). + diff --git a/sys-cluster/gearmand/files/gearmand.conf.d b/sys-cluster/gearmand/files/gearmand.conf.d new file mode 100644 index 000000000000..9786d2c517c4 --- /dev/null +++ b/sys-cluster/gearmand/files/gearmand.conf.d @@ -0,0 +1,38 @@ +# /etc/conf.d/gearmand: config file for /etc/init.d/gearmand + +# Persistent queue store +# The following queue stores are available: drizzle|memcache|mysql|postgre|sqlite|none +# If you do not wish to use persistent queues, leave this option commented out. +# Note that persistent queue mechanisms are mutally exclusive. +#PERSISTENT="" + +# Persistent queue settings for drizzle, mysql and postgre +#PERSISTENT_SOCKET="" +#PERSISTENT_HOST="" +#PERSISTENT_PORT="" +#PERSISTENT_USER="" +#PERSISTENT_PASS="" +#PERSISTENT_DB="" +#PERSISTENT_TABLE="" + +# Persistent queue settings for sqlite +#PERSISTENT_FILE="" + +# Persistent queue settings for memcache +#PERSISTENT_SERVERLIST="" + +# General settings +# +# -j, --job-retries=RETRIES Number of attempts to run the job before the job +# server removes it. Thisis helpful to ensure a bad +# job does not crash all available workers. Default +# is no limit. +# -L, --listen=ADDRESS Address the server should listen on. Default is +# INADDR_ANY. +# -p, --port=PORT Port the server should listen on. Default=4730. +# -r, --protocol=PROTOCOL Load protocol module. +# -t, --threads=THREADS Number of I/O threads to use. Default=0. +# -v, --verbose Increase verbosity level by one. +# -w, --worker-wakeup=WORKERS Number of workers to wakeup for each job received. +# The default is to wakeup all available workers. +GEARMAND_PARAMS="" diff --git a/sys-cluster/gearmand/files/gearmand.init.d b/sys-cluster/gearmand/files/gearmand.init.d new file mode 100644 index 000000000000..895021e11f4c --- /dev/null +++ b/sys-cluster/gearmand/files/gearmand.init.d @@ -0,0 +1,76 @@ +#!/sbin/runscript +# Copyright 2009 Pavel Stratil, senbonzakura.eu +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use localmount + + case $PERSISTENT in + drizzle) + use drizzle + ;; + memcache) + use memcache + ;; + mysql) + use mysql + ;; + postgre) + use postgresql + ;; + *) + ;; + esac +} + +start() { + case ${PERSISTENT:-none} in + drizzle|mysql) + GEARMAND_PARAMS="${GEARMAND_PARAMS} -q libdrizzle" + [ ${PERSISTENT_HOST} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-host=${PERSISTENT_HOST}" + [ ${PERSISTENT_USER} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-user=${PERSISTENT_USER}" + [ ${PERSISTENT_PASS} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-password=${PERSISTENT_PASS}" + [ ${PERSISTENT_DB} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-db=${PERSISTENT_DB}" + [ ${PERSISTENT_TABLE} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-table=${PERSISTENT_TABLE}" + [ ${PERSISTENT_PORT} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-port=${PERSISTENT_PORT}" + [ ${PERSISTENT_SOCKET} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-uds=${PERSISTENT_SOCKET}" + [ ${PERSISTENT} == "mysql" ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libdrizzle-mysql" + ;; + memcache) + [ ${PERSISTENT_SERVERLIST} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} -q libmemcached --libmemcached-servers=${PERSISTENT_SERVERLIST}" + ;; + postgre) + GEARMAND_PARAMS="${GEARMAND_PARAMS} -q libpq" + [ ${PERSISTENT_HOST} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libpq-host=${PERSISTENT_HOST}" + [ ${PERSISTENT_USER} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libpq-user=${PERSISTENT_USER}" + [ ${PERSISTENT_PASS} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libpq-password=${PERSISTENT_PASS}" + [ ${PERSISTENT_DB} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libpq-dbname=${PERSISTENT_DB}" + [ ${PERSISTENT_PORT} ] && GEARMAND_PARAMS="${GEARMAND_PARAMS} --libpq-port=${PERSISTENT_PORT}" + [ ${PERSISTENT_TABLE} ] && ewarn "Libpq doesn't recognise 'table' parameter." + [ ${PERSISTENT_SOCKET} ] && ewarn "Libpq doesn't recognise 'socket' parameter. If no host is set, it automatically falls back to a socket." + ;; + sqlite) + GEARMAND_PARAMS="${GEARMAND_PARAMS} -q libsqlite3 --libsqlite3-db=${PERSISTENT_FILE}" + ;; + none) + ;; + *) + eerror "Wrong persistent queue store setting in /etc/conf.d/gearmand." + return 1 + ;; + esac + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --pidfile /var/run/gearmand/gearmand.pid --start \ + --exec /usr/sbin/gearmand -- --pid-file=/var/run/gearmand/gearmand.pid \ + --user=gearmand --daemon \ + --log-file=/var/log/gearmand/gearmand.log ${GEARMAND_PARAMS} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --pidfile /var/run/gearmand/gearmand.pid --stop \ + --exec /usr/sbin/gearmand + eend $? +} diff --git a/sys-cluster/gearmand/gearmand-0.11-r1.ebuild b/sys-cluster/gearmand/gearmand-0.11-r1.ebuild new file mode 100644 index 000000000000..d87329b9e686 --- /dev/null +++ b/sys-cluster/gearmand/gearmand-0.11-r1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gearmand/gearmand-0.11-r1.ebuild,v 1.1 2009/12/20 19:19:34 flameeyes Exp $ + +EAPI=2 + +inherit flag-o-matic + +DESCRIPTION="Generic framework to farm out work to other machines" +HOMEPAGE="http://www.gearman.org/" +SRC_URI="http://launchpad.net/gearmand/trunk/${PV}/+download/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug tcmalloc +memcache" + +RDEPEND="dev-libs/libevent + || ( >=sys-apps/util-linux-2.16 <sys-libs/e2fsprogs-libs-1.41.8 ) + tcmalloc? ( dev-util/google-perftools ) + memcache? ( dev-libs/libmemcached )" +DEPEND="${RDEPEND}" + +pkg_setup() { + enewuser gearmand -1 -1 /dev/null nogroup +} + +src_configure() { + local myconf= + + # Don't ever use --enable-assert since configure.ac is broken, and + # only does --disable-assert correctly. + if use debug; then + # Since --with-debug would turn off optimisations as well as + # enabling debug, we just enable debug through the + # preprocessor then. + append-flags -DDEBUG + + # Right now disabling asserts break the code, so never disable + # them as it is. + #else + # myconf="${myconf} --disable-assert" + fi + + # TODO once there's a drizzle/librizzle ebuild, add drizzle to iuse + # TODO new compile options for queue storage: libsqlite,libpq,libdrizzle + # TODO mtmalloc, umem, dtrace - all of this solaris stuff only? + # TODO libmemcached pulls memcached. Is this correct? + econf \ + --disable-dependency-tracking \ + $(use_enable tcmalloc) \ + $(use_enable memcache libmemcached) \ + --disable-mtmalloc \ + --disable-libsqlite3 \ + --disable-libdrizzle \ + --disable-libpq \ + ${myconf} +} + +src_install() { + emake DESTDIR="${D}" install || die "install failed" + + dodoc README AUTHORS ChangeLog || die "dodoc failed" + + newinitd "${FILESDIR}"/gearmand.init.d gearmand || die + newconfd "${FILESDIR}"/gearmand.conf.d gearmand || die + + keepdir /var/run/gearmand || die + fperms 0755 /var/run/gearmand || die + fowners gearmand:nogroup /var/run/gearmand || die + + keepdir /var/log/gearmand || die + fperms 0755 /var/log/gearmand || die + fowners gearmand /var/log/gearmand || die +} diff --git a/sys-cluster/gearmand/metadata.xml b/sys-cluster/gearmand/metadata.xml new file mode 100644 index 000000000000..898d240b8d4c --- /dev/null +++ b/sys-cluster/gearmand/metadata.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <email>flameeyes@gentoo.org</email> + </maintainer> + <maintainer> + <email>pavel.stratil-jun@fenix.cz</email> + <description>Proxied co-maintainer, CC on all bugs</description> + </maintainer> + + <use> + <flag name="tcmalloc"> + Use the <pkg>dev-util/google-perftools</pkg> libraries to + replace the malloc() implementation with a possibly faster one. + </flag> + + <flag name="memcache"> + Support memcache daemon (via <pkg>dev-libs/libmemcached</pkg>) + for the queue storage. + </flag> + </use> +</pkgmetadata> |