summaryrefslogtreecommitdiff
blob: 814293aeb4b98e53bc379be5a567197a627d64b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-plugins/gkrellm-hddtemp/gkrellm-hddtemp-0.2_beta.ebuild,v 1.18 2005/09/19 21:44:53 cryos Exp $

inherit multilib

IUSE=""
MY_P=${P/_beta/-beta}
S=${WORKDIR}/${MY_P}
DESCRIPTION="a GKrellM2 plugin for hddtemp (which reads the temperature of SMART capable hard drives)"
SRC_URI="http://coredump.free.fr/linux/${MY_P}.tar.gz"
HOMEPAGE="http://coredump.free.fr/linux/hddtemp.php"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="-amd64 ppc sparc x86"

DEPEND="=app-admin/gkrellm-2*
	>=sys-apps/sed-4"
RDEPEND=">=app-admin/hddtemp-0.3_beta6"

src_unpack() {
	unpack ${A} ; cd ${S}
	# patch Makefile
	sed -i "s:^CFLAGS.*:CFLAGS=${CFLAGS} -fPIC:" Makefile
}

src_compile() {
	GKRELLM1=0
	GKRELLM2=0
	if [ -f /usr/bin/gkrellm2 ]; then
		GKRELLM2=1
		einfo "Building plugin for gkrellm-2.*"
		make gkrellm2 || die
	elif [ -f /usr/bin/gkrellm ]; then
		GKRELLM1=1
		einfo "Building plugin for gkrellm-1.*"
		make gkrellm1 || die
	fi
}

src_install() {
	dodoc README COPYING
	if [ $GKRELLM1 = 1 ]; then
		einfo "Installing plugin for gkrellm-1.*"
		insinto /usr/$(get_libdir)/gkrellm/plugins
		doins gkrellm-hddtemp.so
	fi
	if [ $GKRELLM2 = 1 ]; then
		einfo "Installing plugin for gkrellm-2.*"
		insinto /usr/$(get_libdir)/gkrellm2/plugins
		doins gkrellm-hddtemp.so
	fi
}

pkg_postinst() {
	einfo "hddtemp has to be suid root to allow regular users to run this plugin."
	einfo "To make it suid root, run"
	einfo
	einfo "\tchmod u+s /usr/sbin/hddtemp"
}