summaryrefslogtreecommitdiff
blob: 171ee9ed033ba15e3de63e02041dda8d29999c9b (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.1 2003/10/29 05:12:59 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=""
DEPEND=""
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."
}