summaryrefslogtreecommitdiffstats
path: root/rt61
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2007-09-01 20:30:04 +0000
committer Eric Hameleers <alien@slackware.com>2007-09-01 20:30:04 +0000
commit2c5cbb9069045be15c3c2dd6b1422a7dfa3fa289 (patch)
tree9028a7835c71c93f085c30037c584f730300db51 /rt61
parentf5caa3b77fcbbc1e6b0ab654894d81c1102be55c (diff)
downloadasb-2c5cbb9069045be15c3c2dd6b1422a7dfa3fa289.tar.gz
asb-2c5cbb9069045be15c3c2dd6b1422a7dfa3fa289.tar.xz
Update
Diffstat (limited to 'rt61')
-rwxr-xr-xrt61/build/rt61.SlackBuild131
1 files changed, 50 insertions, 81 deletions
diff --git a/rt61/build/rt61.SlackBuild b/rt61/build/rt61.SlackBuild
index d58b2abc..dbce35ce 100755
--- a/rt61/build/rt61.SlackBuild
+++ b/rt61/build/rt61.SlackBuild
@@ -1,18 +1,39 @@
#!/bin/sh
# $Id$
# Copyright (c) 2007 Eric Hameleers <alien@slackware.com>
+# All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software for
+# any purpose with or without fee is hereby granted, provided that
+# the above copyright notice and this permission notice appear in all
+# copies.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# Slackware SlackBuild script
# ===========================
# By: Eric Hameleers <alien@slackware.com>
# For: rt61
-# Descr: Wireless driver for RaLink rt61 cards
+# Descr: Driver for RaLink rt61 wireless cards
# URL: http://rt2x00.serialmonkey.com
# Needs:
# Changelog:
# 20070108-1: 08/Jan/2007 by Eric Hameleers <alien@slackware.com>
# * Initial build.
+# 20070901-1: 01/Sep/2007 by Eric Hameleers <alien@slackware.com>
+# * Much needed upgrade.
#
# Run 'sh rt61.SlackBuild --cleanup' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -20,16 +41,15 @@
#
# -----------------------------------------------------------------------------
-# --- INIT ---
# Set initial variables:
PRGNAM=rt61
-VERSION=${VERSION:-20070108}
+VERSION=${VERSION:-20070901}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
-DOCS="BIG_FAT_WARNING CHANGELOG FAQ LICENSE TESTING THANKS \
- Module/README Module/ReleaseNote Module/STA_iwpriv_ATE_usage.txt Module/iwpriv_usage.txt"
+DOCS="BIG_FAT_WARNING CHANGELOG FAQ LICENSE TESTING THANKS Module/README \
+ Module/ReleaseNote Module/STA_iwpriv_ATE_usage.txt Module/iwpriv_usage.txt"
# Where do we look for sources?
CWD=`pwd`
@@ -41,13 +61,12 @@ TMP=${TMP:-/tmp/build}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-# Kernel module related parameters
+# Kernel module related parameters:
KVER=${KVER:-`uname -r`}
KSRC=${KSRC:-/lib/modules/${KVER}/build}
PATCHLEVEL=`echo $KVER|cut -f 2 -d '.'`
[ $PATCHLEVEL -eq 4 ] && MODCONFFILE=modules.conf || MODCONFFILE=modprobe.conf
-# Input URL: http://rt2x00.serialmonkey.com/rt61-cvs-daily.tar.gz
SOURCE="$SRCDIR/${PRGNAM}-cvs-daily.tar.gz"
SRCURL="http://rt2x00.serialmonkey.com/${PRGNAM}-cvs-daily.tar.gz"
@@ -90,36 +109,22 @@ case "$ARCH" in
;;
esac
-if [ ! -d $TMP/tmp-$PRGNAM ]; then
- mkdir -p $TMP/tmp-$PRGNAM # location to build the source
-elif [ "$P1" != "--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
-else
- rm -rf $PKG/* # We always erase old package's contents:
-fi
-
-if [ ! -d $OUTPUT ]; then
- mkdir -p $OUTPUT # place for the package to be saved
-fi
-
-
-# --- SOURCE FILE AVAILABILITY ---
+# Create working directories:
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+rm -rf $TMP/tmp-$PRGNAM/* # By default we remove the remnants of previous build
+mkdir -p $PKG # Place for the package to be built
+rm -rf $PKG/* # We always erase old package's contents:
+mkdir -p $OUTPUT # Place for the package to be saved
+# Source file availability:
if ! [ -f ${SOURCE} ]; then
if ! [ "x${SRCURL}" == "x" ]; then
# Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
[ -w "$SRCDIR" ] || SOURCE="$OUTPUT/`basename $SOURCE`"
echo "Source '`basename ${SOURCE}`' not available yet..."
echo "Will download file to `dirname $SOURCE`"
- wget -nv -O "${SOURCE}" "${SRCURL}" || true
- if [ $? -ne 0 ]; then
+ wget -nv --connect-timeout=30 -O "${SOURCE}" "${SRCURL}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
echo "Downloading '`basename ${SOURCE}`' failed... aborting the build."
mv -f "${SOURCE}" "${SOURCE}".FAIL
exit 1
@@ -141,22 +146,11 @@ echo "++"
echo "|| $PRGNAM-$VERSION"
echo "++"
-cd $PKG
-
-# Explode the package framework:
-if [ -f $SRCDIR/_$PRGNAM.tar.gz ]; then
- explodepkg $SRCDIR/_$PRGNAM.tar.gz
-fi
-
cd $TMP/tmp-$PRGNAM
-
-
-# --- TARBALL EXTRACTION,PATCH,MODIFY ---
-
echo "Extracting the source archive(s) for $PRGNAM..."
if `file ${SOURCE} | grep -q ": bzip2"`; then
tar -xjvf ${SOURCE}
-else
+elif `file ${SOURCE} | grep -q ": gzip"`; then
tar -xzvf ${SOURCE}
fi
if ! cd ${PRGNAM}-cvs-${VERSION}* ; then
@@ -168,27 +162,18 @@ if ! cd ${PRGNAM}-cvs-${VERSION}* ; then
echo "**"
exit 1
fi
-
-chown -R root.root *
-find . -perm 777 -exec chmod 755 {} \;
-find . -perm 666 -exec chmod 644 {} \;
-
-
-# --- BUILDING ---
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
echo Building ...
-
export LDFLAGS="$SLKLDFLAGS"
export CFLAGS="$SLKCFLAGS"
-
-pushd Module
-make KERNDIR=$KSRC PATCHLEVEL=$PATCHLEVEL \
+(cd Module
+ make KERNDIR=$KSRC PATCHLEVEL=$PATCHLEVEL \
2>&1 | tee $OUTPUT/make-${PRGNAM}.log
-popd
+)
-#
# Install all the needed stuff to the package dir
-#
mkdir -p $PKG/lib/modules/${KVER}/extra
if [ $PATCHLEVEL -eq 4 ]; then
gzip -9cf Module/${PRGNAM}.o > $PKG/lib/modules/${KVER}/extra/${PRGNAM}.o.gz
@@ -201,8 +186,7 @@ cp -a Module/*bin $PKG/etc/Wireless/RT61STA/
# We don't bother with RaLink's binary configuration file,
# /etc/Wireless/RT61STA/rt61sta.dat, since iwconfig/iwpriv are just as good.
-
-# Add this to the doinst.sh
+# Add this to the doinst.sh:
! [ -d $PKG/install ] && mkdir -p $PKG/install
cat <<-EEOOTT >> $PKG/install/doinst.sh
# Only run depmod on matching running kernel
@@ -214,46 +198,31 @@ cat <<-EEOOTT >> $PKG/install/doinst.sh
chroot . /sbin/depmod -a \$MYKERNEL 1> /dev/null 2> /dev/null
fi
fi
-
EEOOTT
-
-# --- DOCUMENTATION ---
-
+# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
-# Compress the kernel modules
+# Compress the kernel modules:
[ $PATCHLEVEL -eq 4 ] && \
find $PKG/lib/modules -type f -name "*.?" -exec gzip -9 {} \;
-
-# --- OWNERSHIP, RIGHTS ---
-
-chmod -R o-w $PKG
-
-
-# --- PACKAGE DESCRIPTION ---
-
+# Add a package description:
mkdir -p $PKG/install
cat $SRCDIR/slack-desc > $PKG/install/slack-desc
if [ -f $SRCDIR/doinst.sh ]; then
cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh
fi
-
-# --- BUILDING ---
-
# Build the package:
cd $PKG
-makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.tgz \
- 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
-(cd $OUTPUT && md5sum ${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.tgz.md5)
-cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.txt
-
-
-# --- CLEANUP ---
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+cd $OUTPUT
+md5sum ${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.tgz.md5
+cd -
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.txt
# Clean up the extra stuff:
if [ "$P1" = "--cleanup" ]; then