summaryrefslogtreecommitdiffstats
path: root/rt2500/build/rt2500.SlackBuild
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2006-01-17 14:29:43 +0000
committer Eric Hameleers <alien@slackware.com>2006-01-17 14:29:43 +0000
commit2b10557eb92c8b3ba282d3e50ea9ed311592077b (patch)
tree84cde657e462eeaa73d433eb68cae0e7cdc5b630 /rt2500/build/rt2500.SlackBuild
parent84cd90a29f79b4e993c8bf7564a06428a4aaa42f (diff)
downloadasb-2b10557eb92c8b3ba282d3e50ea9ed311592077b.tar.gz
asb-2b10557eb92c8b3ba282d3e50ea9ed311592077b.tar.xz
Re-vamped script for a new rt2500 beta.
Diffstat (limited to 'rt2500/build/rt2500.SlackBuild')
-rwxr-xr-xrt2500/build/rt2500.SlackBuild114
1 files changed, 92 insertions, 22 deletions
diff --git a/rt2500/build/rt2500.SlackBuild b/rt2500/build/rt2500.SlackBuild
index 11e4e805..9c531d3a 100755
--- a/rt2500/build/rt2500.SlackBuild
+++ b/rt2500/build/rt2500.SlackBuild
@@ -1,4 +1,6 @@
#!/bin/sh
+# Copyright (c) 2006 Eric Hameleers <alien@slackware.com>
+# Distributed under the terms of the GNU General Public License, Version 2
# $Id$
# -----------------------------------------------------------------------------
#
@@ -6,6 +8,7 @@
# ===========================
# By: Eric Hameleers <alien@sox.homeip.net>
# For: rt2500
+# Descr: driver for RaLink based wireless cards
# URL: http://rt2x00.sourceforge.net/
# Needs:
# Changelog:
@@ -17,6 +20,10 @@
# * Updated CVS snapshot.
# 20050726-1: 26/jul/2005 by Eric Hameleers <alien@sox.homeip.net>
# * Updated CVS snapshot.
+# 1.1.0.b3-1: 17/jan/2006 by Eric Hameleers <alien@slackware.com>
+# * Decided to build a more recent beta of rt2500, because
+# the waiting for WPA support in the new rt2x00 driver
+# takes so long.
#
# Run 'sh SlackBuild --cleanup' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -32,32 +39,85 @@ if [ "$TMP" = "" ]; then
fi
PRGNAM=rt2500
-VERSION=20050726
+VERSION=1.1.0.b3
+SRCVER=1.1.0-b3
ARCH=${ARCH:-i486}
BUILD=1
-KVER=${KVER:-`/usr/bin/uname -r`}
-KSRC=${KSRC:-/usr/src/linux-${KVER}}
+KVER=${KVER:-`uname -r`}
+KSRC=${KSRC:-/lib/modules/${KVER}/build}
PATCHLEVEL=`echo $KVER | cut -d. -f2`
-if [ "$ARCH" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
-elif [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
-elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2"
-fi
+PREDOC="cp -a ./Module/README README.module"
+DOCS="CHANGELOG FAQ LICENSE THANKS ./Module/iwpriv_usage.txt README.module"
+
+# If you have more source files, list them here as SOURCE[1], SOURCE[2], etc.
+# If you know the URL for a source file, you can put that into the SRCURL[]
+# variable, and the SlackBuild script will try to download it for you.
+
+SOURCE[0]="${PRGNAM}-${SRCVER}.tar.gz"
+SRCURL[0]="http://ovh.dl.sourceforge.net/sourceforge/rt2400/${PRGNAM}-${SRCVER}.tar.gz"
+
+##
+## --- with a little luck, you won't have to edit below this point --- ##
+##
+
+case "$ARCH" in
+ i386) SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+ i486) SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+ s390) SLKCFLAGS="-O2"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+ powerpc) SLKCFLAGS="-O2"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+ x86_64) SLKCFLAGS="-O2 -fPIC"
+ SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
+ ;;
+ athlon-xp) SLKCFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+esac
+
PKG=$TMP/package-$PRGNAM
if [ ! -d $TMP/tmp-$PRGNAM ]; then
mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+elif [ "$1" != "--oldbuild" ]; then
+ # If the "--oldbuild" parameter is present, we keep
+ # the old build files and continue;
+ # By default we remove the remnants of previous build and continue:
+ rm -rf $TMP/tmp-$PRGNAM/*
fi
-if [ ! -d $PKG ]; then
- mkdir -p $PKG # place for the package to be built
+
+
+# --- SOURCE FILE AVAILABILITY ---
+
+for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
+ if ! [ -f ${CWD}/${SOURCE[$i]} ]; then
+ if ! [ "${SRCURL[$i]}" = "" ]; then
+ echo "Source '${SOURCE[$i]}' not available yet... will download now:"
+ wget -nv -O "${CWD}/${SOURCE[$i]}" "${SRCURL[$i]}"
+ if [ $? -ne 0 ]; then
+ echo "Downloading '${SOURCE[$i]}' failed... aborting the build."
+ exit 1
+ fi
+ else
+ echo "File '${SOURCE[$i]}' not available... aborting the build."
+ exit 1
+ fi
+ fi
+done
+
+if [ "$1" == "--download" ]; then
+ echo "Download complete."
+ exit 0
fi
@@ -67,7 +127,11 @@ echo "++"
echo "|| $PRGNAM-$VERSION"
echo "++"
-rm -rf $PKG/*
+if [ ! -d $PKG ]; then
+ mkdir -p $PKG # place for the package to be built
+else
+ rm -rf $PKG/*
+fi
cd $PKG
@@ -81,11 +145,18 @@ cd $TMP/tmp-$PRGNAM
# --- TARBALL EXTRACTION,PATCH,MODIFY ---
-echo "Extracting the program tarball for $PRGNAM..."
-tar -xzvf $CWD/${PRGNAM}-${VERSION}.tar.gz
-
+echo "Extracting the source archive(s) for $PRGNAM..."
+for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
+ if `file $CWD/${SOURCE[$i]} | grep -q ": bzip2"`; then
+ tar -xjvf $CWD/${SOURCE[$i]}
+ elif `file $CWD/${SOURCE[$i]} | grep -qi ": zip"`; then
+ unzip $CWD/${SOURCE[$i]}
+ else
+ tar -xzvf $CWD/${SOURCE[$i]}
+ fi
+done
+mv ${PRGNAM}-${SRCVER} ${PRGNAM}-${VERSION}
cd ${PRGNAM}-${VERSION}
-
chown -R root.root *
@@ -136,15 +207,14 @@ cat <<-EEOOTT > $PKG/install/doinst.sh
# --- DOCUMENTATION ---
-DOCS="CHANGELOG FAQ LICENSE THANKS ./Module/iwpriv_usage.txt ./Module/README"
-
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+$PREDOC
cp -a $DOCS \
$PKG/usr/doc/$PRGNAM-$VERSION
chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
# Compress the man page(s)
-gzip -9f $PKG/usr/man/*/*
+find $PKG/usr/man -type f -exec gzip -9f {} \;
# Strip binaries
( cd $PKG