/[gentoo-x86]/net-wireless/ndiswrapper/ndiswrapper-0.4.ebuild
Gentoo

Contents of /net-wireless/ndiswrapper/ndiswrapper-0.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Aug 25 13:16:44 2004 UTC (15 years, 10 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
mark stable on x86

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/ndiswrapper/ndiswrapper-0.4.ebuild,v 1.3 2004/06/25 00:46:46 agriffis Exp $
4
5 inherit kernel-mod
6
7 S=${WORKDIR}/${PN}
8 DESCRIPTION="Wrapper for using Windows drivers for some wireless cards"
9 HOMEPAGE="http://ndiswrapper.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~x86"
15 IUSE=""
16 DEPEND="sys-devel/flex"
17
18 src_unpack() {
19 check_KV
20 kernel-mod_getversion
21 unpack ${A}
22
23 if [ ${KV_MINOR} -eq 4 ] && [ ${KV_PATCH} -lt 23 ]
24 then
25 eerror "${P} requires a 2.4 kernel version of at"
26 eerror "least 2.4.23. You can either upgrade your kernel,"
27 eerror "Or use the ndiswrapper-0.3 ebuild."
28 die "Kernel version not supported"
29 fi
30
31 # Fix path to kernel and KVERS
32 sed -i -e "s:^KSRC.*:KSRC=${ROOT}/usr/src/linux:" \
33 -e "s:^KVERS.*:KVERS=${KV_MAJOR}${KV_MINOR}:" \
34 ${S}/driver/Makefile
35 }
36
37 src_compile() {
38 # Unset ARCH for 2.5/2.6 kernel compiles
39 unset ARCH
40 emake || die
41 }
42
43 src_install() {
44 if [ ${KV_MINOR} -gt 4 ]
45 then
46 KV_OBJ="ko"
47 else
48 KV_OBJ="o"
49 fi
50
51 dobin ${S}/utils/loadndisdriver
52 dodoc ${S}/README ${S}/INSTALL ${S}/AUTHORS
53
54 insinto /lib/modules/${KV}/misc
55 doins ${S}/driver/ndiswrapper.${KV_OBJ}
56
57 insinto /etc/modules.d
58 newins ${FILESDIR}/ndiswrapper.modules.d ndiswrapper
59 }
60
61 pkg_postinst() {
62 kernel-mod_pkg_postinst
63
64 einfo
65 einfo "Part of the ${PN} module configuration can be done by running"
66 einfo "# ebuild /var/db/pkg/net-wiress/${P}/${P}.ebuild config"
67 einfo "Please consult /etc/modules.d/ndiswrapper to finish"
68 einfo "configuring the driver"
69 einfo
70 einfo "In particular, ndiswrapper requires .inf and .sys files from"
71 einfo "a Windows(tm) driver to function. Put these somewhere like"
72 einfo "/usr/lib/hotplug/drivers, edit /etc/modules.d/ndiswrapper to match,"
73 einfo "then run 'update-modules'"
74 einfo
75 }
76
77 pkg_config() {
78 if [ ! -f "/etc/modules.d/ndiswrapper" ]
79 then
80 eerror "/etc/modules.d/ndiswrapper not found. Please re-emerge"
81 eerror "${PN} to have this file installed, then re-run this script"
82 die "Driver configuration file not found"
83 fi
84
85 if ! egrep "VENDORID" /etc/modules.d/ndiswrapper
86 then
87 eerror "/etc/modules.d/ndiswrapper doesn't appear to be the one"
88 eerror "distributed by the ${PN} ebuild. To use this config script,"
89 eerror "Please re-emerge ${PN} and then re-run this script."
90 die "Driver configuration file not usable"
91 else
92 einfo "Found acceptable config file at /etc/modules.d/ndiswrapper"
93 fi
94
95 if [ `lspci -n | grep 'Class 0280:' | wc -l` -gt 1 ]
96 then
97 eerror "More than one suitable device detected. This script"
98 eerror "will only work with one suitable device present."
99 die "Too many potential devices found"
100 fi
101
102 I=`lspci -n | grep 'Class 0280:' | cut -d' ' -f4`
103
104 if [ -z "${I}" ]
105 then
106 die "No suitable devices found"
107 fi
108
109 VENDOR=`echo $I | cut -d':' -f1`
110 DEVICEID=`echo $I | cut -d':' -f2`
111
112 einfo "Setting the vendor ID to ${VENDOR} and the device ID to ${DEVICEID}"
113 sed -i -e "s:VENDORID:${VENDOR}:" \
114 -e "s:DEVICEID:${DEVICEID}:" \
115 /etc/modules.d/ndiswrapper
116 }

  ViewVC Help
Powered by ViewVC 1.1.20