Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 32737 | Differences between
and this patch

Collapse All | Expand All

(-)linux-wlan-ng-0.2.1_pre16.ebuild (-74 / +90 lines)
Lines 1-15 Link Here
1
# Copyright 1999-2004 Gentoo Technologies, Inc.
1
# Copyright 1999-2003 Gentoo Technologies, Inc.
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /home/cvsroot/gentoo-x86/net-wireless/linux-wlan-ng/linux-wlan-ng-0.2.1_pre16.ebuild,v 1.1 2004/01/24 22:59:20 nerdboy Exp $
3
# $Header: /home/cvsroot/gentoo-x86/net-wireless/linux-wlan-ng/linux-wlan-ng-0.2.1_pre11.ebuild,v 1.3 2003/09/10 04:47:55 msterret Exp $
4
4
5
inherit eutils
5
6
inherit eutils kernel-mod
6
7
7
IUSE="apm build nocardbus pcmcia pnp trusted usb"
8
IUSE="apm build nocardbus pcmcia pnp trusted usb"
8
9
9
PCMCIA_CS="pcmcia-cs-3.2.1"
10
PCMCIA_CS="pcmcia-cs-3.2.4"
10
PATCH_3_2_2="pcmcia-cs-3.2.1-3.2.2.diff.gz"
11
PATCH_3_2_5="pcmcia-cs-3.2.4-3.2.5.diff"
11
PATCH_3_2_3="pcmcia-cs-3.2.1-3.2.3.diff.gz"
12
PATCH_3_2_6="pcmcia-cs-3.2.4-3.2.6.diff"
12
PATCH_3_2_4="pcmcia-cs-3.2.1-3.2.4.diff.gz"
13
PATCH_3_2_7="pcmcia-cs-3.2.4-3.2.7.diff"
13
PCMCIA_DIR="${WORKDIR}/${PCMCIA_CS}"
14
PCMCIA_DIR="${WORKDIR}/${PCMCIA_CS}"
14
MY_P=${PN}-${PV/_/-}
15
MY_P=${PN}-${PV/_/-}
15
S=${WORKDIR}/${MY_P}
16
S=${WORKDIR}/${MY_P}
Lines 17-64 Link Here
17
DESCRIPTION="The linux-wlan Project"
18
DESCRIPTION="The linux-wlan Project"
18
SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${MY_P}.tar.gz
19
SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${MY_P}.tar.gz
19
		mirror://gentoo/${PN}-gentoo-init.gz
20
		mirror://gentoo/${PN}-gentoo-init.gz
21
		http://dev.gentoo.org/~latexer/files/patches/${PN}-koutput.diff
20
		pcmcia?	( mirror://sourceforge/pcmcia-cs/${PCMCIA_CS}.tar.gz )
22
		pcmcia?	( mirror://sourceforge/pcmcia-cs/${PCMCIA_CS}.tar.gz )
21
		pcmcia? ( mirror://gentoo/${PATCH_3_2_2} )
23
		pcmcia? ( mirror://gentoo/${PATCH_3_2_5}.gz )
22
		pcmcia? ( mirror://gentoo/${PATCH_3_2_3} )
24
		pcmcia? ( mirror://gentoo/${PATCH_3_2_6}.gz )
23
		pcmcia? ( mirror://gentoo/${PATCH_3_2_4} )"
25
		pcmcia? ( mirror://gentoo/${PATCH_3_2_7}.gz )"
24
26
25
HOMEPAGE="http://linux-wlan.org"
27
HOMEPAGE="http://linux-wlan.org"
26
DEPEND="sys-kernel/linux-headers
28
DEPEND="sys-kernel/linux-headers
27
		dev-libs/openssl
29
		dev-libs/openssl
28
		sys-apps/baselayout
30
		sys-apps/baselayout
31
		>=sys-apps/sed-4.0*
29
		pcmcia?	( sys-apps/pcmcia-cs )"
32
		pcmcia?	( sys-apps/pcmcia-cs )"
30
SLOT="0"
33
SLOT="0"
31
LICENSE="MPL-1.1"
34
LICENSE="MPL-1.1"
32
KEYWORDS="~x86 ~ppc"
35
KEYWORDS="~x86"
33
36
34
# check arch for configure
37
KERNEL_MOD_SOURCES="${MY_P}.tar.gz ${PN}-gentoo-init.gz"
35
if [ ${ARCH} = "x86" ] ; then
36
	MY_ARCH="i386"
37
else
38
	MY_ARCH="ppc"
39
fi
40
41
# Note: To use this ebuild, you should have the usr/src/linux symlink to
42
# the kernel directory that linux-wlan-ng should use for configuration.
43
#
44
# linux-wlan-ng requires a configured pcmcia-cs source tree.
45
# unpack/configure it in WORKDIR.  No need to compile it though.
46
38
47
src_unpack() {
39
src_unpack() {
40
	kernel-mod_src_unpack
48
41
49
	unpack ${MY_P}.tar.gz
50
	unpack ${PN}-gentoo-init.gz
51
	cp ${WORKDIR}/${PN}-gentoo-init ${S}/etc/rc.wlan
42
	cp ${WORKDIR}/${PN}-gentoo-init ${S}/etc/rc.wlan
52
43
44
	cd ${S}
45
	mkdir -p src/tmp
46
47
	epatch ${DISTDIR}/${PN}-koutput.diff
48
53
	if [ -n "`use pcmcia`" ]; then
49
	if [ -n "`use pcmcia`" ]; then
54
		unpack ${PCMCIA_CS}.tar.gz
50
		if egrep '^CONFIG_PCMCIA=[ym]' ${KV_OUTPUT}/.config >&/dev/null
55
		cd ${PCMCIA_DIR}
51
		then
56
		if [ -z "`has_version =sys-apps/pcmcia-cs-3.2.4*`" ]; then
52
			# Sadly, we still need to download these sources in SRC_URI
57
			epatch ${DISTDIR}/${PATCH_3_2_4}
53
			# til portage can handle more dynamic SRC_URIs
58
		elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.3*`" ]; then
54
			einfo "Kernel PCMCIA detected. Skipping external pcmcia-cs sources."
59
			epatch ${DISTDIR}/${PATCH_3_2_3}
55
		else
60
		elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.2*`" ]; then
56
			unpack ${PCMCIA_CS}.tar.gz
61
			epatch ${DISTDIR}/${PATCH_3_2_2}
57
			cd ${PCMCIA_DIR}
58
			if [ -z "`has_version =sys-apps/pcmcia-cs-3.2.4*`" ]; then
59
				epatch ${WORKDIR}/${PATCH_3_2_4}
60
			elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.3*`" ]; then
61
				epatch ${WORKDIR}/${PATCH_3_2_3}
62
			elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.2*`" ]; then
63
				epatch ${WORKDIR}/${PATCH_3_2_2}
64
			fi
62
		fi
65
		fi
63
	fi
66
	fi
64
67
Lines 67-95 Link Here
67
	# things to end up in the right place.
70
	# things to end up in the right place.
68
71
69
	cd ${S}
72
	cd ${S}
70
	mv man/Makefile man/Makefile.orig
73
	sed -i -e "s:mkdir:#mkdir:" \
71
	sed -e "s:mkdir:#mkdir:" \
72
		-e "s:cp nwepgen.man:#cp nwepgen.man:" \
74
		-e "s:cp nwepgen.man:#cp nwepgen.man:" \
73
		-e "s:\t\$(TARGET_:\t#\$(TARGET_:" \
75
		-e "s:\t\$(TARGET_:\t#\$(TARGET_:" \
74
		man/Makefile.orig > man/Makefile
76
		man/Makefile
77
78
	sed -i -e "s:/etc/wlan:/etc/conf.d:g" \
79
		etc/wlan/Makefile
75
80
76
	mv etc/wlan/Makefile etc/wlan/Makefile.orig
81
	sed -i -e "s:/sbin/nwepgen:/sbin/keygen:" \
77
	sed -e "s:/etc/wlan:/etc/conf.d:g" \
82
		etc/wlan/wlancfg-DEFAULT
78
		etc/wlan/Makefile.orig > etc/wlan/Makefile
79
80
	mv etc/wlan/wlancfg-DEFAULT etc/wlan/wlancfg-DEFAULT.orig
81
	sed -e "s:/sbin/nwepgen:/sbin/keygen:" \
82
		etc/wlan/wlancfg-DEFAULT.orig > etc/wlan/wlancfg-DEFAULT
83
83
84
	mv etc/wlan/shared etc/wlan/shared.orig
84
	sed -i -e "s:/etc/wlan/wlan.conf:/etc/conf.d/wlan.conf:g" \
85
	sed -e "s:/etc/wlan/wlan.conf:/etc/conf.d/wlan.conf:g" \
86
	    -e "s:/etc/wlan/wlancfg:/etc/conf.d/wlancfg:g" \
85
	    -e "s:/etc/wlan/wlancfg:/etc/conf.d/wlancfg:g" \
87
		etc/wlan/shared.orig > etc/wlan/shared
86
		etc/wlan/shared
88
87
89
}
88
}
90
89
91
src_compile() {
90
src_compile() {
92
91
	local kernelpcmcia
93
	#
92
	#
94
	# configure pcmcia-cs - we need this for wlan to compile
93
	# configure pcmcia-cs - we need this for wlan to compile
95
	# use same USE flags that the pcmcia-cs ebuild does.
94
	# use same USE flags that the pcmcia-cs ebuild does.
Lines 98-106 Link Here
98
	# the kernel tree.
97
	# the kernel tree.
99
	#
98
	#
100
99
101
	if [ -n "`use pcmcia`" ]; then
100
	if egrep '^CONFIG_PCMCIA=[ym]' ${KV_OUTPUT}/.config >&/dev/null; then
101
		kernelpcmcia="YES"
102
	else
103
		kernelpcmcia="NO"
104
	fi
105
106
	if [ -n "`use pcmcia`" -a "${kernelpcmcia}" != "YES" ]; then
107
		local myarch myconf
108
109
		# pcmcia-cs expects "i386" not "x86"
110
		case "${ARCH}" in
111
				x86) myarch="i386" ;;
112
				*) myarch="${ARCH}" ;;
113
		esac
114
102
		cd ${WORKDIR}/${PCMCIA_CS}
115
		cd ${WORKDIR}/${PCMCIA_CS}
103
		local myconf
104
		if [ -n "`use trusted`" ] ; then
116
		if [ -n "`use trusted`" ] ; then
105
			myconf="--trust"
117
			myconf="--trust"
106
		else
118
		else
Lines 131-167 Link Here
131
			--target=${D} \
143
			--target=${D} \
132
			--srctree \
144
			--srctree \
133
			--kernel=/usr/src/linux \
145
			--kernel=/usr/src/linux \
134
			--arch="${MY_ARCH}" \
146
			--arch="${myarch}" \
135
			--uflags="${CFLAGS}" \
147
			--uflags="${CFLAGS}" \
136
			--kflags="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer" \
148
			--kflags="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer" \
137
			$myconf || die "failed configuring pcmcia-cs"
149
			$myconf || die "failed configuring pcmcia-cs"
138
	fi
150
	fi
151
152
	# 2.5/2.6 kernels need ARCH unset
153
	if [ "${KV_MINOR}" -gt 4 ]
154
	then
155
		unset ARCH
156
	fi
157
139
	# now lets build wlan-ng
158
	# now lets build wlan-ng
140
	cd ${S}
159
	cd ${S}
141
160
142
	sed -e 's:TARGET_ROOT_ON_HOST=:TARGET_ROOT_ON_HOST=${D}:' \
161
	sed -i -e 's:TARGET_ROOT_ON_HOST=:TARGET_ROOT_ON_HOST=${D}:' \
143
		-e 's:PRISM2_PCI=n:PRISM2_PCI=y:' \
162
		-e 's:PRISM2_PCI=n:PRISM2_PCI=y:' \
144
		config.in > default.config
163
		config.in
145
	mv default.config config.in
146
164
147
	if [ -n "`use pcmcia`" ]; then
165
	if [ -n "`use pcmcia`" ]; then
148
		export PCMCIA_CS=${PCMCIA_CS}
166
		if [ "${kernelpcmcia}" != "YES" ];
149
		sed -e 's:PCMCIA_SRC=:PCMCIA_SRC=${WORKDIR}/${PCMCIA_CS}:' \
167
		then
150
			-e 's:PRISM2_PLX=n:PRISM2_PLX=y:' \
168
			export PCMCIA_CS=${PCMCIA_CS}
151
			config.in > default.config
169
			sed -i -e 's:PCMCIA_SRC=:PCMCIA_SRC=${WORKDIR}/${PCMCIA_CS}:' \
170
				config.in
171
		fi
172
		sed -i -e 's:PRISM2_PLX=n:PRISM2_PLX=y:' \
173
			config.in
152
	else
174
	else
153
		sed -e 's:PRISM2_PCMCIA=y:PRISM2_PCMCIA=n:' \
175
		sed -i -e 's:PRISM2_PCMCIA=y:PRISM2_PCMCIA=n:' \
154
		config.in > default.config
176
		config.in
155
	fi
177
	fi
156
	mv default.config config.in
157
178
158
	if [ -n "`use usb`" ]; then
179
	if [ -n "`use usb`" ]; then
159
		sed -e 's:PRISM2_USB=n:PRISM2_USB=y:' \
180
		sed -i -e 's:PRISM2_USB=n:PRISM2_USB=y:' \
160
			config.in > default.config
181
			config.in
161
		mv default.config config.in
182
	fi
183
184
	if [ "${KV_MINOR}" -gt "4" ]; then
185
		export KV_OUTPUT=${KV_OUTPUT}
186
		sed -i -e 's:^LINUX_OUTPUT=.*:LINUX_OUTPUT=${KV_OUTPUT}:' \
187
			config.in
162
	fi
188
	fi
163
189
164
	mv default.config config.in
165
	cp config.in default.config
190
	cp config.in default.config
166
191
167
	emake default_config || die "failed configuring WLAN"
192
	emake default_config || die "failed configuring WLAN"
Lines 202-215 Link Here
202
pkg_postinst() {
227
pkg_postinst() {
203
	depmod -a
228
	depmod -a
204
229
205
	einfo "Configuration of the WLAN package has changed since 0.1.16-pre4."
206
	einfo ""
207
	einfo "/etc/init.d/wlan is used to control startup and shutdown of non-PCMCIA devices."
230
	einfo "/etc/init.d/wlan is used to control startup and shutdown of non-PCMCIA devices."
208
	einfo "/etc/init.d/pcmcia from pcmcia-cs is used to control startup and shutdown of"
231
	einfo "/etc/init.d/pcmcia from pcmcia-cs is used to control startup and shutdown of"
209
	einfo "PCMCIA devices."
232
	einfo "PCMCIA devices."
210
	einfo ""
233
	einfo ""
211
	einfo "The wlan-ng.opts file in /etc/pcmcia/ is now depricated."
212
	einfo ""
213
	einfo "Modify /etc/conf.d/wlan.conf to set global parameters."
234
	einfo "Modify /etc/conf.d/wlan.conf to set global parameters."
214
	einfo "Modify /etc/conf.d/wlancfg-* to set individual card parameters."
235
	einfo "Modify /etc/conf.d/wlancfg-* to set individual card parameters."
215
	einfo "There are detailed instructions in these config files."
236
	einfo "There are detailed instructions in these config files."
Lines 223-233 Link Here
223
	ewarn "need to have the appropriate line removed from /etc/pcmcia/wlan-ng.conf"
244
	ewarn "need to have the appropriate line removed from /etc/pcmcia/wlan-ng.conf"
224
	ewarn "Do 'cardctl info' to see the manufacturer ID and remove the corresponding"
245
	ewarn "Do 'cardctl info' to see the manufacturer ID and remove the corresponding"
225
	ewarn "line from that file."
246
	ewarn "line from that file."
226
	ewarn ""
227
	ewarn "This ebuild will work with a 2.6.1(0) kernel, if you add the symlinks:"
228
	ewarn "ln -sf /usr/src/linux-2.6.1 /usr/src/linux"
229
	ewarn "ln -sf /usr/src/linux-2.6.1/arch/i386 /usr/src/linux-2.6.1/arch/x86"
230
	ewarn "and disable any userpriv or sandbox settings in make.conf."
231
	ewarn "Work is underway to upgrade portage for kernel 2.6 drivers."
232
}
247
}
233
248
249

Return to bug 32737