summaryrefslogtreecommitdiff
blob: 6bacc1903ba769499b3a67d364565f764a3b4e83 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-power/powerman/powerman-1.0.20.ebuild,v 1.2 2007/04/23 19:45:06 swegener Exp $

inherit eutils

DESCRIPTION="PowerMan - Power to the Cluster"
HOMEPAGE="http://www.llnl.gov/linux/powerman/"
SRC_URI="ftp://ftp.llnl.gov/pub/linux/${PN}/${P}.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND="sys-devel/bison
		dev-lang/perl"
RDEPEND=">=sys-libs/freeipmi-0.2.3"

src_unpack() {
	unpack ${A}
	epatch ${FILESDIR}/${P}-new-yacc.patch
	sed -i.orig \
		-e "/^CFLAGS/s#-g#-g ${CFLAGS} #g" \
		${S}/src/Makefile \
		|| die "couldn't set custom CFLAGS"
	sed -i.orig \
		-e "s,PTHREAD_THREADS_MAX,32768,g" \
		${S}/test/vpcd.c \
		|| die "Couldn't set pthreads max"
}

src_compile() {
	emake || die "emake failed"
}

src_install() {
	emake -j1 install \
		DESTDIR="${D}" \
		mandir="/usr/share/man" \
		|| die "emake install failed"
	rm "${D}"/etc/rc.d/init.d/powerman
	newdoc scripts/powerman.init powerman_redhat_initd
	dodoc ChangeLog DISCLAIMER NEWS TODO
}

# Sorry, you need to be root :-(
#src_test () {
#	cd ${S}/test
#	for i in 64 4096 8192 16384 64t 4096t 8192t 16384t; do
#		einfo "Testing mode: $i"
#		emake -j1 run$i || die "Failed test: $ti"
#	done
#}