#!/bin/sh PN=iproute2 PV=2.4.7 DOCS="R* examples" CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-$PN if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_$PN.tar.gz cd $TMP tar xvfz $CWD/$PN-$PV-now-ss010824.tar.gz cd $PN echo "Building $PN-$PV ..." # Make it! CFLAGS=-O2 LDFLAGS=-s make # Copy super executables for i in ip/ifcfg ip/routef ip/routel ip/rtpr ; do chmod 755 $i cp -fa $i $PKG/usr/sbin done # Copy the docs mkdir -p $PKG/usr/doc/$PN-$PV cp -a $DOCS $PKG/usr/doc/$PN-$PV # binaries for i in ip/ip ip/rtmon ip/rtacct tc/tc ; do chmod 755 $i strip $i cp -fa $i $PKG/sbin done # Build the package: cd $PKG tar czvf $TMP/$PN.tgz . # Warn of zero-length files: for file in `find . -type f -print` ; do if [ "`filesize $file`" = "0" ]; then echo "WARNING: zero length file $file" fi if [ "`filesize $file`" = "20" ]; then echo "WARNING: possible empty gzipped file $file" fi done # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PN rm -rf $PKG fi