diff options
-rwxr-xr-x | wpa_supplicant/build/wpa_supplicant.SlackBuild | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/wpa_supplicant/build/wpa_supplicant.SlackBuild b/wpa_supplicant/build/wpa_supplicant.SlackBuild new file mode 100755 index 00000000..a87c8387 --- /dev/null +++ b/wpa_supplicant/build/wpa_supplicant.SlackBuild @@ -0,0 +1,125 @@ +#!/bin/sh +# +# ------------------------------------------------------------------------------ +# +# Slackware SlackBuild script +# =========================== +# By: Eric Hameleers +# Created: 23/sep/2004 +# For: wpa_supplicant +# URL: http://hostap.epitest.fi/wpa_supplicant/ +# Requires: Source code for supported wireless card drivers +# openssl >= 0.9.7 +# Changelog: +# Build 1: 23/sep/2004 by Eric Hameleers +# First release. +# +# ------------------------------------------------------------------------------ +# +# 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 <packagename>'. +# +# ------------------------------------------------------------------------------ + + +# --- INIT --- +# Set initial variables: +CWD=`pwd` +if [ "$TMP" = "" ]; then + TMP=/tmp +fi + +TARBALL=hostap +PRGNAM=wpa_supplicant +VERSION=20040923CVS +ARCH=${ARCH:-i486} +BUILD=1 + +DOC="ChangeLog README ../www/wpa_supplicant/*.html doc/* $CWD/wpa_supplicant_config $CWD/README.slackware" + +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 + +PKG=$TMP/package-$PRGNAM +rm -rf $PKG + +mkdir -p $TMP/tmp-$PRGNAM # location to build the source +mkdir -p $PKG # place for the package to be assembled + + +# --- PACKAGE BUILDING --- + +echo "++" +echo "|| $PRGNAM-$VERSION" +echo "++" + +# Explode the package framework: +if [ -e $CWD/_$PRGNAM.tar.gz ]; then + (cd $PKG && + explodepkg $CWD/_$PRGNAM.tar.gz ) +fi + +cd $TMP/tmp-$PRGNAM + +# +# Extract the source archive, patch and modify +# +tar -xzvf $CWD/${TARBALL}-${VERSION}.tar.gz +cd ${TARBALL}/${PRGNAM} +patch -p 0 < $CWD/${PRGNAM}_Makefile.patch + +chown -R root.root . + +make 2>&1 | tee $CWD/make.log + +mkdir -p $PKG/usr/sbin +cp wpa_supplicant wpa_pasphrase wpa_cli $PKG/usr/sbin/ + +# Strip binaries and libs, fix ownership: +chown -R root.root $PKG +chgrp bin $PKG/usr/sbin/* +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 +) + + +# --- DOCUMENTATION --- +# Copy the documentation: +mkdir -p $PKG/usr/doc/${PRGNAM}-${VERSION} +cp -a $DOC $PKG/usr/doc/${PRGNAM}-${VERSION} +chmod -R -w $PKG/usr/doc/${PRGNAM}-${VERSION}/* + + +# --- PACKAGE DESCRIPTION --- +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + + +# --- PACKAGE CREATION --- +# Build the package and compute its md5 checksum: +cd $PKG +makepkg --linkadd y --chown n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz +cat $CWD/slack-desc | grep "^${PRGNAM}" > $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txt +(cd $TMP && md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5) + + +# --- CLEANUP --- +# Clean up the extra stuff: +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP/tmp-$PRGNAM + rm -rf $PKG +fi + |