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

Contents of /net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Nov 20 15:40:08 2008 UTC (11 years, 8 months ago) by peper
Branch: MAIN
Changes since 1.1: +6 -1 lines
Add patch for kernel 2.6.27.
(Portage version: 2.2_rc14/cvs/Linux 2.6.26-gentoo x86_64)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/ndiswrapper/ndiswrapper-1.53-r1.ebuild,v 1.1 2008/10/27 12:52:56 peper Exp $
4
5 inherit linux-mod
6
7 MY_P=${PN}-${PV/_/}
8
9 DESCRIPTION="Wrapper for using Windows drivers for some wireless cards"
10 HOMEPAGE="http://ndiswrapper.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
12
13 LICENSE="GPL-2"
14 KEYWORDS="~amd64 x86"
15 IUSE="debug usb"
16
17 DEPEND="sys-apps/pciutils"
18 RDEPEND="${DEPEND}
19 net-wireless/wireless-tools"
20
21 CONFIG_CHECK="WIRELESS_EXT"
22
23 S=${WORKDIR}/${MY_P}
24
25 MODULE_NAMES="ndiswrapper(misc:${S}/driver)"
26 BUILD_TARGETS="all"
27 MODULESD_NDISWRAPPER_ALIASES=("wlan0 ndiswrapper")
28
29 ERROR_USB="You need to enable USB support in your kernel
30 to use usb support in ndiswrapper."
31
32 pkg_setup() {
33 echo
34 einfo "See http://www.gentoo.org/doc/en/gentoo-kernel.xml"
35 einfo "for a list of supported kernels."
36 echo
37
38 use usb && CONFIG_CHECK="${CONFIG_CHECK} USB"
39 linux-mod_pkg_setup
40 }
41
42 src_unpack() {
43 unpack ${A}
44 convert_to_m "${S}/driver/Makefile"
45
46 if kernel_is ge 2 6 27 ; then
47 cd "${S}"
48 epatch "$FILESDIR/ndiswrapper-2.6.27.patch"
49 fi
50
51 cd "${S}/driver"
52 epatch "${FILESDIR}/ndiswrapper-CVE-2008-4395.patch"
53 }
54
55 src_compile() {
56 local params
57
58 # Enable verbose debugging information
59 if use debug; then
60 params="DEBUG=3"
61 use usb && params="${params} USB_DEBUG=1"
62 fi
63
64 cd utils
65 emake || die "Compile of utils failed!"
66
67 use usb || params="DISABLE_USB=1"
68
69 # Does not like parallel builds
70 # http://bugs.gentoo.org/show_bug.cgi?id=154213
71 # KBUILD value can't be quoted
72 # http://bugs.gentoo.org/show_bug.cgi?id=156319
73 BUILD_PARAMS="KSRC=${KV_DIR} KVERS=${KV_FULL} KBUILD=${KV_OUT_DIR} ${params} -j1"
74 linux-mod_src_compile
75 }
76
77 src_install() {
78 dodoc AUTHORS ChangeLog INSTALL README
79 doman ndiswrapper.8 || die
80
81 keepdir /etc/ndiswrapper
82
83 linux-mod_src_install
84
85 cd utils
86 emake DESTDIR="${D}" install || die "emake install failed"
87 }
88
89 pkg_postinst() {
90 linux-mod_pkg_postinst
91
92 echo
93 elog "NDISwrapper requires .inf and .sys files from a Windows(tm) driver"
94 elog "to function. Download these to /root for example, then"
95 elog "run 'ndiswrapper -i /root/foo.inf'. After that you can delete them."
96 elog "They will be copied to /etc/ndiswrapper/."
97 elog "Once done, please run 'update-modules'."
98 elog
99
100 elog "Please look at ${HOMEPAGE}"
101 elog "for the FAQ, HowTos, tips, configuration, and installation"
102 elog "information."
103 elog
104
105 local i=$(lspci -n | egrep 'Class (0280|0200):' | cut -d' ' -f4)
106 if [[ -n "${i}" ]] ; then
107 elog "Possible hardware: ${i}"
108 elog
109 fi
110
111 elog "NDISwrapper devs need support (_hardware_, cash)."
112 elog "Don't hesitate if you can help."
113 elog "See ${HOMEPAGE} for details."
114 echo
115
116 if [[ ${ROOT} == "/" ]]; then
117
118 einfo "Attempting to automatically reinstall any Windows drivers"
119 einfo "you might already have."
120 echo
121
122 local driver
123 for driver in $(ls /etc/ndiswrapper) ; do
124 einfo "Driver: ${driver}"
125 mv "/etc/ndiswrapper/${driver}" "${T}"
126 ndiswrapper -i "${T}/${driver}/${driver}.inf"
127 done
128 fi
129 }

  ViewVC Help
Powered by ViewVC 1.1.20