summaryrefslogtreecommitdiffstats
path: root/madwifi
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2006-01-30 14:41:06 +0000
committer Eric Hameleers <alien@slackware.com>2006-01-30 14:41:06 +0000
commitb1d6901432779448f5919873539f601761fbf0c6 (patch)
tree1eb5c02336aa2abe8153cd6ddbc8ceee8be00d2a /madwifi
parenta34d8b7209cca068b8702d8f158ed329a5c6021e (diff)
downloadasb-b1d6901432779448f5919873539f601761fbf0c6.tar.gz
asb-b1d6901432779448f5919873539f601761fbf0c6.tar.xz
Re-did a considerable part of the SlackBuild for the madwifi-ng code.
Diffstat (limited to 'madwifi')
-rwxr-xr-xmadwifi/build/madwifi.SlackBuild125
1 files changed, 87 insertions, 38 deletions
diff --git a/madwifi/build/madwifi.SlackBuild b/madwifi/build/madwifi.SlackBuild
index e32df1e4..57bbb94e 100755
--- a/madwifi/build/madwifi.SlackBuild
+++ b/madwifi/build/madwifi.SlackBuild
@@ -1,5 +1,21 @@
#!/bin/sh
# $Id$
+# Copyright (c) 2006 Eric Hameleers <alien@slackware.com>
+# Distributed under the terms of the GNU General Public License, Version 2
+#
+# -----------------------------------------------------------------------------
+#
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# For: madwifi
+# URL: http://madwifi.org/
+# Description: driver for atheros-based wireless a/b/g cards.
+# Needs:
+# Changelog:
+# 20060126-1: 30/jan/2006 by Eric Hameleers <alien@slackware.com>
+# * First build of the madwifi-ng code.
+
# ----------------------------------------------------------------------------
CWD=`pwd`
PRGNAM=madwifi
@@ -12,12 +28,12 @@ rm -rf $PKG
mkdir -p $TMP
mkdir -p $PKG
-KERNELARCH=i686
-KERNELVERSION=${KERNELVERSION:-`/bin/uname -r`}
-KERNELSRC="/lib/modules/${KERNELVERSION}/build"
-VERSION=20051014
-ARCH=i486
+VERSION=20060126
BUILD=1
+ARCH=${ARCH:-i486}
+KVER=${KVER:-`uname -r`}
+KSRC=${KSRC:-/lib/modules/${KVER}/build}
+PATCHLEVEL=`echo $KVER|cut -f 2 -d '.'`
# --- PACKAGE BUILDING ---
@@ -33,81 +49,114 @@ echo "+=================+"
cd $TMP/
-# Actually you must get the sources from CVS:
-# (first command only when this is an update from CVS):
-# cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi up -dP
-# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi
-# Then pack the source tree into madwifi-yyyymmdd.tar.gz for use in this build.
+# Actually you must get the sources from SVN:
+# $ svn checkout http://svn.madwifi.org/trunk madwifi-ng
+# The above command stores the source in a subdirectory called madwifi-ng.
+# To update to the current version of the source at a later time you just need
+# to change to that subdirectory and type:
+# $ svn update
+# Then pack the source tree into madwifi-ng-yyyymmdd.tar.gz for use in this build.
#
-# ... or get a snapshot at http://madwifi.otaku42.de/
+# ... or get a snapshot at http://snapshots.madwifi.org/
echo "Extracting the source tarball..."
-tar xzvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xzvf $CWD/${PRGNAM}-ng*$VERSION.tar.gz
# I expect a pristine kernel source (freshly installed slackware package)
# Madwifi expects the sources at the location that the link
# "/lib/modules/<kernelversion>/build" points to.... so be it.
-cd ${KERNELSRC}
+cd ${KSRC}
make clean oldconfig dep
cd -
-cd $PRGNAM
-# The wpa_supplicant/madwifi/dhcp problem patch:
-# is now incorporated into the wpa_supplicant CVS!
-#patch -p0 < $CWD/ieee80211_wireless.c.patch 2>&1 | tee $CWD/patch-${PRGNAM}.log
+cd ${PRGNAM}-ng*${VERSION}
+chown -R root:root *
# Build the kernel modules and the utilities
# enable the SOFTLED with -DSOFTLED
-export COPTS="$COPTS -DSOFTLED"
+#export COPTS="$COPTS -DSOFTLED"
# If you need another rate control module than ath_rate_sample (the default),
# you'll need to set the ATH_RATE variable before starting make. For instance,
# (read the INSTALL file why you could want this) to build ath_rate_amrr, set:
# export ATH_RATE=ath_rate/amrr
-make clean all KERNELPATH=${KERNELSRC} KERNELRELEASE=${KERNELVERSION} \
+make clean all KERNELPATH=${KSRC} KERNELRELEASE=${KVER} \
2>&1 | tee $CWD/make-${PRGNAM}.log
make -C tools \
2>&1 | tee -a $CWD/make-${PRGNAM}.log
-# Install the kernel module
-make install DESTDIR=$PKG KERNELPATH=${KERNELSRC} KERNELRELEASE=${KERNELVERSION} \
+# Install the kernel module and tools
+mkdir -p $PKG/usr/{bin,man}
+make install DESTDIR=$PKG \
+ BINDIR=/usr/bin MANDIR=/usr/man KERNELPATH=${KSRC} KERNELRELEASE=${KVER} \
2>&1 | tee $CWD/install-${PRGNAM}.log
-# ... and the utilities
-mkdir -p $PKG/usr/bin
-( cd tools
- make install DESTDIR=$PKG BINDIR=/usr/bin
-) 2>&1 | tee -a $CWD/install-${PRGNAM}.log
-
# Include files (for wpa_supplicant):
mkdir -p $PKG/usr/include/madwifi
for i in include net80211; do
find $i -type f -name "*.h" -exec cp -a --parent {} $PKG/usr/include/madwifi \;
done
-# Documentation...
+# Documentation
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a COPYRIGHT INSTALL README TODO $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYRIGHT INSTALL README SNAPSHOT THANKS TODO $PKG/usr/doc/$PRGNAM-$VERSION
cp -a hal/COPYRIGHT $PKG/usr/doc/$PRGNAM-$VERSION/COPYRIGHT.hal
cp -a hal/README $PKG/usr/doc/$PRGNAM-$VERSION/README.hal
cp -a patches/README $PKG/usr/doc/$PRGNAM-$VERSION/README.patches
+cp -a docs/WEP-HOWTO.txt docs/users-guide.pdf $PKG/usr/doc/$PRGNAM-$VERSION/
+cp -a scripts $PKG/usr/doc/$PRGNAM-$VERSION/
chmod -R g-w,o-w $PKG/usr/doc/$PRGNAM-$VERSION
# Compress the kernel modules
-find $PKG/lib/modules -type f -exec gzip -9 {} \;
+[ $PATCHLEVEL -eq 4 ] && find $PKG/lib/modules -type f -exec gzip -9 {} \;
+# Add the slack-desc and doinst.sh files
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
-# Substitute correct versions
-sed -i -e "s#\@\@KERNELVERS\@\@#${KERNELVERSION}#g" $PKG/install/slack-desc
-sed -i -e "s#\@\@KERNELVERS\@\@#${KERNELVERSION}#g" $PKG/install/doinst.sh
-
+# Substitute correct kernel versions
+sed -i -e "s#\@\@KERNELVERS\@\@#${KVER}#g" $PKG/install/slack-desc
+# Write a doinst.sh
+[ $PATCHLEVEL -eq 4 ] && MODCONFFILE=modules.conf || MODCONFFILE=modprobe.conf
+cat <<-EEOOTT > $PKG/install/doinst.sh
+ # Only run depmod on matching running kernel
+ # Slackware will run depmod anyway on reboot):
+ MYMODVER=$KVER
+ MYKERNEL=\`uname -r\`
+
+ if [ "\$MYKERNEL" = "\$MYMODVER" ]; then
+ if [ -x sbin/depmod ]; then
+ chroot . /sbin/depmod -a \$MYKERNEL 1> /dev/null 2> /dev/null
+ fi
+ fi
+
+ # Add the wlanconfig lines to modprobe/modules.conf
+ if ! grep wlanconfig etc/$MODCONFFILE >/dev/null ; then
+ cat <<EOT >> etc/$MODCONFFILE
+ # Added for madwifi-ng
+ alias wifi0 ath_pci
+ install ath0 /sbin/modprobe ath_pci; wlanconfig ath0 create wlandev wifi0 wlanmode sta
+ remove ath0 wlanconfig ath0 destroy; /sbin/modprobe -r ath_pci
+ # End addition for madwifi-ng
+ EOT
+ fi
+ EEOOTT
+
+# Strip binaries
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Permissions
+chown root:bin $PKG/usr/bin/*
+chmod -R o-w $PKG
+
+# Create the package
cd $PKG
-makepkg -l y -c n $TMP/$PRGNAM-${VERSION}_${KERNELVERSION}-$ARCH-$BUILD.tgz \
+makepkg -l y -c n $TMP/$PRGNAM-${VERSION}_${KVER}-$ARCH-$BUILD.tgz \
2>&1 | tee $CWD/makepkg-${PRGNAM}.log
-(cd $TMP && md5sum $PRGNAM-${VERSION}_${KERNELVERSION}-$ARCH-$BUILD.tgz > $PRGNAM-${VERSION}_${KERNELVERSION}-$ARCH-$BUILD.tgz.md5)
-cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $TMP/$PRGNAM-${VERSION}_${KERNELVERSION}-$ARCH-$BUILD.txt
+(cd $TMP && md5sum $PRGNAM-${VERSION}_${KVER}-$ARCH-$BUILD.tgz > $PRGNAM-${VERSION}_${KVER}-$ARCH-$BUILD.tgz.md5)
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $TMP/$PRGNAM-${VERSION}_${KVER}-$ARCH-$BUILD.txt
cd $CWD