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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 agriffis 1.2 # Copyright 1999-2004 Gentoo Foundation
2 latexer 1.1 # Distributed under the terms of the GNU General Public License v2
3 cardoe 1.3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/ndiswrapper/ndiswrapper-0.5.ebuild,v 1.2 2004/06/25 00:46:46 agriffis Exp $
4 latexer 1.1
5     inherit kernel-mod
6    
7     S=${WORKDIR}/${P}
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     einfnfo "Checking kernel module dependancies"
63     test -r "${ROOT}/${KV_OUTPUT}/System.map" && \
64     depmod -ae -F "${ROOT}/${KV_OUTPUT}/System.map" -b "${ROOT}" -r ${KV}
65    
66     einfo "Part of the ${PN} module configuration can be done by running"
67     einfo "# ebuild /var/db/pkg/net-wiress/${P}/${P}.ebuild config"
68     einfo "Please consult /etc/modules.d/ndiswrapper to finish"
69     einfo "configuring the driver"
70     einfo
71     einfo "In particular, ndiswrapper requires .inf and .sys files from"
72     einfo "a Windows(tm) driver to function. Put these somewhere like"
73     einfo "/usr/lib/hotplug/drivers, edit /etc/modules.d/ndiswrapper to match,"
74     einfo "then run 'update-modules'"
75     einfo
76     }
77    
78     pkg_config() {
79     if [ ! -f "/etc/modules.d/ndiswrapper" ]
80     then
81     eerror "/etc/modules.d/ndiswrapper not found. Please re-emerge"
82     eerror "${PN} to have this file installed, then re-run this script"
83     die "Driver configuration file not found"
84     fi
85    
86     if ! egrep "VENDORID" /etc/modules.d/ndiswrapper
87     then
88     eerror "/etc/modules.d/ndiswrapper doesn't appear to be the one"
89     eerror "distributed by the ${PN} ebuild. To use this config script,"
90     eerror "Please re-emerge ${PN} and then re-run this script."
91     die "Driver configuration file not usable"
92     else
93     einfo "Found acceptable config file at /etc/modules.d/ndiswrapper"
94     fi
95    
96     if [ `lspci -n | grep 'Class 0280:' | wc -l` -gt 1 ]
97     then
98     eerror "More than one suitable device detected. This script"
99     eerror "will only work with one suitable device present."
100     die "Too many potential devices found"
101     fi
102    
103     I=`lspci -n | grep 'Class 0280:' | cut -d' ' -f4`
104    
105     if [ -z "${I}" ]
106     then
107     die "No suitable devices found"
108     fi
109    
110     VENDOR=`echo $I | cut -d':' -f1`
111     DEVICEID=`echo $I | cut -d':' -f2`
112    
113     einfo "Setting the vendor ID to ${VENDOR} and the device ID to ${DEVICEID}"
114     sed -i -e "s:VENDORID:${VENDOR}:" \
115     -e "s:DEVICEID:${DEVICEID}:" \
116     /etc/modules.d/ndiswrapper
117     }

  ViewVC Help
Powered by ViewVC 1.1.20