#!/bin/sh

SRCNAM=wormux-0.9.2.1.tar.bz2
WRKDIR=wormux-0.9.2.1
TMPDIR=/tmp/wormux

rm -r -f $WRKDIR

rm -r -f $TMPDIR

#mkdir -p $TMPDIR

export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/share/pkgconfig

tar -xf $SRCNAM

cd $WRKDIR

./configure --prefix=/usr/local --enable-fribidi --enable-servers

make

mkdir -p $TMPDIR/usr/local/share/wormux

make install DESTDIR=$TMPDIR

cd ..

#rm -r -f $WRKDIR

find $TMPDIR/ -type d | xargs chmod -v 755

cd $TMPDIR

find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null
