From 0b6cdef22955cebe85104a812cdfede48d19cdbc Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 30 Jan 2007 00:00:27 +0000 Subject: Update to 0.5.7 --- wpa_supplicant/build/wpa_supplicant.SlackBuild | 185 +++++++++++++------------ 1 file changed, 93 insertions(+), 92 deletions(-) (limited to 'wpa_supplicant') diff --git a/wpa_supplicant/build/wpa_supplicant.SlackBuild b/wpa_supplicant/build/wpa_supplicant.SlackBuild index 97c34263..2eee977b 100755 --- a/wpa_supplicant/build/wpa_supplicant.SlackBuild +++ b/wpa_supplicant/build/wpa_supplicant.SlackBuild @@ -1,16 +1,15 @@ #!/bin/sh # $Id$ -# Copyright (c) 2006 Eric Hameleers -# Distributed under the terms of the GNU General Public License, Version 2 -# ------------------------------------------------------------------------------ +# Copyright (c) 2006,2007 Eric Hameleers +# ----------------------------------------------------------------------------- # # Slackware SlackBuild script # =========================== # By: Eric Hameleers # For: wpa_supplicant -# URL: http://hostap.epitest.fi/wpa_supplicant/ # Descr: WPA/WPA2/IEEE 802.1X Supplicant -# Requires: Source code for supported wireless card drivers +# URL: http://hostap.epitest.fi/wpa_supplicant/ +# Needs: Source code for supported wireless card drivers # openssl >= 0.9.7 # Changelog: # 20040923CVS-1: * 23/sep/2004 by Eric Hameleers @@ -57,16 +56,14 @@ # configurable using three *_INCLUDES variables. # 0.4.9-2: * 20/sep/2006 by Eric Hameleers # Changed the SlackBuild for Slackware 11.0 compatibility -# -# ------------------------------------------------------------------------------ +# 0.5.7-1: 29/Jan/2007 by Eric Hameleers +# * Update, remove GPL license. # -# Run 'sh SlackBuild --cleanup' to build a Slackware package. -# The package (.tgz) plus descriptive .txt file and a .md5 file with -# the md5sum are created in /tmp . -# Install the package using 'installpkg '. +# Run 'sh wpa_supplicant.SlackBuild --cleanup' to build a Slackware package. +# The package (.tgz) plus descriptive .txt file are created in /tmp . +# Install using 'installpkg'. # -# ------------------------------------------------------------------------------ - +# ----------------------------------------------------------------------------- # --- INIT --- # Set initial variables: @@ -74,12 +71,11 @@ SNAPSHOT="" # set to "yes" if you're building from CVS SRCNAM=hostap PRGNAM=wpa_supplicant -VERSION=${VERSION:-0.4.9} +VERSION=${VERSION:-0.5.7} ARCH=${ARCH:-i486} -BUILD=2 +BUILD=${BUILD:-1} -DOC="ChangeLog COPYING README* examples \ - wpa_supplicant.conf.sample" +DOCS="ChangeLog COPYING README* examples wpa_supplicant.conf.sample" # Support for some of the wireless drivers needs the header files of those # drivers. @@ -91,11 +87,6 @@ MADWIFI_INCLUDES="/usr/include/madwifi" HERMES_INCLUDES="" BROADCOM_INCLUDES="" -if [ -z $SNAPSHOT ]; then # build a stable release - SOURCE="${PRGNAM}-${VERSION}.tar.gz" - SRCURL="http://hostap.epitest.fi/releases/${PRGNAM}-${VERSION}.tar.gz" -fi - # Where do we look for sources? CWD=`pwd` SRCDIR=`dirname $0` @@ -106,17 +97,27 @@ TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +if [ -z $SNAPSHOT ]; then # build a stable release +# Input URL: http://hostap.epitest.fi/releases/wpa_supplicant-0.5.7.tar.gz + SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" + SRCURL="http://hostap.epitest.fi/releases/${PRGNAM}-${VERSION}.tar.gz" +else + SOURCE="" + SRCURL="" +fi + + +## +## --- with a little luck, you won't have to edit below this point --- ## +## + # Exit the script on errors: set -e -trap 'echo "$0 FAILED!" | tee $CWD/error-${PRGNAM}.log' ERR +trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR # Catch unitialized variables: set -u P1=${1:-1} -## -## --- with a little luck, you won't have to edit below this point --- ## -## - # Slackware 11 and up need other option (gcc > 3.3.x) if [ `gcc -dumpversion | tr -d '.' |cut -c 1-2` -gt 33 ]; then MOPT=tune @@ -154,10 +155,7 @@ elif [ "$P1" != "--oldbuild" ]; then rm -rf $TMP/tmp-$PRGNAM/* fi -if [ "$PKG" = "" -o "$PKG" = "/" ] ; then - echo "Please provide a sane value for the variable 'PKG'." - exit 1 -elif [ ! -d $PKG ]; then +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: @@ -171,55 +169,48 @@ fi # --- SOURCE FILE AVAILABILITY --- if [ -z $SNAPSHOT ]; then # download stable release - if ! [ -f ${SRCDIR}/${SOURCE} ]; then + if ! [ -f ${SOURCE} ]; then if ! [ "x${SRCURL}" == "x" ]; then - echo "Source '${SOURCE}' not available yet... will download now:" - wget -O "${SRCDIR}/${SOURCE}" "${SRCURL}" || true + # 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 - echo "Downloading '${SOURCE}' failed... aborting the build." - mv -f "${SRCDIR}/${SOURCE}" "${SRCDIR}/${SOURCE}".FAIL + echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." + mv -f "${SOURCE}" "${SOURCE}".FAIL exit 1 fi else - echo "File '${SOURCE}' not available... aborting the build." + echo "File '`basename ${SOURCE}`' not available... aborting the build." exit 1 fi fi fi + if [ "$P1" == "--download" ]; then echo "Download complete." exit 0 fi - # --- PACKAGE BUILDING --- echo "++" echo "|| $PRGNAM-$VERSION" echo "++" -rm -f $CWD/*.log - -# Explode the package framework: -if [ -e $SRCDIR/_$PRGNAM.tar.gz ]; then - (cd $PKG && - explodepkg $SRCDIR/_$PRGNAM.tar.gz ) -fi - cd $TMP/tmp-$PRGNAM -# -# Extract the source archive, patch and modify -# - if ! [ -f $SRCDIR/${PRGNAM}-${VERSION}.defconfig ]; then echo "Could not find ${PRGNAM}-${VERSION}.defconfig!" - echo "You need to create that file using ${SRCNAM}-${VERSION}/${PRGNAM}/defconfig as example." + echo "You need to create that file using ${SRCNAM}-${VERSION}/${PRGNAM}/defconfig as exam +ple." exit 1 fi +echo "Extracting the source archive(s) for $PRGNAM..." if [ -z "$SNAPSHOT" ]; then - tar -xzvf $SRCDIR/${PRGNAM}-${VERSION}.tar.gz + tar -xzvf ${SOURCE} cd ${PRGNAM}-${VERSION} else tar -xzvf $SRCDIR/${SRCNAM}-${VERSION}.tar.gz @@ -232,21 +223,21 @@ fi # Create the configuration file for wpa_supplicant: cat $SRCDIR/${PRGNAM}-${VERSION}.defconfig > .config if [ ! -z $MADWIFI_INCLUDES -a -d $MADWIFI_INCLUDES ]; then - echo "Adding madwifi driver (Atheros) support" | tee -a $CWD/configure.log + echo "Adding madwifi driver (Atheros) support" | tee -a $OUTPUT/configure-${PRGNAM}.log cat <<-EOT >> .config CONFIG_DRIVER_MADWIFI=y CFLAGS += -I${MADWIFI_INCLUDES} EOT fi if [ ! -z $HERMES_INCLUDES -a -d $HERMES_INCLUDES ]; then - echo "Adding hermes driver (Agere) support" | tee -a $CWD/configure.log + echo "Adding hermes driver (Agere) support" | tee -a $OUTPUT/configure-${PRGNAM}.log cat <<-EOT >> .config CONFIG_DRIVER_HERMES=y CFLAGS += -I${HERMES_INCLUDES} EOT fi if [ ! -z $BROADCOM_INCLUDES -a -d $BROADCOM_INCLUDES ]; then - echo "Adding broadcom driver support" | tee -a $CWD/configure.log + echo "Adding broadcom driver support" | tee -a $OUTPUT/configure-${PRGNAM}.log cat <<-EOT >> .config CONFIG_DRIVER_BROADCOM=y CFLAGS += -I${BROADCOM_INCLUDES} @@ -254,20 +245,25 @@ if [ ! -z $BROADCOM_INCLUDES -a -d $BROADCOM_INCLUDES ]; then fi chown -R root:root . +chmod -R u+w,go+r-w,a-s . + + +# --- BUILDING --- + +echo Building ... -make 2>&1 | tee $CWD/make.log +make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log # Build the GUI client -make wpa_gui 2>&1 | tee -a $CWD/make.log +make wpa_gui 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log # Make man pages if needed -( - cd doc/docbook - if ! ls *.? >/dev/null 2>&1 ; then - make man 2>&1 | tee -a $CWD/make.log - fi -) +pushd doc/docbook +if ! ls *.? >/dev/null 2>&1 ; then + make man 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log +fi +popd # Do not build the developer docs -#PATH=".:$PATH" make docs 2>&1 | tee -a $CWD/make.log +#PATH=".:$PATH" make docs 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log # This goes in the doc directory later on: cp wpa_supplicant.conf wpa_supplicant.conf.sample @@ -315,24 +311,12 @@ cat <<-_EOT_ > $PKG/etc/wpa_supplicant.conf.new network={ ssid="any" key_mgmt=NONE - priority=2 + priority=2 } _EOT_ -# Strip binaries and libs, fix ownership: -chown -R root:root $PKG -chmod -R o-w $PKG - -( cd $PKG - find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null - find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -strip --strip-unneeded 2> /dev/null -) - - -# --- 'doinst.sh' script: ------ - -mkdir -p $PKG/install 2>/dev/null || true +# 'doinst.sh' script: +mkdir -p $PKG/install 2>/dev/null cat < $PKG/install/doinst.sh # Handle the incoming configuration files: config() { @@ -353,35 +337,52 @@ config etc/wpa_supplicant.conf.new EOINS + # --- DOCUMENTATION --- -# Copy the documentation: -mkdir -p $PKG/usr/doc/${PRGNAM}-${VERSION} -cp -a $DOC $PKG/usr/doc/${PRGNAM}-${VERSION}/ || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true cp -a $SRCDIR/README.slackware $PKG/usr/doc/${PRGNAM}-${VERSION}/ || true -chmod -R a-w $PKG/usr/doc/${PRGNAM}-${VERSION}/* +chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* # Compress the man page(s) -[ -d $PKG/usr/man ] && \ - find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; +find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; + +# Strip binaries +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + + +# --- OWNERSHIP, RIGHTS --- + +chmod -R o-w $PKG # --- PACKAGE DESCRIPTION --- -mkdir -p $PKG/install 2>/dev/null || true + +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 -# --- PACKAGE CREATION --- -# Build the package and compute its md5 checksum: +# --- BUILDING --- + +# Build the package: cd $PKG -makepkg --linkadd y --chown n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz -cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD.txt -(cd $OUTPUT && md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5) +makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz \ + 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log +(cd $OUTPUT && md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5) +cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt # --- CLEANUP --- + # Clean up the extra stuff: if [ "$P1" = "--cleanup" ]; then rm -rf $TMP/tmp-$PRGNAM rm -rf $PKG fi - -- cgit v1.2.3-80-g2a13