summaryrefslogtreecommitdiffstats
path: root/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/wpa_supplicant/wpa_supplicant.SlackBuild')
-rwxr-xr-xsource/n/wpa_supplicant/wpa_supplicant.SlackBuild50
1 files changed, 31 insertions, 19 deletions
diff --git a/source/n/wpa_supplicant/wpa_supplicant.SlackBuild b/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
index a38fed35b..b3acc5834 100755
--- a/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
+++ b/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright 2004-2008 Eric Hameleers, Eindhoven, NL
-# Copyright 2008-2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008-2010 Patrick J. Volkerding, Sebeka, MN, USA
# 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
@@ -21,10 +21,19 @@
# SUCH DAMAGE.
# -----------------------------------------------------------------------------
-PRGNAM=wpa_supplicant
-VERSION=${VERSION:-0.6.9}
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-2}
+PKGNAM=wpa_supplicant
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -45,6 +54,9 @@ elif [ "$ARCH" = "arm" ]; then
elif [ "$ARCH" = "armel" ]; then
SLKCFLAGS="-O2 -march=armv4t"
LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
# Support for some of the wireless drivers needs the header files of those
@@ -59,19 +71,19 @@ BROADCOM_INCLUDES=""
CWD=$(pwd)
TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PRGNAM
+PKG=$TMP/package-$PKGNAM
rm -rf $PKG
mkdir -p $TMP $PKG
-if ! [ -f $CWD/${PRGNAM}.defconfig ]; then
- echo "Could not find ${PRGNAM}.defconfig!"
+if ! [ -f $CWD/${PKGNAM}.defconfig ]; then
+ echo "Could not find ${PKGNAM}.defconfig!"
exit 1
fi
cd $TMP
-rm -rf ${PRGNAM}-${VERSION}
-tar -xvf $CWD/${PRGNAM}-${VERSION}.tar.bz2 || exit 1
-cd ${PRGNAM}-${VERSION}
+rm -rf ${PKGNAM}-${VERSION}
+tar xvf $CWD/${PKGNAM}-${VERSION}.tar.?z* || exit 1
+cd ${PKGNAM}-${VERSION}
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -87,7 +99,7 @@ find . \
cd wpa_supplicant
# Create the configuration file for building wpa_supplicant:
-cat $CWD/${PRGNAM}.defconfig > .config
+cat $CWD/${PKGNAM}.defconfig > .config
if [ ! -z $MADWIFI_INCLUDES -a -d $MADWIFI_INCLUDES ]; then
echo "Adding madwifi driver (Atheros) support"
cat <<-EOT >> .config
@@ -162,7 +174,7 @@ done
# Install a default configuration file:
mkdir -p $PKG/etc
cat <<-_EOT_ > $PKG/etc/wpa_supplicant.conf.new
- # See /usr/doc/${PRGNAM}-${VERSION}/wpa_supplicant.conf.sample
+ # See /usr/doc/${PKGNAM}-${VERSION}/wpa_supplicant.conf.sample
# for many more options that you can use in this file.
# This line enables the use of wpa_cli which is used by rc.wireless
@@ -219,11 +231,11 @@ config etc/dbus-1/system.d/dbus-wpa_supplicant.conf.new
EOINS
# Add the documentation:
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $CWD/README.slackware $PKG/usr/doc/${PRGNAM}-${VERSION}/
-chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
-chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION/*
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a $CWD/README.slackware $PKG/usr/doc/${PKGNAM}-${VERSION}/
+chmod -R a-w $PKG/usr/doc/$PKGNAM-$VERSION/*
+chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION/*
# This should only be read/write by root:
chmod 600 $PKG/etc/wpa_supplicant.conf.new
@@ -244,5 +256,5 @@ fi
# Build the package:
cd $PKG
-/sbin/makepkg -l y -c n $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txz
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}.txz