#!/bin/sh # aircrack-ng slackbuild - Dani - dani@slacky.it NICE=10 function set_perm { echo -e -n "\nAdjusting permission in $1..."; chown -R root:root $1 &> /dev/null if [ $? != 0 ]; then echo -e "Failed.\n"; exit 1 fi find $1 -perm 664 -exec chmod 644 {} \; find $1 -perm 600 -exec chmod 644 {} \; find $1 -perm 444 -exec chmod 644 {} \; find $1 -perm 400 -exec chmod 644 {} \; find $1 -perm 440 -exec chmod 644 {} \; find $1 -perm 777 -exec chmod 755 {} \; find $1 -perm 775 -exec chmod 755 {} \; find $1 -perm 511 -exec chmod 755 {} \; find $1 -perm 711 -exec chmod 755 {} \; find $1 -perm 555 -exec chmod 755 {} \; echo "Done."; } function strip_files { echo -n "Stripping files in $1..."; find $1 | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find $1 | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find $1 | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null echo "Done."; } NAME=aircrack-ng VERSION=1.0 BETA=beta2 ARCH=${ARCH:-i486} CHOST=${CHOST:-i486} BUILD=1dd CWD=`pwd` PKG=/tmp/$NAME-build TGZ=$PKG/TGZ if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -e $CWD/$NAME-$VERSION-$BETA.tar.gz ]; then wget http://download.aircrack-ng.org/$NAME-$VERSION-$BETA.tar.gz || exit 1 fi echo -n "Removing old files..." rm -rf $PKG if [ $? != 0 ]; then echo -n "Failed.\n"; exit 1; fi mkdir -p $TGZ echo -e "Done.\n"; cd $PKG tar xzvf $CWD/$NAME-$VERSION-$BETA.tar.gz || exit 1 cd $NAME-$VERSION-$BETA || exit 1 set_perm `pwd`; mkdir -p $TGZ/usr/doc/$NAME-${VERSION}${BETA} cp -av AUTHORS ChangeLog INSTALLING LICENSE* \ README VERSION \ $TGZ/usr/doc/$NAME-${VERSION}${BETA} CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ nice -n$NICE make sqlite=true -j2 || exit 1 make sqlite=true install DESTDIR=$TGZ || exit 2 ( cd $TGZ mv usr/local/* usr/ rmdir usr/local ) set_perm $TGZ; strip_files $TGZ; gzip -9 $TGZ/usr/man/man?/*.? mkdir -p $TGZ/install cat $CWD/slack-desc > $TGZ/install/slack-desc cat $CWD/slack-desc > $TGZ/usr/doc/$NAME-${VERSION}${BETA}/slack-desc cat $CWD/$NAME.SlackBuild > $TGZ/usr/doc/$NAME-${VERSION}${BETA}/$NAME.SlackBuild cd $TGZ echo "Making slack-required..."; requiredbuilder -v -y -s $CWD $TGZ makepkg -l y -c n $CWD/$NAME-${VERSION}${BETA}-$ARCH-$BUILD.tgz if [ "$1" = "-clean" ]; then echo -n "Cleaning..." rm -rf $PKG echo -e "Done.\n"; fi exit 0;