| 1 |
# Copyright 1999-2006 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-wireless/linux-wlan-ng/linux-wlan-ng-0.2.3-r2.ebuild,v 1.2 2006/10/08 18:39:33 betelgeuse Exp $
|
| 4 |
|
| 5 |
#The configure script needs prepared sources.
|
| 6 |
inherit linux-mod
|
| 7 |
|
| 8 |
DESCRIPTION="Programs/files needed for Prism2/2.5/3 based USB wireless LAN products"
|
| 9 |
HOMEPAGE="http://linux-wlan.org"
|
| 10 |
SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${P}.tar.bz2"
|
| 11 |
|
| 12 |
# includes dual licensed files but also stuff only under MPL-1.1
|
| 13 |
LICENSE="|| ( GPL-2 MPL-1.1 ) MPL-1.1"
|
| 14 |
SLOT="0"
|
| 15 |
KEYWORDS="~amd64 ~ppc ~x86"
|
| 16 |
|
| 17 |
IUSE="debug doc"
|
| 18 |
|
| 19 |
DEPEND="net-wireless/linux-wlan-ng-modules
|
| 20 |
~net-wireless/linux-wlan-ng-utils-0.2.2
|
| 21 |
~net-wireless/linux-wlan-ng-firmware-0.2.2"
|
| 22 |
|
| 23 |
RDEPEND=${DEPEND}
|
| 24 |
|
| 25 |
#relative to src/
|
| 26 |
COMPILE_DIRS="mkmeta wlanctl wland nwepgen wlancfg prism2/download"
|
| 27 |
INSTALL_DIRS="${COMPILE_DIRS} ../etc"
|
| 28 |
|
| 29 |
CONFIG_FILE="${S}/default.config"
|
| 30 |
CONFIG_DIR="/etc/conf.d"
|
| 31 |
|
| 32 |
config_by_usevar() {
|
| 33 |
local config=${3}
|
| 34 |
[[ -z ${config} ]] && config=${CONFIG_FILE}
|
| 35 |
|
| 36 |
if use ${2}; then
|
| 37 |
echo "${1}=y" >> ${config}
|
| 38 |
else
|
| 39 |
echo "${1}=n" >> ${config}
|
| 40 |
fi
|
| 41 |
}
|
| 42 |
|
| 43 |
set_option() {
|
| 44 |
local config=${3}
|
| 45 |
[[ -z ${config} ]] && config=${CONFIG_FILE}
|
| 46 |
|
| 47 |
echo "${1}=${2}" >> ${config}
|
| 48 |
}
|
| 49 |
|
| 50 |
src_unpack() {
|
| 51 |
local config=${CONFIG_FILE}
|
| 52 |
|
| 53 |
unpack ${A}
|
| 54 |
|
| 55 |
cd "${S}"
|
| 56 |
epatch "${FILESDIR}/${P}-shared.patch"
|
| 57 |
|
| 58 |
rm ${S}/doc/rh71notes
|
| 59 |
|
| 60 |
cd ${S}/etc
|
| 61 |
mv rc.wlan rc.wlan.orig
|
| 62 |
cp ${FILESDIR}/${PN}-gentoo-init rc.wlan
|
| 63 |
|
| 64 |
#IMHO this should not be done but better to not upset users at this point
|
| 65 |
sed -i -e "s:/etc/wlan:/etc/conf.d:g" ${S}/etc/wlan/Makefile
|
| 66 |
sed -i -e "s:/etc/wlan/wlan.conf:/etc/conf.d/wlan.conf:g" \
|
| 67 |
-e "s:/etc/wlan/wlancfg:/etc/conf.d/wlancfg:g" \
|
| 68 |
${S}/etc/wlan/shared
|
| 69 |
|
| 70 |
cp ${S}/config.in ${config}
|
| 71 |
|
| 72 |
set_option TARGET_ROOT_ON_HOST ${D}
|
| 73 |
set_option LINUX_SRC ${KERNEL_DIR}
|
| 74 |
set_option PRISM2_USB n
|
| 75 |
set_option PRISM2_PCI n
|
| 76 |
set_option PRISM2_PLX n
|
| 77 |
set_option PRISM2_PCMCIA n
|
| 78 |
|
| 79 |
if kernel_is gt 2 4; then
|
| 80 |
set_option KERN_25 y
|
| 81 |
fi
|
| 82 |
|
| 83 |
config_by_usevar WLAN_DEBUG debug
|
| 84 |
}
|
| 85 |
|
| 86 |
src_compile() {
|
| 87 |
set_arch_to_kernel
|
| 88 |
emake default_config || die "emake default_config failed"
|
| 89 |
set_arch_to_portage
|
| 90 |
|
| 91 |
CONFIG_FILE="config.mk"
|
| 92 |
|
| 93 |
set_option FIRMWARE_DIR "/lib/firmware"
|
| 94 |
set_option PRISM2_PCMCIA n
|
| 95 |
|
| 96 |
#For the scripts that go to /etc
|
| 97 |
set_option TARGET_PCMCIA_DIR ${D}/etc/pcmcia
|
| 98 |
|
| 99 |
cd ${S}/src/
|
| 100 |
for dir in ${COMPILE_DIRS}; do
|
| 101 |
pushd ${dir}
|
| 102 |
make || die "make in ${dir} failed"
|
| 103 |
popd
|
| 104 |
done
|
| 105 |
}
|
| 106 |
|
| 107 |
src_install() {
|
| 108 |
cd ${S}/man
|
| 109 |
doman *.1
|
| 110 |
|
| 111 |
# Does not install hotplug rules if /etc/hotplug
|
| 112 |
# does not exist in ${D}
|
| 113 |
# Needs to be patch because expects stuff to be in /etc/wlan
|
| 114 |
# dodir /etc/hotplug
|
| 115 |
|
| 116 |
for dir in ${INSTALL_DIRS}; do
|
| 117 |
pushd ${S}/src/${dir}
|
| 118 |
make install || die "make install in ${dir} failed"
|
| 119 |
popd
|
| 120 |
done
|
| 121 |
|
| 122 |
cd ${S}
|
| 123 |
|
| 124 |
dodir etc/wlan
|
| 125 |
mv ${D}/etc/conf.d/shared ${D}/etc/wlan/
|
| 126 |
|
| 127 |
if use doc; then
|
| 128 |
insinto /usr/share/doc/${PF}/
|
| 129 |
pushd ${S}/doc
|
| 130 |
for file in $(ls); do
|
| 131 |
[[ "${file}" != "Makefile" ]] && doins -r ${file}
|
| 132 |
done
|
| 133 |
popd
|
| 134 |
fi
|
| 135 |
|
| 136 |
dodoc CHANGES FAQ README THANKS TODO
|
| 137 |
}
|
| 138 |
|
| 139 |
pkg_postinst() {
|
| 140 |
einfo "/etc/init.d/wlan is used to control startup and shutdown of the"
|
| 141 |
einfo "driver."
|
| 142 |
einfo ""
|
| 143 |
einfo "Modify ${CONFIG_DIR}/wlan.conf to set global parameters."
|
| 144 |
einfo "Modify ${CONFIG_DIR}/wlancfg-* to set individual card parameters."
|
| 145 |
einfo "There are detailed instructions in these config files."
|
| 146 |
einfo ""
|
| 147 |
einfo "Three keygen programs are included: nwepgen, keygen, and lwepgen."
|
| 148 |
einfo "keygen seems provide more usable keys at the moment."
|
| 149 |
einfo "You can change the keygen in your wlancfg-* files."
|
| 150 |
einfo ""
|
| 151 |
einfo "Be sure to add iface_wlan0 parameters to /etc/conf.d/net."
|
| 152 |
einfo ""
|
| 153 |
einfo ""
|
| 154 |
einfo "Support for pci, plx and pcmcia drivers has been removed in"
|
| 155 |
einfo "revision. For pci, plx and pcmcia drivers try for example"
|
| 156 |
einfo "the hostap-driver or orinoco drivers. They both work with the"
|
| 157 |
einfo "standard wireless tools."
|
| 158 |
einfo ""
|
| 159 |
einfo "If they do not work, please report this to betelgeuse@gentoo.org."
|
| 160 |
}
|