View | Details | Raw Unified
Collapse All | Expand All

(-) linux-wlan-ng-0.2.1_pre16.ebuild (-74 / +90 lines)
 Lines 1-15    Link Here 
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# Distributed under the terms of the GNU General Public License v2
# $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 $
# $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 $
inherit eutils
inherit eutils kernel-mod
IUSE="apm build nocardbus pcmcia pnp trusted usb"
IUSE="apm build nocardbus pcmcia pnp trusted usb"
PCMCIA_CS="pcmcia-cs-3.2.1"
PCMCIA_CS="pcmcia-cs-3.2.4"
PATCH_3_2_2="pcmcia-cs-3.2.1-3.2.2.diff.gz"
PATCH_3_2_5="pcmcia-cs-3.2.4-3.2.5.diff"
PATCH_3_2_3="pcmcia-cs-3.2.1-3.2.3.diff.gz"
PATCH_3_2_6="pcmcia-cs-3.2.4-3.2.6.diff"
PATCH_3_2_4="pcmcia-cs-3.2.1-3.2.4.diff.gz"
PATCH_3_2_7="pcmcia-cs-3.2.4-3.2.7.diff"
PCMCIA_DIR="${WORKDIR}/${PCMCIA_CS}"
PCMCIA_DIR="${WORKDIR}/${PCMCIA_CS}"
MY_P=${PN}-${PV/_/-}
MY_P=${PN}-${PV/_/-}
S=${WORKDIR}/${MY_P}
S=${WORKDIR}/${MY_P}
 Lines 17-64    Link Here 
DESCRIPTION="The linux-wlan Project"
DESCRIPTION="The linux-wlan Project"
SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${MY_P}.tar.gz
SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${MY_P}.tar.gz
		mirror://gentoo/${PN}-gentoo-init.gz
		mirror://gentoo/${PN}-gentoo-init.gz
		http://dev.gentoo.org/~latexer/files/patches/${PN}-koutput.diff
		pcmcia?	( mirror://sourceforge/pcmcia-cs/${PCMCIA_CS}.tar.gz )
		pcmcia?	( mirror://sourceforge/pcmcia-cs/${PCMCIA_CS}.tar.gz )
		pcmcia? ( mirror://gentoo/${PATCH_3_2_2} )
		pcmcia? ( mirror://gentoo/${PATCH_3_2_5}.gz )
		pcmcia? ( mirror://gentoo/${PATCH_3_2_3} )
		pcmcia? ( mirror://gentoo/${PATCH_3_2_6}.gz )
		pcmcia? ( mirror://gentoo/${PATCH_3_2_4} )"
		pcmcia? ( mirror://gentoo/${PATCH_3_2_7}.gz )"
HOMEPAGE="http://linux-wlan.org"
HOMEPAGE="http://linux-wlan.org"
DEPEND="sys-kernel/linux-headers
DEPEND="sys-kernel/linux-headers
		dev-libs/openssl
		dev-libs/openssl
		sys-apps/baselayout
		sys-apps/baselayout
		>=sys-apps/sed-4.0*
		pcmcia?	( sys-apps/pcmcia-cs )"
		pcmcia?	( sys-apps/pcmcia-cs )"
SLOT="0"
SLOT="0"
LICENSE="MPL-1.1"
LICENSE="MPL-1.1"
KEYWORDS="~x86 ~ppc"
KEYWORDS="~x86"
# check arch for configure
KERNEL_MOD_SOURCES="${MY_P}.tar.gz ${PN}-gentoo-init.gz"
if [ ${ARCH} = "x86" ] ; then
	MY_ARCH="i386"
else
	MY_ARCH="ppc"
fi
# Note: To use this ebuild, you should have the usr/src/linux symlink to
# the kernel directory that linux-wlan-ng should use for configuration.
#
# linux-wlan-ng requires a configured pcmcia-cs source tree.
# unpack/configure it in WORKDIR.  No need to compile it though.
src_unpack() {
src_unpack() {
	kernel-mod_src_unpack
	unpack ${MY_P}.tar.gz
	unpack ${PN}-gentoo-init.gz
	cp ${WORKDIR}/${PN}-gentoo-init ${S}/etc/rc.wlan
	cp ${WORKDIR}/${PN}-gentoo-init ${S}/etc/rc.wlan
	cd ${S}
	mkdir -p src/tmp
	epatch ${DISTDIR}/${PN}-koutput.diff
	if [ -n "`use pcmcia`" ]; then
	if [ -n "`use pcmcia`" ]; then
		unpack ${PCMCIA_CS}.tar.gz
		if egrep '^CONFIG_PCMCIA=[ym]' ${KV_OUTPUT}/.config >&/dev/null
		cd ${PCMCIA_DIR}
		then
		if [ -z "`has_version =sys-apps/pcmcia-cs-3.2.4*`" ]; then
			# Sadly, we still need to download these sources in SRC_URI
			epatch ${DISTDIR}/${PATCH_3_2_4}
			# til portage can handle more dynamic SRC_URIs
		elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.3*`" ]; then
			einfo "Kernel PCMCIA detected. Skipping external pcmcia-cs sources."
			epatch ${DISTDIR}/${PATCH_3_2_3}
		else
		elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.2*`" ]; then
			unpack ${PCMCIA_CS}.tar.gz
			epatch ${DISTDIR}/${PATCH_3_2_2}
			cd ${PCMCIA_DIR}
			if [ -z "`has_version =sys-apps/pcmcia-cs-3.2.4*`" ]; then
				epatch ${WORKDIR}/${PATCH_3_2_4}
			elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.3*`" ]; then
				epatch ${WORKDIR}/${PATCH_3_2_3}
			elif [ -z "`has_version =sys-apps/pcmcia-cs-3.2.2*`" ]; then
				epatch ${WORKDIR}/${PATCH_3_2_2}
			fi
		fi
		fi
	fi
	fi
 Lines 67-95    Link Here 
	# things to end up in the right place.
	# things to end up in the right place.
	cd ${S}
	cd ${S}
	mv man/Makefile man/Makefile.orig
	sed -i -e "s:mkdir:#mkdir:" \
	sed -e "s:mkdir:#mkdir:" \
		-e "s:cp nwepgen.man:#cp nwepgen.man:" \
		-e "s:cp nwepgen.man:#cp nwepgen.man:" \
		-e "s:\t\$(TARGET_:\t#\$(TARGET_:" \
		-e "s:\t\$(TARGET_:\t#\$(TARGET_:" \
		man/Makefile.orig > man/Makefile
		man/Makefile
	sed -i -e "s:/etc/wlan:/etc/conf.d:g" \
		etc/wlan/Makefile
	mv etc/wlan/Makefile etc/wlan/Makefile.orig
	sed -i -e "s:/sbin/nwepgen:/sbin/keygen:" \
	sed -e "s:/etc/wlan:/etc/conf.d:g" \
		etc/wlan/wlancfg-DEFAULT
		etc/wlan/Makefile.orig > etc/wlan/Makefile
	mv etc/wlan/wlancfg-DEFAULT etc/wlan/wlancfg-DEFAULT.orig
	sed -e "s:/sbin/nwepgen:/sbin/keygen:" \
		etc/wlan/wlancfg-DEFAULT.orig > etc/wlan/wlancfg-DEFAULT
	mv etc/wlan/shared etc/wlan/shared.orig
	sed -i -e "s:/etc/wlan/wlan.conf:/etc/conf.d/wlan.conf:g" \
	sed -e "s:/etc/wlan/wlan.conf:/etc/conf.d/wlan.conf:g" \
	    -e "s:/etc/wlan/wlancfg:/etc/conf.d/wlancfg:g" \
	    -e "s:/etc/wlan/wlancfg:/etc/conf.d/wlancfg:g" \
		etc/wlan/shared.orig > etc/wlan/shared
		etc/wlan/shared
}
}
src_compile() {
src_compile() {
	local kernelpcmcia
	#
	#
	# configure pcmcia-cs - we need this for wlan to compile
	# configure pcmcia-cs - we need this for wlan to compile
	# use same USE flags that the pcmcia-cs ebuild does.
	# use same USE flags that the pcmcia-cs ebuild does.
 Lines 98-106    Link Here 
	# the kernel tree.
	# the kernel tree.
	#
	#
	if [ -n "`use pcmcia`" ]; then
	if egrep '^CONFIG_PCMCIA=[ym]' ${KV_OUTPUT}/.config >&/dev/null; then
		kernelpcmcia="YES"
	else
		kernelpcmcia="NO"
	fi
	if [ -n "`use pcmcia`" -a "${kernelpcmcia}" != "YES" ]; then
		local myarch myconf
		# pcmcia-cs expects "i386" not "x86"
		case "${ARCH}" in
				x86) myarch="i386" ;;
				*) myarch="${ARCH}" ;;
		esac
		cd ${WORKDIR}/${PCMCIA_CS}
		cd ${WORKDIR}/${PCMCIA_CS}
		local myconf
		if [ -n "`use trusted`" ] ; then
		if [ -n "`use trusted`" ] ; then
			myconf="--trust"
			myconf="--trust"
		else
		else
 Lines 131-167    Link Here 
			--target=${D} \
			--target=${D} \
			--srctree \
			--srctree \
			--kernel=/usr/src/linux \
			--kernel=/usr/src/linux \
			--arch="${MY_ARCH}" \
			--arch="${myarch}" \
			--uflags="${CFLAGS}" \
			--uflags="${CFLAGS}" \
			--kflags="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer" \
			--kflags="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer" \
			$myconf || die "failed configuring pcmcia-cs"
			$myconf || die "failed configuring pcmcia-cs"
	fi
	fi
	# 2.5/2.6 kernels need ARCH unset
	if [ "${KV_MINOR}" -gt 4 ]
	then
		unset ARCH
	fi
	# now lets build wlan-ng
	# now lets build wlan-ng
	cd ${S}
	cd ${S}
	sed -e 's:TARGET_ROOT_ON_HOST=:TARGET_ROOT_ON_HOST=${D}:' \
	sed -i -e 's:TARGET_ROOT_ON_HOST=:TARGET_ROOT_ON_HOST=${D}:' \
		-e 's:PRISM2_PCI=n:PRISM2_PCI=y:' \
		-e 's:PRISM2_PCI=n:PRISM2_PCI=y:' \
		config.in > default.config
		config.in
	mv default.config config.in
	if [ -n "`use pcmcia`" ]; then
	if [ -n "`use pcmcia`" ]; then
		export PCMCIA_CS=${PCMCIA_CS}
		if [ "${kernelpcmcia}" != "YES" ];
		sed -e 's:PCMCIA_SRC=:PCMCIA_SRC=${WORKDIR}/${PCMCIA_CS}:' \
		then
			-e 's:PRISM2_PLX=n:PRISM2_PLX=y:' \
			export PCMCIA_CS=${PCMCIA_CS}
			config.in > default.config
			sed -i -e 's:PCMCIA_SRC=:PCMCIA_SRC=${WORKDIR}/${PCMCIA_CS}:' \
				config.in
		fi
		sed -i -e 's:PRISM2_PLX=n:PRISM2_PLX=y:' \
			config.in
	else
	else
		sed -e 's:PRISM2_PCMCIA=y:PRISM2_PCMCIA=n:' \
		sed -i -e 's:PRISM2_PCMCIA=y:PRISM2_PCMCIA=n:' \
		config.in > default.config
		config.in
	fi
	fi
	mv default.config config.in
	if [ -n "`use usb`" ]; then
	if [ -n "`use usb`" ]; then
		sed -e 's:PRISM2_USB=n:PRISM2_USB=y:' \
		sed -i -e 's:PRISM2_USB=n:PRISM2_USB=y:' \
			config.in > default.config
			config.in
		mv default.config config.in
	fi
	if [ "${KV_MINOR}" -gt "4" ]; then
		export KV_OUTPUT=${KV_OUTPUT}
		sed -i -e 's:^LINUX_OUTPUT=.*:LINUX_OUTPUT=${KV_OUTPUT}:' \
			config.in
	fi
	fi
	mv default.config config.in
	cp config.in default.config
	cp config.in default.config
	emake default_config || die "failed configuring WLAN"
	emake default_config || die "failed configuring WLAN"
 Lines 202-215    Link Here 
pkg_postinst() {
pkg_postinst() {
	depmod -a
	depmod -a
	einfo "Configuration of the WLAN package has changed since 0.1.16-pre4."
	einfo ""
	einfo "/etc/init.d/wlan is used to control startup and shutdown of non-PCMCIA devices."
	einfo "/etc/init.d/wlan is used to control startup and shutdown of non-PCMCIA devices."
	einfo "/etc/init.d/pcmcia from pcmcia-cs is used to control startup and shutdown of"
	einfo "/etc/init.d/pcmcia from pcmcia-cs is used to control startup and shutdown of"
	einfo "PCMCIA devices."
	einfo "PCMCIA devices."
	einfo ""
	einfo ""
	einfo "The wlan-ng.opts file in /etc/pcmcia/ is now depricated."
	einfo ""
	einfo "Modify /etc/conf.d/wlan.conf to set global parameters."
	einfo "Modify /etc/conf.d/wlan.conf to set global parameters."
	einfo "Modify /etc/conf.d/wlancfg-* to set individual card parameters."
	einfo "Modify /etc/conf.d/wlancfg-* to set individual card parameters."
	einfo "There are detailed instructions in these config files."
	einfo "There are detailed instructions in these config files."
 Lines 223-233    Link Here 
	ewarn "need to have the appropriate line removed from /etc/pcmcia/wlan-ng.conf"
	ewarn "need to have the appropriate line removed from /etc/pcmcia/wlan-ng.conf"
	ewarn "Do 'cardctl info' to see the manufacturer ID and remove the corresponding"
	ewarn "Do 'cardctl info' to see the manufacturer ID and remove the corresponding"
	ewarn "line from that file."
	ewarn "line from that file."
	ewarn ""
	ewarn "This ebuild will work with a 2.6.1(0) kernel, if you add the symlinks:"
	ewarn "ln -sf /usr/src/linux-2.6.1 /usr/src/linux"
	ewarn "ln -sf /usr/src/linux-2.6.1/arch/i386 /usr/src/linux-2.6.1/arch/x86"
	ewarn "and disable any userpriv or sandbox settings in make.conf."
	ewarn "Work is underway to upgrade portage for kernel 2.6 drivers."
}
}