/[gentoo-x86]/app-misc/dnetc/dnetc-2.9011.496-r1.ebuild
Gentoo

Contents of /app-misc/dnetc/dnetc-2.9011.496-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Fri Jun 1 01:55:14 2012 UTC (11 months, 2 weeks ago) by zmedico
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +3 -3 lines
inherit user for enewgroup and enewuser

(Portage version: 2.2.0_alpha108_p9/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-misc/dnetc/dnetc-2.9011.496-r1.ebuild,v 1.10 2009/11/18 15:02:07 jer Exp $
4
5 inherit user
6
7 MAJ_PV=${PV:0:6}
8 MIN_PV=${PV:7:9}
9
10 DESCRIPTION="distributed.net client"
11 HOMEPAGE="http://www.distributed.net"
12 SRC_URI="x86? ( http://http.distributed.net/pub/dcti/v${MAJ_PV}/dnetc${MIN_PV}-linux-x86-elf-uclibc.tar.gz )
13 amd64? ( http://http.distributed.net/pub/dcti/v${MAJ_PV}/dnetc${MIN_PV}-linux-amd64-elf.tar.gz )"
14
15 LICENSE="distributed.net"
16 SLOT="0"
17 KEYWORDS="amd64 x86"
18 IUSE=""
19 RESTRICT="mirror"
20
21 DEPEND=""
22 RDEPEND="net-dns/bind-tools"
23
24 QA_PRESTRIPPED="opt/distributed.net/dnetc"
25
26 if use amd64; then
27 S="${WORKDIR}/dnetc${MIN_PV}-linux-amd64-elf"
28 elif use x86; then
29 S="${WORKDIR}/dnetc${MIN_PV}-linux-x86-elf-uclibc"
30 fi
31
32 src_install() {
33 exeinto /opt/distributed.net
34 doexe dnetc
35
36 doman dnetc.1
37 dodoc docs/CHANGES.txt docs/dnetc.txt docs/readme.*
38
39 newinitd "${FILESDIR}"/dnetc.initd dnetc
40 newconfd "${FILESDIR}"/dnetc.confd dnetc
41 }
42
43 pkg_preinst() {
44 if [ -e /opt/distributed.net/dnetc ] && [ -e /etc/init.d/dnetc ]; then
45 einfo "flushing old buffers"
46 source /etc/conf.d/dnetc
47
48 if [ -e /opt/distributed.net/dnetc.ini ]; then
49 # use ini file
50 /opt/distributed.net/dnetc -quiet -ini /opt/distributed.net/dnetc.ini -flush
51 elif [ ! -e /opt/distributed.net/dnetc.ini ] && [ ! -z ${EMAIL} ]; then
52 # email adress from config
53 /opt/distributed.net/dnetc -quiet -flush -e ${EMAIL}
54 fi
55
56 einfo "removing old buffer files"
57 rm -f /opt/distributed.net/buff*
58 fi
59
60 enewgroup dnetc
61 enewuser dnetc -1 -1 /opt/distributed.net dnetc
62 }
63
64 pkg_postinst() {
65 chown -Rf dnetc:dnetc /opt/distributed.net
66 chmod 0555 /opt/distributed.net/dnetc
67
68 elog "To run distributed.net client in the background at boot:"
69 elog " rc-update add dnetc default"
70 elog ""
71 elog "Either configure your email address in /etc/conf.d/dnetc"
72 elog "or create the configuration file /opt/distributed.net/dnetc.ini"
73 }
74
75 pkg_postrm() {
76 if [ -d /opt/distributed.net ]; then
77 elog "All files has not been removed from /opt/distributed.net"
78 fi
79 }

  ViewVC Help
Powered by ViewVC 1.1.13