summaryrefslogtreecommitdiff
path: root/x11-drivers/wizardpen/wizardpen-0.8.1.ebuild
blob: dab1e53aa57f05d39ec0460f5abf1ed20d7466ed (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="4"

inherit linux-mod eutils autotools

DESCRIPTION="Driver for Genius Wizardpen Tablets"
HOMEPAGE="http://code.google.com/p/linuxgenius/"
SRC_URI="http://launchpad.net/wizardpen/trunk/0.8/+download/xorg-input-wizardpen-${PV}.tar.bz2"

RDEPEND="x11-base/xorg-server
	 x11-libs/libX11
	 x11-libs/libXext
	 x11-misc/xautomation
	 x11-apps/xinput"

DEPEND="${RDEPEND}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="hal udev"
RESTRICT="nomirror"
S="${WORKDIR}/xorg-input-${PN}-${PV/_/-}"

src_unpack() {
	if kernel_is 2 4; then
		die "You must use 2.6.X kernel with ${PN}"
	fi
	if ! linux_chkconfig_module INPUT_EVDEV
	then
		if ! linux_chkconfig_present INPUT_EVDEV
			then
			eerror "${PN} requires evdev support for USB tablets"
			eerror "In your .config: CONFIG_INPUT_EVDEV=y or CONFIG_INPUT_EVDEV=m"
			eerror "Through 'make menuconfig':"
						eerror "Device Drivers-> Input device support-> [*] Event interface or"
						eerror "Device Drivers-> Input device support-> [M] Event interface"
						eerror ""
						eerror "If compiled as modules add evdev to /etc/modules.autoload/kernel-2.6"
						die "Please build evdev support first"
		fi
	fi
	if ! linux_chkconfig_present USB_HID
	then
		eerror "${PN} requires USB Human Interface Device support for USB tablets"
		eerror "In your .config: CONFIG_USB_HID=y or CONFIG_USB_HID=m"
		eerror "Through 'make menuconfig':"
		eerror "Device Drivers-> USB support-> [*] USB Human Interface Device (full HID) support or"
		eerror "Device Drivers-> USB support-> [M] USB Human Interface Device (full HID) support"
		eerror ""
		eerror "If compiled as modules add usbhid to /etc/modules.autoload/kernel-2.6"
		die "Please build USB HID support first"
	fi
	unpack ${A}
}

src_prepare() {
	rm aclocal.m4
	eautoreconf
}

src_configure() {
	econf || die "econf failed"
}

src_compile() {
	emake || die "emake failed"
}

src_install() {
	exeinto /usr/lib/xorg/modules/drivers/
	doexe src/.libs/wizardpen_drv.so

	exeinto /usr/bin
	doexe calibrate/wizardpen-calibrate

	doman man/wizardpen.4

	use udev && {
		insinto /lib/udev/rules.d
		doins udev/67-xorg-wizardpen.rules
	}

	use hal && {
		insinto /etc/hal/fdi/policy
		doins hal/10-wizardpen-devices.fdi
		doins hal/11-wizardpen-config.fdi
	}

	insinto /usr/share/X11/xorg.conf.d
	doins   xorg/
}

pkg_postinst() {
	einfo ""
	einfo "You can set tablet working area useing wizardpen-calibrate tool, see"
	einfo "README and INSTALL files from /usr/share/doc/${P} for more details."
	einfo ""
}