aboutsummaryrefslogtreecommitdiff
path: root/network/madwifi-driver/madwifi-driver.SlackBuild
blob: f7864c8f3269495079451e165f9173f83dcb8428 (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
60
61
62
63
#!/bin/sh

## Slackware build script for madwifi-driver

## Written by hollywoodb (hollywoodb@fastmail.fm)
## Maintained by Larry Hajali <larryhaja[at]gmail[dot]com> 9/25/09

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

PRGNAM=madwifi
VERSION=0.9.4
ARCH=${ARCH:-i486}
BUILD=${BUILD:-2}
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
# Patches to build madwifi on Slackware 13.0
# Patch from: http://bugs.gentoo.org/show_bug.cgi?id=262761
patch -p1 < $CWD/patches/madwifi-0.9.4_kernel_2.6.29.diff
# Patch from: http://madwifi-project.org/changeset/3986
patch -p1 < $CWD/patches/madwifi-0.9.4_kernel_2.6.30.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.${PKGTYPE:-tgz}