diff options
author | Chris Gianelloni <wolf31o2@gentoo.org> | 2008-02-02 14:01:55 +0000 |
---|---|---|
committer | Chris Gianelloni <wolf31o2@gentoo.org> | 2008-02-02 14:01:55 +0000 |
commit | cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f (patch) | |
tree | 3e0436ccb9ec8d317d5005e338529df16c65a76d /app-misc/dnetc | |
parent | unused versions. (diff) | |
download | gentoo-2-cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f.tar.gz gentoo-2-cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f.tar.bz2 gentoo-2-cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f.zip |
Version bump with a modified ebuild from Michael Hordijk <hoffbrinkle@hotmail.com> and edited by me. Closing bug #177091.
(Portage version: 2.1.4.1)
Diffstat (limited to 'app-misc/dnetc')
-rw-r--r-- | app-misc/dnetc/ChangeLog | 11 | ||||
-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 |
4 files changed, 202 insertions, 2 deletions
diff --git a/app-misc/dnetc/ChangeLog b/app-misc/dnetc/ChangeLog index e0e966de4245..fb989180a4d8 100644 --- a/app-misc/dnetc/ChangeLog +++ b/app-misc/dnetc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-misc/dnetc -# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-misc/dnetc/ChangeLog,v 1.46 2007/08/23 17:59:25 wolf31o2 Exp $ +# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/dnetc/ChangeLog,v 1.47 2008/02/02 14:01:54 wolf31o2 Exp $ + +*dnetc-2.9013.498 (02 Feb 2008) + + 02 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org> +files/dnetc.confd, + +files/dnetc.initd, +dnetc-2.9013.498.ebuild: + Version bump with a modified ebuild from Michael Hordijk + <hoffbrinkle@hotmail.com> and edited by me. Closing bug #177091. 23 Aug 2007; Chris Gianelloni <wolf31o2@gentoo.org> dnetc-2.9001.478.ebuild, dnetc-2.9002.479.ebuild, 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 000000000000..6ba2d859c7b1 --- /dev/null +++ b/app-misc/dnetc/dnetc-2.9013.498.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2008 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 2008/02/02 14:01:54 wolf31o2 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 000000000000..f6f0da6b7e2d --- /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 000000000000..d3613acf3898 --- /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.initd,v 1.1 2008/02/02 14:01:55 wolf31o2 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 ${?} +} |