diff options
author | 2008-01-31 01:45:49 +0000 | |
---|---|---|
committer | 2008-01-31 01:45:49 +0000 | |
commit | a22ab81d319a19738297973bae73aa6c942df43c (patch) | |
tree | 756b86e183a1796c8705475655325a063b0c87ff /app-misc | |
parent | Add matching ut2004 version. (diff) | |
download | wolf31o2-a22ab81d319a19738297973bae73aa6c942df43c.tar.gz wolf31o2-a22ab81d319a19738297973bae73aa6c942df43c.tar.bz2 wolf31o2-a22ab81d319a19738297973bae73aa6c942df43c.zip |
Adding app-misc/dnetc for testing from bug #177091.
svn path=/; revision=97
Diffstat (limited to 'app-misc')
-rw-r--r-- | app-misc/dnetc/dnetc-2.9013.498.ebuild | 91 | ||||
-rw-r--r-- | app-misc/dnetc/files/dnetc.confd | 18 | ||||
-rw-r--r-- | app-misc/dnetc/files/dnetc.initd | 84 |
3 files changed, 193 insertions, 0 deletions
diff --git a/app-misc/dnetc/dnetc-2.9013.498.ebuild b/app-misc/dnetc/dnetc-2.9013.498.ebuild new file mode 100644 index 0000000..cf9ac37 --- /dev/null +++ b/app-misc/dnetc/dnetc-2.9013.498.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/dnetc/dnetc-2.9013.498.ebuild,v 1.1 2006/03/26 00:06:49 voxus Exp $ + +inherit eutils versionator linux-info + +MAJ_PV="$(get_major_version).$(get_version_component_range 2)" +MIN_PV="$(get_version_component_range 3)" + +DESCRIPTION="distributed.net client" +HOMEPAGE="http://www.distributed.net" +SRC_URI="x86? ( http://http.distributed.net/pub/dcti/v2.9013/dnetc${MIN_PV}-linux-x86-elf-uclibc.tar.gz )" + +LICENSE="distributed.net" +SLOT="0" +KEYWORDS="~x86 -*" +RESTRICT="nomirror" + +IUSE="" +DEPEND="" +RDEPEND="" + +S="${WORKDIR}/dnetc${MIN_PV}-linux-x86-elf-uclibc" + +pkg_setup() { + local CONFIG_CHECK="~SYSVIPC" + local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for dnetc)" + check_extra_config + echo +} + +pkg_preinst() { + enewgroup dnetc + enewuser dnetc -1 -1 /opt/distributed.net dnetc + if [ -e /opt/distributed.net/dnetc ] && [ -e /etc/init.d/dnetc ]; then + ebegin "Flushing old buffers" + source /etc/conf.d/dnetc + + if [ -e /etc/init.d/dnetc ] ; then + /etc/init.d/dnetc flush + local flushed=${?} + fi + + if [ ${flushed} -eq 0 ] ; then + true + elif [ -e /opt/distributed.net/dnetc.ini ]; then + # use ini file + /opt/distributed.net/dnetc -quiet -ini /opt/distributed.net/dnetc.ini -flush + elif [ ! -e /opt/distributed.net/dnetc.ini ] && [ ! -z ${EMAIL} ]; then + # email adress from config + /opt/distributed.net/dnetc -quiet -flush -e ${EMAIL} + fi + + eend ${?} + fi +} + +src_install() { + newinitd ${FILESDIR}/dnetc.initd dnetc + newconfd ${FILESDIR}/dnetc.confd dnetc + + local ownopts="--mode=0555 --group=dnetc --owner=dnetc" + + diropts ${ownopts} + dodir /opt/distributed.net + + exeopts ${ownopts} + exeinto /opt/distributed.net + doexe dnetc + + doman dnetc.1 + dodoc docs/CHANGES.txt docs/dnetc.txt docs/readme.* + + diropts ${ownopts/0555/0755} + dodir /var/spool/dnetc +} + +pkg_postinst() { + einfo "To run distributed.net client in the background at boot:" + einfo " rc-update add dnetc default" + einfo + einfo "Either configure your email address in /etc/conf.d/dnetc" + einfo "or create the configuration file /opt/distributed.net/dnetc.ini" +} + +pkg_postrm() { + if [ -d /opt/distributed.net ]; then + einfo "All files has not been removed from /opt/distributed.net" + einfo "Probably old init file and/or buffer files" + fi +} diff --git a/app-misc/dnetc/files/dnetc.confd b/app-misc/dnetc/files/dnetc.confd new file mode 100644 index 0000000..f6f0da6 --- /dev/null +++ b/app-misc/dnetc/files/dnetc.confd @@ -0,0 +1,18 @@ +# configuration file for dnetc + +# Startup will look for configuration files in the following places, using the +# first one that it finds: +# 1. /etc/dnetc.conf +# 2. /opt/distributed.net/dnetc.ini + +# Values specified here will override those found in any client configuration +# file. + +# email adress +EMAIL= + +# buffer base dir +BUFFER_BASE_DIR=/var/spool/dnetc + +# keyserver address +KEYSERVER_ADDRESS= diff --git a/app-misc/dnetc/files/dnetc.initd b/app-misc/dnetc/files/dnetc.initd new file mode 100644 index 0000000..278be05 --- /dev/null +++ b/app-misc/dnetc/files/dnetc.initd @@ -0,0 +1,84 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/dnetc/files/dnetc.init-r2,v 1.1 2006/01/15 16:34:23 voxus Exp $ + +opts="${opts} reload fetch flush" + +depend() { + use net +} + +processOpts() { + local retVal=1 + + DNETPATH="/opt/distributed.net" + DNETBIN="${DNETPATH}/dnetc" + + STARTOPTS="--start --chuid dnetc:dnetc --quiet \ + --exec ${DNETBIN}" + + DNETOPTS="-quiet" + + if [ -e /etc/conf.d/dnetc ] ; then + retVal=0 + DNETOPTS="${DNETOPTS} -ini /etc/conf.d/dnetc" + elif [ -e ${DNETPATH}/dnetc.ini ]; then + retVal=0 + DNETOPTS="${DNETOPTS} -ini ${DNETPATH}/dnetc.ini" + elif [ ! -z ${EMAIL} ]; then + retVal=0 + fi + + # override ini settings with values in /etc/conf.d/dnetc + + DNETOPTS="${DNETOPTS} ${EMAIL:+-e ${EMAIL}}" + if [ ! -z ${BUFFER_BASE_DIR} ] ; then + local buff_in="${BUFFER_BASE_DIR:+${BUFFER_BASE_DIR}/}buff-in" + local buff_out="${BUFFER_BASE_DIR:+${BUFFER_BASE_DIR}/}buff-out" + DNETOPTS="${DNETOPTS} -inbase ${buff_in}" + DNETOPTS="${DNETOPTS} -outbase ${buff_out}" + fi + DNETOPTS="${DNETOPTS} ${KEYSERVER_ADDRESS:+-a ${KEYSERVER_ADDRESS}}" + + if [ ${retVal} -ne 0 ] ; then + eerror "Need some sort of configuration. Check /etc/conf.d/dnetc." + fi + + return ${retVal} +} + +start() { + processOpts || return 1 + ebegin "Starting distributed.net client" + start-stop-daemon ${STARTOPTS} -- ${DNETOPTS} + eend ${?} +} + +stop() { + processOpts || return 1 + ebegin "Stopping distributed.net client" + start-stop-daemon --stop --quiet --exec ${DNETBIN} -- + eend ${?} +} + +reload() { + processOpts || return 1 + ebegin "Reloading distributed.net client" + start-stop-daemon --stop --quiet --signal HUP --exec ${DNETBIN} + eend ${?} +} + +fetch() { + processOpts || return 1 + ebegin "Fetching distributed.net client buffers" + ${DNETBIN} ${DNETOPTS} -fetch + eend ${?} +} + +flush() { + processOpts || return 1 + ebegin "Flushing distributed.net client buffers" + ${DNETBIN} ${DNETOPTS} -flush + eend ${?} +} |