summaryrefslogtreecommitdiff
blob: c565a792298ab17d5c9b2a72a611b1a2831c6cbc (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
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-laptop/acpi4asus/acpi4asus-0.41.ebuild,v 1.4 2009/02/15 14:40:39 mr_bones_ Exp $

inherit linux-mod eutils

DESCRIPTION="Acpi daemon and kernel module to control ASUS Laptop Hotkeys"
HOMEPAGE="http://sourceforge.net/projects/acpi4asus"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""

RDEPEND="sys-power/acpid"

pkg_setup() {
	if kernel_is lt 2 6 23 ; then
		CONFIG_CHECK="LEDS_CLASS"
		MODULE_NAMES="asus-laptop(acpi:${S}/driver)"
		BUILD_TARGETS=" "
		linux-mod_pkg_setup
		BUILD_PARAMS="KDIR=${KV_DIR}"
	else
		CONFIG_CHECK="~ASUS_LAPTOP"
		ERROR_ASUS_LAPTOP="Enable CONFIG_ASUS_LAPTOP under Device drivers - Misc Devices - Asus Laptop Extras (EXPERIMENTAL)."
		einfo "Required kernel module is already included with 2.6.23 kernels, we will not compile it."
		linux-mod_pkg_setup
	fi
}

src_unpack() {
	unpack ${A}
	if kernel_is ge 2 6 21 && kernel_is lt 2 6 23 ; then
		epatch "${FILESDIR}"/cvs.patch
	fi
}

src_compile() {
	kernel_is lt 2 6 23 && linux-mod_src_compile
	emake -C asus_acpid
}

src_install() {
	kernel_is lt 2 6 23 && linux-mod_src_install

	dobin asus_acpid/asus_acpid
	doman asus_acpid/asus_acpid.8

	dodoc README Changelog

	insinto /usr/share/${PN}/samples/actions
	doins samples/actions/*.sh

	insinto /usr/share/${PN}/samples/events
	doins samples/events/*
}

pkg_preinst() {
	kernel_is lt 2 6 23 && linux-mod_pkg_preinst
}

pkg_postinst() {
	kernel_is lt 2 6 23 && linux-mod_pkg_postinst
	elog
	elog "Don't forget to create your ~/.asus_acpi,"
	elog "see README in /usr/share/doc/${PF} for details"
	elog
}

pkg_postrm() {
	kernel_is lt 2 6 23 && linux-mod_pkg_postrm
}