summaryrefslogtreecommitdiff
blob: ac728762508708c90662df0afa2523378ba93b13 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit toolchain-funcs

DESCRIPTION="Utility for spinning down hard disks after a period of idle time"
HOMEPAGE="http://hd-idle.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

S=${WORKDIR}/${PN}

src_compile() {
	# CC_DEBUG is now used with linking only, so it's a good place
	# to push the LDFLAGS into.
	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" CC_DEBUG="${LDFLAGS}" || die
}

src_install() {
	dosbin hd-idle || die "dosbin failed"
	newinitd "${FILESDIR}"/hd-idle-init hd-idle || die "newinitd failed"
	newconfd "${FILESDIR}"/hd-idle-conf hd-idle || die "newconfd failed"
}

pkg_postinst() {
	if [[ ! -f /proc/diskstats ]]
	then
		ewarn "Please note that hd-idle uses /proc/diskstats to read disk"
		ewarn "statistics. If this file is not present, hd-idle won't work."
		ewarn "You should check your kernel configuration and make sure"
		ewarn "it includes CONFIG_PROC_FS=y."
	fi
}