summaryrefslogtreecommitdiff
path: root/network/madwifi-driver/madwifi-driver.SlackBuild
blob: 3e41964c967cd34b13543d217b5e6f3da32b9e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

## Slackware build script for madwifi-driver

## Written by hollywoodb (hollywoodb@fastmail.fm)
## Maintained by Robby Workman <rworkman@slackbuilds.org>
## Modified by Larry Hajali <larryhaja[at]gmail[dot]com>

KERNELVERSION=${KERNELVERSION:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/${KERNELVERSION}/build}

PRGNAM=madwifi
VERSION=0.9.4
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

PKG_NAME=madwifi-driver
PKG_VERSION=$(echo ${VERSION}_$KERNELVERSION | tr '-' '_')

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=${PKG:-$TMP/package-$PKG_NAME}
OUTPUT=${OUTPUT:-/tmp}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Patches to build madwifi against Slacware 12.2 kernel
# Patch from: http://madwifi-project.org/changeset/3696
patch -p1 < $CWD/patches/madwifi-0.9.4_kernel_2.6.26.diff
# Patch from: http://slackware.com/~alien/slackbuilds/madwifi/build/
patch -p1 < $CWD/patches/madwifi-0.9.4_kernel_2.6.27.diff

KERNELPATH=$KERNELPATH KERNELRELEASE=$KERNELVERSION \
  make modules
KERNELPATH=$KERNELPATH KERNELRELEASE=$KERNELVERSION \
  make install-modules DESTDIR=$PKG

mkdir -p $PKG/usr/doc/$PKG_NAME-$PKG_VERSION
cp -a COPYRIGHT $PKG/usr/doc/$PKG_NAME-$PKG_VERSION
cp -a hal/COPYRIGHT $PKG/usr/doc/$PKG_NAME-$PKG_VERSION/COPYRIGHT.hal
cp -a hal/README $PKG/usr/doc/$PKG_NAME-$PKG_VERSION/README.hal
cat $CWD/$PKG_NAME.SlackBuild > $PKG/usr/doc/$PKG_NAME-$PKG_VERSION/$PKG_NAME.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
sed s/_KERNEL_/$KERNELVERSION/ $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD$TAG.tgz