# vim: set syn=sh: # Packager: Phill Watkins pkgname=broadcom-sta pkgver=5.60.48.36 pkgrel=6pw.$(uname -r | tr - .) #arch=noarch source=\ ( "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v$pkgver.tar.gz" "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_64-v$pkgver.tar.gz" "http://www.broadcom.com/docs/linux_sta/sta_${pkgver}_2.6.33_kernel_patch.zip" "http://www.broadcom.com/docs/linux_sta/sta_${pkgver}_2.6.34_multicast_kernel_patch.zip" ) sourcetemplate=http://people.salixos.org/pwatk/packages/orphan/$pkgname docs=("README.txt" "LICENSE.txt") url=http://www.broadcom.com/support/802.11/linux_sta.php options=('noextract' 'noautodotnew') doinst() { if [ "$(uname -r)" = "$kernel" ]; then for mod in b43 ssb wl lib80211 ;do if [ "$(lsmod | grep "^$mod ")" ]; then modprobe -r $mod fi done depmod -a > /dev/null 2>&1 modprobe lib80211 modprobe wl fi } slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "broadcom-sta (Broadcom Linux hybrid wireless driver)" ) build() { set -e case $arch in i?86) srcarch=32 ; ARCH=i386 ;; x86_64) srcarch=64 ;; *) exit 1 ;; esac mkdir -p $startdir/src/$pkgname-$pkgver cd $startdir/src/$pkgname-$pkgver tar xvf $startdir/hybrid-portsrc-x86_$srcarch-v$pkgver.tar.gz chown -R root:root . chmod -R u+w,go+r-w,a-s . if [ "`uname -r | awk -F. '{print $3}'`" -ge 33 ]; then unzip \ -p $startdir/sta_${pkgver}_2.6.33_kernel_patch.zip \ -x how_to_install_patch.txt | patch -p0 --verbose if [ "`uname -r | awk -F. '{print $3}'`" -ge 34 ]; then unzip \ -p $startdir/sta_${pkgver}_2.6.34_multicast_kernel_patch.zip \ -x how_to_install_multicast.txt | patch -p0 --verbose fi fi make install -Dm 0755 wl.ko $startdir/pkg/lib/modules/`uname -r`/kernel/drivers/net/wireless/wl.ko mkdir -p $startdir/pkg/install echo -e "kernel=$(uname -r)\n" > $startdir/pkg/install/doinst.sh install -d $startdir/pkg/etc/rc.d/desc.d cat <<- EOF > $startdir/pkg/etc/rc.d/desc.d/broadcom-sta.txt broadcom-sta:The Broadcom Linux hybrid wireless driver:null EOF chmod 644 $startdir/pkg/etc/rc.d/desc.d/broadcom-sta.txt cat <<- EOF > $startdir/pkg/etc/rc.d/rc.broadcom-sta #!/bin/sh for mod in b43 ssb ;do if [ "\$(lsmod | grep "^\$mod ")" ]; then /sbin/modprobe -r \$mod fi done if [ -f /etc/rc.d/rc.b43 ]; then chmod 644 /etc/rc.d/rc.b43 fi start() { echo "Loading Broadcom Linux hybrid wireless driver: /sbin/modprobe wl" if [ ! -f \$(find /lib/modules/\$(uname -r) -name wl.ko) ]; then echo "\$(basename \$0): 'wl' module not found" exit 1 fi if [ ! "\$(lsmod | grep "^wl ")" ]; then /sbin/modprobe lib80211 /sbin/modprobe wl fi } stop() { echo "Unloading Broadcom Linux hybrid wireless driver: /sbin/modprobe -r wl" if [ "\$(lsmod | grep "^wl ")" ]; then /sbin/modprobe -r wl /sbin/modprobe -r lib80211 fi } restart() { stop sleep 2 start } status() { if [ "\$(lsmod | grep "^wl ")" ]; then echo "\$(basename \$0): 'wl' module loaded" else echo "\$(basename \$0): 'wl' module not loaded" fi } case "\$1" in start) start ;; stop) stop ;; restart) restart ;; status) status ;; *) echo "Usage: \$0 {start|stop|restart|status}" ;; esac exit 0 EOF chmod 755 $startdir/pkg/etc/rc.d/rc.broadcom-sta set +e }