#!/bin/bash # wireless-tools.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 30-Sep-2004 # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PACKAGE export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PACKAGE export PKG=$TMP/package-$PACKAGE mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $PORTARCH in arm) export SLKCFLAGS="-march=armv3 -mtune=xscale" ;; powerpc) export SLKCFLAGS="" ;; sparc) export SLKCFLAGS="" ;; *) export SLKCFLAGS="" ;; esac # Extract source: tar zxvvf $CWD/wireless_tools.$VERSION.tar.gz cd wireless_tools* slackhousekeeping # Create package directory framework: mkdir -p $PKG/{sbin,etc/rc.d,usr/{lib,include,man/man8,doc/$PACKAGE-$VERSION}} # Apply patches: zcat $CWD/wireless_tools.nowhine.diff.gz | patch -p1 --verbose --suffix=.orig --backup || failpatch zcat $CWD/wireless_tools.static.diff.gz | patch -p1 --verbose --suffix=.orig --backup || failpatch # Set CFLAGS: sed -i 's/^CFLAGS.*=\(.*\)$/CFLAGS='"$SLKCFLAGS"' \1/' Makefile # Build: make || failmake # Install: install -m755 ifrename iwconfig iwevent iwgetid iwlist iwpriv iwspy $PKG/sbin # The library seems to be used by kdenetwork, but since the .soname in the shared library # doesn't seem to be forward-thinking we'll leave that out still: install -m644 libiw.a $PKG/usr/lib install -m644 wireless.h iwlib.h $PKG/usr/include # Install man pages: mkdir -p $PKG/usr/man/man{5,7,8} install -m644 *.8 $PKG/usr/man/man8 install -m644 iftab.5 $PKG/usr/man/man5 install -m644 wireless.7 $PKG/usr/man/man7 # Install docs: mkdir -p $PKG/usr/doc/$PACKAGE-$VERSION cp -a COPYING INSTALL *.txt README* \ $PKG/usr/doc/$PACKAGE-$VERSION # Add init scripts from Eric Hameleers: zcat $CWD/rc.wireless.gz > $PKG/etc/rc.d/rc.wireless chmod 755 $PKG/etc/rc.d/rc.wireless # This might contain a secret key, so we'll use chmod 600: zcat $CWD/rc.wireless.conf.gz > $PKG/etc/rc.d/rc.wireless.conf.new # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh # Build the package: if [ $PORTARCH = arm ]; then slackmp # run makepkg else makepkg -l y -c n $PKGSTORE/$PKGSERIES/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz fi # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links