]> Pileus Git - ~andy/sunrise/blob - sys-apps/hd-idle/hd-idle-1.02.ebuild
sunrise/ net-nntp/nzbperl/Manifest: Update copyright line to satisfy repoman
[~andy/sunrise] / sys-apps / hd-idle / hd-idle-1.02.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit toolchain-funcs
6
7 DESCRIPTION="Utility for spinning down hard disks after a period of idle time"
8 HOMEPAGE="http://hd-idle.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE=""
15
16 S=${WORKDIR}/${PN}
17
18 src_compile() {
19         # CC_DEBUG is now used with linking only, so it's a good place
20         # to push the LDFLAGS into.
21         emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" CC_DEBUG="${LDFLAGS}" || die
22 }
23
24 src_install() {
25         dosbin hd-idle || die "dosbin failed"
26         newinitd "${FILESDIR}"/hd-idle-init hd-idle || die "newinitd failed"
27         newconfd "${FILESDIR}"/hd-idle-conf hd-idle || die "newconfd failed"
28 }
29
30 pkg_postinst() {
31         if [[ ! -f /proc/diskstats ]]
32         then
33                 ewarn "Please note that hd-idle uses /proc/diskstats to read disk"
34                 ewarn "statistics. If this file is not present, hd-idle won't work."
35                 ewarn "You should check your kernel configuration and make sure"
36                 ewarn "it includes CONFIG_PROC_FS=y."
37         fi
38 }