summaryrefslogtreecommitdiff
blob: 710410ea50f45065efb1d8cc47f7608a1326a293 (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/slmodem-2.7.14.ebuild,v 1.3 2003/12/14 12:27:47 spyderous Exp $

DESCRIPTION="Driver for Smart Link modem"
HOMEPAGE="http://www.smlink.com/"
MY_P="${P/modem/mdm}"
SRC_URI="ftp://ftp.smlink.com/linux/unsupported/${MY_P}.tar.gz"
LICENSE="Smart-Link"
SLOT="0"
KEYWORDS="x86"
IUSE=""
RDEPEND="virtual/glibc"
S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${A}
	epatch ${FILESDIR}/${PF}-makefile-fixup.patch
}

src_compile() {
	emake || die
}

src_install() {
	make install || die

	dodoc README COPYRIGHT FAQ Changes

	# Executable to get regions and version
	exeinto /usr/bin
	doexe slver

	# Install /etc/{devfs,modules}.d/slmodem files
	insinto /etc/devfs.d/; newins ${FILESDIR}/${PN}-2.7.devfs ${PN}
	insinto /etc/modules.d/; newins ${FILESDIR}/${PN}-2.7.modules ${PN}
}

pkg_postinst() {
	# Make some devices if we aren't using devfs
	if [ ! -e ${ROOT}dev/.devfsd ] ; then
		ebegin "Creating /dev/ttySL* devices"
		local C="0"
		while [ "${C}" -lt "4" ]; do
			if [ ! -c ${ROOT}dev/ttySL${C} ]; then
				mknod ${ROOT}dev/ttySL${C} c 212 0
			fi
			C="`expr $C + 1`"
		done
		eend 0
	fi

	ebegin "Restarting devfsd to create /dev/modem symlink"
		killall -HUP devfsd
	eend 0

	echo
	einfo "You must edit /etc/modules.d/${PN} and run"
	einfo "modules-update to complete configuration."
}