]> git.draconx.ca Git - gentoo-draconx.git/blob - app-laptop/tp_smapi/tp_smapi-0.40.ebuild
tp_smapi: Fix build on 2.6.37.
[gentoo-draconx.git] / app-laptop / tp_smapi / tp_smapi-0.40.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/tp_smapi-0.40.ebuild,v 1.4 2009/12/01 18:51:39 fauli Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-mod
8
9 DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
10 HOMEPAGE="http://tpctl.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/tpctl/${P}.tgz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16
17 IUSE="hdaps"
18
19 RESTRICT="userpriv"
20
21 # We need dmideode if the kernel does not support DMI_DEV_TYPE_OEM_STRING
22 # in dmi.h
23 DEPEND="sys-apps/dmidecode"
24
25 pkg_setup() {
26         linux-mod_pkg_setup
27
28         if kernel_is lt 2 6 19; then
29                 eerror
30                 eerror "${P} requires Linux kernel 2.6.19 or above."
31                 eerror
32                 die "Unsupported kernel version"
33         fi
34
35         MODULE_NAMES="thinkpad_ec(extra:) tp_smapi(extra:)"
36         BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR}"
37         BUILD_TARGETS="default"
38
39         if use hdaps; then
40
41                 CONFIG_CHECK="~INPUT_UINPUT"
42                 WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
43                 linux-info_pkg_setup
44
45                 MODULE_NAMES="${MODULE_NAMES} hdaps(extra:)"
46                 BUILD_PARAMS="${BUILD_PARAMS} HDAPS=1"
47
48                 CONFIG_CHECK="!SENSORS_HDAPS"
49                 ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
50                 linux-info_pkg_setup
51         fi
52 }
53
54 src_prepare() {
55         epatch "${FILESDIR}"/${PN}-fix-vercheck.patch
56         epatch "${FILESDIR}"/0001-Convert-DECLARE_MUTEX-to-DEFINE_SEMAPHORE.patch
57 }
58
59 src_install() {
60         linux-mod_src_install
61         dodoc CHANGES README
62 }