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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Jul 22 19:18:01 2014 UTC (6 years ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
amd64 stable, bug #505348

(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)

1 # Copyright 1999-2014 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.59.ebuild,v 1.3 2014/06/14 08:50:50 phajdan.jr Exp $
4
5 EAPI=4
6 inherit base linux-mod toolchain-funcs
7
8 DESCRIPTION="Wrapper for using Windows drivers for some wireless cards"
9 HOMEPAGE="http://ndiswrapper.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/${PN}/stable/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 KEYWORDS="amd64 x86"
14 IUSE="debug usb"
15
16 DEPEND="sys-apps/pciutils"
17 RDEPEND="${DEPEND}
18 net-wireless/wireless-tools"
19
20 PATCHES=( "${FILESDIR}"/${P}-cflags.patch
21 "${FILESDIR}"/${P}-3.14.patch )
22 MODULE_NAMES="ndiswrapper(misc:${S}/driver)"
23 BUILD_TARGETS="all"
24 MODULESD_NDISWRAPPER_ALIASES=("wlan0 ndiswrapper")
25
26 pkg_pretend() {
27 CONFIG_CHECK="~WEXT_PRIV"
28 use usb && CONFIG_CHECK="${CONFIG_CHECK} ~USB"
29 ERROR_USB="You need to enable USB support in your kernel to use usb support in ndiswrapper."
30 ERROR_WEXT_PRIV="Your kernel does not support WEXT_PRIV. To enable it you need to enable a wireless driver that enables it, for example PRISM54 or IPW2200"
31 linux-mod_pkg_setup
32 }
33
34 src_compile() {
35 local params
36
37 # Enable verbose debugging information
38 if use debug; then
39 params="DEBUG=3"
40 use usb && params="${params} USB_DEBUG=1"
41 fi
42
43 cd utils
44 emake CC=$(tc-getCC)
45
46 use usb || params="${params} DISABLE_USB=1"
47
48 BUILD_PARAMS="KSRC=${KV_DIR} KVERS=${KV_FULL} KBUILD='${KV_OUT_DIR}' ${params}"
49 linux-mod_src_compile
50 }
51
52 src_install() {
53 dodoc AUTHORS ChangeLog INSTALL README
54 doman ndiswrapper.8
55
56 keepdir /etc/ndiswrapper
57
58 linux-mod_src_install
59
60 cd utils
61 emake DESTDIR="${D}" install
62 }
63
64 pkg_postinst() {
65 linux-mod_pkg_postinst
66
67 echo
68 elog "NDISwrapper requires .inf and .sys files from a Windows(tm) driver"
69 elog "to function. Download these to /root for example, then"
70 elog "run 'ndiswrapper -i /root/foo.inf'. After that you can delete them."
71 elog "They will be copied to /etc/ndiswrapper/."
72 elog "Once done, please run 'update-modules'."
73 echo
74
75 elog "Please look at ${HOMEPAGE}"
76 elog "for the FAQ, HowTos, tips, configuration, and installation"
77 elog "information."
78 echo
79
80 for i in $(lspci -n | egrep '(0280|0200):' | cut -d' ' -f1)
81 do
82 i_desc=$(lspci -nn | grep "$i" | awk -F': ' '{print $2}' | awk -F'[' '{print $1}')
83 if [[ -n "${i_desc}" ]] ; then
84 elog "Possible hardware: ${i_desc}"
85 fi
86 done
87
88 echo
89 elog "NDISwrapper devs need support (_hardware_, cash)."
90 elog "Don't hesitate if you can help."
91 elog "See ${HOMEPAGE} for details."
92 echo
93
94 if [[ ${ROOT} == "/" ]]; then
95
96 einfo "Attempting to automatically reinstall any Windows drivers"
97 einfo "you might already have."
98 echo
99
100 local driver
101 for driver in $(ls /etc/ndiswrapper) ; do
102 einfo "Driver: ${driver}"
103 mv "/etc/ndiswrapper/${driver}" "${T}"
104 ndiswrapper -i "${T}/${driver}/${driver}.inf"
105 done
106 fi
107 }

  ViewVC Help
Powered by ViewVC 1.1.20