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

inherit linux-info

DESCRIPTION="Driver for Connexant DGC modems"
HOMEPAGE="http://www.linuxant.com/drivers/dgc/"
SRC_URI="http://www.linuxant.com/drivers/dgc/archive/${P}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE=""
DEPEND=""
RDEPEND=""

CONFIG_CHECK="~USB_ACM"
ERROR_USB_ACM="${PN} requires USB modem (CDC ACM) support in your kernel (module name: USB_ACM)".

src_compile() {
	cd "${S}"/scripts
	emake dgcconfig dgcdcpd dgcmodconflicts dgcstop || die "Failed to make scripts"
}

src_install() {
	rm -f modules/GPL/COPYING
	rm -rf modules/binaries
	insinto /usr/lib/dgcmodem
	doins -r modules config.mak || die "Failed to install module files"
	fperms u+x /usr/lib/dgcmodem/modules/kernelcompiler.sh

	cd "${S}"/scripts
	dosbin dgcconfig dgcdcpd dgcmodconflicts dgcstop || die "Failed to install scripts"

	echo 'KERNEL=="ttyACM0", SYMLINK="modem"' > "${D}"/etc/udev/rules.d/90-dgcmodem.rules

	keepdir /etc/dgcmodem
}

pkg_postinst() {
	ewarn "Users need to be in the uucp group to use this driver."
	ewarn
	ewarn "Do not set the baud rate to a value higher than 115200, or it will not work."
	elog
	elog "Please run:"
	elog "    emerge --config ${PN}"
	elog "now and every time you update your kernel."
	elog
	elog "Note that using dgcconfig with default options may install an undesirable"
	elog "rc script, so it is advised you always use the above command instead."
}

pkg_config(){
	dgcconfig --kernel --serial --info
}

pkg_prerm() {
	dgcconfig --remove
	rm -f /etc/dgcmodem/.serial_configured
}