summaryrefslogtreecommitdiff
blob: b2559b5a02c42174768608dfca5894e61061a169 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="4"
inherit linux-mod eutils

ARCHRUMP="${PN}-full-${PV}"
DESCRIPTION="Winmodems with Lucent Apollo (ISA) and Mars (PCI) chipsets"
HOMEPAGE="http://linmodems.technion.ac.il/"
SRC_URI="http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/martian/${ARCHRUMP}.tar.gz"

LICENSE="GPL-2 AgereSystems-WinModem"
KEYWORDS="-* ~x86"
IUSE=""
SLOT="0"

RESTRICT="mirror strip"

DEPEND=""
RDEPEND=""

S="${WORKDIR}/${ARCHRUMP}"

MODULE_NAMES="martian_dev(ltmodem::kmodule)"
CONFIG_CHECK="SERIAL_8250"
SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL_8250) support."

pkg_setup() {
	linux-mod_pkg_setup

	if kernel_is lt 2 6 21
	then	eerror "This driver works only with 2.6.21 or newer kernels!"
		die "unsupported kernel detected"
	fi

	BUILD_TARGETS="all"
	BUILD_PARAMS="KERNEL_DIR='${KV_DIR}' SUBLEVEL='21'"
}

src_prepare() {
	epatch "${FILESDIR}/grsecurity.patch"
	epatch_user
}

src_install() {
	# install kernel module
	linux-mod_src_install
	dosbin modem/martian_modem
}

pkg_postinst() {
	linux-mod_pkg_postinst

	[ "$ROOT" = "/" ] && /sbin/update-modules

	ewarn
	ewarn "To make the modem available modprobe martian_dev and run \"martian_modem\"."
	ewarn "This will make the modem available as /dev/ttySM0."
	ewarn "When using wvdial add \"Carrier Check = no\" line."
}