#!/bin/sh

vers=`cat B/DEBIAN/control | grep Version | sed s/'Version: '//`

make install DESTDIR=`pwd`/B &&
rm -f B/usr/lib/ksquirrel-libs/*.la &&
rm -f B/usr/lib/*.la                &&
rm -f B/usr/lib/ksquirrel-libs/*.so &&
rm -f B/usr/lib/ksquirrel-libs/*.so.0 &&
strip B/usr/lib/ksquirrel-libs/* &&
strip B/usr/lib/*
strip B/usr/bin/*
dpkg-deb -b B ksquirrel-libs_${vers}_i386.deb &&
rm -rf B/usr