diff options
author | Eric Hameleers <alien@slackware.com> | 2005-10-05 13:15:01 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2005-10-05 13:15:01 +0000 |
commit | c6955f5f310d185ed4c5374f2b9c03a5c1284a78 (patch) | |
tree | 40da474cb1065432a6105ca61f894f5dac56d1ff /madwifi/build | |
parent | 486af4f63088e7587bb6683723c8d513cb8158e8 (diff) | |
download | asb-c6955f5f310d185ed4c5374f2b9c03a5c1284a78.tar.gz asb-c6955f5f310d185ed4c5374f2b9c03a5c1284a78.tar.xz |
Initial revision
Diffstat (limited to 'madwifi/build')
-rwxr-xr-x | madwifi/build/madwifi.SlackBuild | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/madwifi/build/madwifi.SlackBuild b/madwifi/build/madwifi.SlackBuild new file mode 100755 index 00000000..825517b1 --- /dev/null +++ b/madwifi/build/madwifi.SlackBuild @@ -0,0 +1,107 @@ +#!/bin/sh +# $Id$ +# ---------------------------------------------------------------------------- +CWD=`pwd` +PRGNAM=madwifi +PKG=/tmp/package-$PRGNAM +TMP=/tmp/tmp-$PRGNAM + +rm -rf $TMP +rm -rf $PKG + +mkdir -p $TMP +mkdir -p $PKG + +KERNELARCH=i686 +KERNELVERSION=${KERNELVERSION:-`/bin/uname -r`} +KERNELSRC="/lib/modules/${KERNELVERSION}/build" +VERSION=20050707 +ARCH=i486 +BUILD=2 + +# --- PACKAGE BUILDING --- + +# Explode the package framework: +cd $TMP +if [ -f $CWD/_$PRGNAM.tar.gz ]; then + explodepkg $CWD/_$PRGNAM.tar.gz +fi + +echo "+=================+" +echo "| $PRGNAM-$VERSION |" +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. +# +# ... or get a snapshot at http://madwifi.otaku42.de/ + +echo "Extracting the source tarball..." +tar xzvf $CWD/$PRGNAM-$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} +make clean symlinks oldconfig dep +cd - + +cd $PRGNAM +# Build the kernel modules and the utilities + +# enable the SOFTLED with -DSOFTLED +export COPTS="$COPTS -DSOFTLED" +make clean all KERNELPATH=${KERNELSRC} KERNELRELEASE=${KERNELVERSION} +make -C tools + +# Install the kernel module +make install DESTDIR=$PKG KERNELPATH=${KERNELSRC} KERNELRELEASE=${KERNELVERSION} + +# ... and the utilities +mkdir -p $PKG/usr/bin +cd tools ; make install DESTDIR=$PKG BINDIR=/usr/bin ; cd .. + +# 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... +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYRIGHT INSTALL README 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 +chmod -R g-w,o-w $PKG/usr/doc/$PRGNAM-$VERSION + +# Compress the kernel modules +find $PKG/lib/modules -type f -exec gzip -9 {} \; + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh +# Substitute correct versions +perl -pi -e "s#\@\@KERNELVERS\@\@#${KERNELVERSION}#g" $PKG/install/slack-desc +perl -pi -e "s#\@\@KERNELVERS\@\@#${KERNELVERSION}#g" $PKG/install/doinst.sh + +cd $PKG +makepkg -l y -c n $TMP/$PRGNAM-${VERSION}_${KERNELVERSION}-$ARCH-$BUILD.tgz +(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 $CWD + +# Clean up the extra stuff: +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP + rm -rf $PKG +fi + + |