blob: aa13aff1f3d33a2a1e1756b4bc1f23e438a98255 (
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/slmodem-2.9.11_pre20070505.ebuild,v 1.2 2007/07/07 12:49:25 genstef Exp $
inherit eutils linux-mod multilib
DESCRIPTION="Driver for Smart Link modem"
HOMEPAGE="http://linmodems.technion.ac.il/packages/smartlink/"
SRC_URI="http://linmodems.technion.ac.il/packages/smartlink/${P/_pre/-}.tar.gz
http://linmodems.technion.ac.il/packages/smartlink/ungrab-winmodem-${PV/*_pre/}.tar.gz"
LICENSE="Smart-Link"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE="alsa usb"
DEPEND="alsa? ( media-libs/alsa-lib )
amd64? ( app-emulation/emul-linux-x86-soundlibs )"
QA_EXECSTACK="usr/sbin/slmodem_test usr/sbin/slmodemd"
S="${WORKDIR}"/${P/_pre/-}
pkg_setup() {
use amd64 && multilib_toolchain_setup x86
MODULE_NAMES="ungrab-winmodem(:${WORKDIR}/ungrab-winmodem-${PV/*_pre/})"
if ! use amd64; then
MODULE_NAMES="${MODULE_NAMES} slamr(net:${S}/drivers)"
if use usb; then
MODULE_NAMES="${MODULE_NAMES} slusb(net:${S}/drivers)"
CONFIG_CHECK="USB"
fi
fi
BUILD_TARGETS="all"
linux-mod_pkg_setup
BUILD_PARAMS="KERNEL_DIR=${KV_OUT_DIR}"
}
src_unpack() {
unpack ${A}
cd "${WORKDIR}"
sed -i "s:SUBDIRS=\$(shell pwd):SUBDIRS=${WORKDIR}/ungrab-winmodem-${PV/*_pre/}:" \
ungrab-winmodem-${PV/*_pre/}/Makefile
convert_to_m ungrab-winmodem-${PV/*_pre/}/Makefile
epatch "${FILESDIR}"/${PN}-ungrab-winmodem-hp500.patch
cd "${S}"
epatch "${FILESDIR}/${P%%_*}-makefile.patch"
cd "${S}"/drivers
sed -i "s:SUBDIRS=\$(shell pwd):SUBDIRS=${S}/drivers:" Makefile
convert_to_m Makefile
sed -i "s:.*=[ \t]*THIS_MODULE.*::" st7554.c amrmo_init.c old_st7554.c
sed -i 's:MODULE_PARM(\([^,]*\),"i");:module_param(\1, int, 0);:' st7554.c \
amrmo_init.c old_st7554.c
}
src_compile() {
local MAKE_PARAMS=""
if use alsa || use amd64; then
MAKE_PARAMS="SUPPORT_ALSA=1"
fi
emake ${MAKE_PARAMS} modem || die "failed to build modem"
use amd64 && multilib_toolchain_setup amd64
linux-mod_src_compile
}
src_install() {
linux-mod_src_install
cd "${S}"
newsbin modem/modem_test slmodem_test
dosbin modem/slmodemd
dodir /var/lib/slmodem
fowners root:dialout /var/lib/slmodem
keepdir /var/lib/slmodem
newconfd "${FILESDIR}/slmodem-confd" ${PN}
newinitd "${FILESDIR}/slmodem-initd" ${PN}
# configure for alsa - or not for alsa
if use alsa; then
sed -i -e "s/# MODULE=alsa/MODULE=alsa/" \
-e "s/# HW_SLOT=modem:1/HW_SLOT=modem:1/" "${D}/etc/conf.d/slmodem"
else
sed -i "s/# MODULE=slamr/MODULE=slamr/" "${D}/etc/conf.d/slmodem"
fi
# Add module aliases and install hotplug script
insinto /etc/modules.d/
newins "${FILESDIR}/slmodem-modules" ${PN}
if use usb; then
exeinto /$(get_libdir)/udev
newexe "${FILESDIR}/slusb-udev.script" slmodem_usb.sh
fi
dodir /etc/modprobe.d
echo -e "blacklist slusb\nblacklist slamr\nblacklist snd-intel8x0m" >> "${D}/etc/modprobe.d/${PN}"
# Add configuration for udev
dodir /etc/udev/rules.d/
echo 'KERNEL=="slamr", NAME="slamr0" GROUP="dialout"' > \
"${D}/etc/udev/rules.d/55-${PN}.rules"
if use usb; then
echo 'KERNEL=="slusb", NAME="slusb0" GROUP="dialout" RUN+="slmodem_usb.sh"' >> \
"${D}/etc/udev/rules.d/55-${PN}.rules"
fi
dodoc Changes README
newdoc "${WORKDIR}"/ungrab-winmodem-${PV/*_pre}/Readme.txt README-ungrab-winmodem.txt
}
pkg_postinst() {
linux-mod_pkg_postinst
# Make some devices if we aren't using devfs or udev
if [ -e "${ROOT}/dev/.udev" ]; then
ebegin "Reloading udev rules..."
udevcontrol reload_rules
eend $?
else
cd "${S}/drivers"
make DESTDIR="${ROOT}" install-devices
fi
ewarn "To avoid problems, slusb/slamr have been blacklisted in /etc/modprobe.d/${PN}"
elog "You must edit /etc/conf.d/${PN} for your configuration"
elog "To add slmodem to your startup - type : rc-update add slmodem default"
elog
if use alsa; then
elog "I hope you have already added alsa to your startup: "
elog "otherwise type: rc-update add alsasound boot"
elog
elog "If you need to use snd-intel8x0m from the kernel"
elog "compile it as a module and edit /etc/modules.d/alsa"
elog 'to: "alias snd-card-(number) snd-intel8x0m"'
elog
fi
elog "You need to be in the uucp AND dialout group to make calls as a user."
elog
elog "If you see the following in dmesg:"
elog " slamr: device 10b9:5457 is grabbed by driver serial"
elog "you need to modprobe ungrab-winmodem before slamr"
elog "See /etc/modules.d/slmodem for details."
}
|