1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
10 DESCRIPTION="distributed.net client"
11 HOMEPAGE="http://www.distributed.net"
12 #SRC_URI_x86="x86? ( http://http.distributed.net/pub/dcti/v${MAJ_PV}/dnetc${MIN_PV}-linux-x86-elf-uclibc.tar.gz )"
13 SRC_URI_amd64="amd64? ( http://http.distributed.net/pub/dcti/v${MAJ_PV}/dnetc${MIN_PV}-linux-amd64.tar.gz )"
14 #SRC_URI_ppc="ppc? ( http://http.distributed.net/pub/dcti/v${MAJ_PV}/dnetc${MIN_PV}-linux-ppc-uclibc.tar.gz )"
15 #SRC_URI_sparc="sparc? ( http://http.distributed.net/pub/dcti/v${MAJ_PV}/dnetc${MIN_PV}-linux-sparc-v7.tar.gz )"
16 SRC_URI="${SRC_URI_amd64} ${SRC_URI_ppc} ${SRC_URI_x86} ${SRC_URI_sparc}"
18 LICENSE="distributed.net GPL-2"
20 KEYWORDS="~amd64" # ppc,x86 not available for this version
25 RDEPEND="net-dns/bind-tools"
27 QA_PREBUILT="opt/distributed.net/dnetc"
31 amd64) suffix=amd64 ;;
32 x86) suffix=x86-elf-uclibc ;;
33 ppc) suffix=ppc-elf-uclibc ;;
35 echo dnetc${MIN_PV:0:3}-linux-${suffix}
39 export S="${WORKDIR}/$(getS)"
41 [[ -x dnetc ]] || die "Name of dnetc directory/binary for this platform undefined"
45 export S="${WORKDIR}/$(getS)"
47 exeinto /opt/distributed.net
51 dodoc docs/CHANGES.txt docs/dnetc.txt docs/readme.*
53 newinitd "${FILESDIR}"/dnetc.initd dnetc
54 newconfd "${FILESDIR}"/dnetc.confd dnetc
56 keepdir /var/spool/dnetc
60 if [ -e /opt/distributed.net/dnetc ] && [ -e /etc/init.d/dnetc ]; then
61 einfo "flushing old buffers"
62 source /etc/conf.d/dnetc
64 if [ -e /opt/distributed.net/dnetc.ini ]; then
66 /opt/distributed.net/dnetc -quiet -ini /opt/distributed.net/dnetc.ini -flush
67 elif [ ! -e /opt/distributed.net/dnetc.ini ] && [ ! -z ${EMAIL} ]; then
68 # email adress from config
69 /opt/distributed.net/dnetc -quiet -flush -e ${EMAIL}
72 einfo "removing old buffer files"
73 rm -f /opt/distributed.net/buff*
77 enewuser dnetc -1 -1 /opt/distributed.net dnetc
81 chown -Rf dnetc:dnetc /opt/distributed.net
82 chmod 0555 /opt/distributed.net/dnetc
84 elog "To run distributed.net client in the background at boot:"
85 elog " rc-update add dnetc default"
87 elog "Either configure your email address in /etc/conf.d/dnetc"
88 elog "or create the configuration file /opt/distributed.net/dnetc.ini"
92 if [ -d /opt/distributed.net ]; then
93 elog "All files has not been removed from /opt/distributed.net"