add cgal-3.9
[shuber-gentoo-overlay.git] / app-laptop / tp_smapi / tp_smapi-0.41.ebuild
1 EAPI=4
2
3 inherit eutils linux-mod
4
5 DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
6 HOMEPAGE="http://tpctl.sourceforge.net/"
7 SRC_URI="http://github.com/downloads/evgeni/tp_smapi/${P}.tar.gz"
8
9 LICENSE="GPL-2"
10 SLOT="0"
11 RESTRICT="mirror"
12 KEYWORDS="~amd64 ~x86"
13
14 IUSE="hdaps"
15
16
17 # We need dmideode if the kernel does not support DMI_DEV_TYPE_OEM_STRING
18 # in dmi.h
19 DEPEND="sys-apps/dmidecode"
20 RDEPEND="${DEPEND}"
21
22 pkg_pretend() {
23 linux-mod_pkg_setup
24
25 if kernel_is lt 2 6 19; then
26 eerror
27 eerror "${P} requires Linux kernel 2.6.19 or above."
28 eerror
29 die "Unsupported kernel version"
30 fi
31
32 MODULE_NAMES="thinkpad_ec(extra:) tp_smapi(extra:)"
33 BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR}"
34 BUILD_TARGETS="default"
35
36 if use hdaps; then
37 CONFIG_CHECK="~INPUT_UINPUT"
38 WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
39 linux-info_pkg_setup
40
41 MODULE_NAMES="${MODULE_NAMES} hdaps(extra:)"
42 BUILD_PARAMS="${BUILD_PARAMS} HDAPS=1"
43
44 CONFIG_CHECK="!SENSORS_HDAPS"
45 ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
46 linux-info_pkg_setup
47 fi
48 }
49
50 pkg_setup() {
51 # run again as pkg_pretend is not var safe
52 pkg_pretend
53 }
54
55 src_install() {
56 linux-mod_src_install
57 dodoc CHANGES README
58 newinitd "${FILESDIR}"/${P}-initd smapi
59 newconfd "${FILESDIR}"/${P}-confd smapi
60 }