#!/bin/sh
PREFIX=$HOME/dist
mkdir -p $PREFIX/src
cd $PREFIX/src
GREP_RESULT=`grep $PREFIX/bin $HOME/.bashrc`
if test -z "$GREP_RESULT"; then
 echo "export PATH=$PREFIX/bin:$PATH" >> $HOME/.bashrc
fi
GREP_RESULT=`grep $PREFIX/lib $HOME/.bashrc`
if test -z "$GREP_RESULT"; then
 echo "export LD_LIBRARY_PATH=$PREFIX/lib" >> $HOME/.bashrc
fi
wget -Nc http://ftp.de.debian.org/debian/pool/main/c/clanlib/libclan2-gui_0.6.5-1-1.1_i386.deb
wget -Nc http://ftp.de.debian.org/debian/pool/main/c/clanlib/libclan2-jpeg_0.6.5-1-1.1_i386.deb
wget -Nc http://ftp.de.debian.org/debian/pool/main/c/clanlib/libclan2-mikmod_0.6.5-1-1.1_i386.deb
wget -Nc http://ftp.de.debian.org/debian/pool/main/c/clanlib/libclan2-png_0.6.5-1-1.1_i386.deb
wget -Nc http://ftp.de.debian.org/debian/pool/main/c/clanlib/libclan2-sound_0.6.5-1-1.1_i386.deb
#wget -Nc http://ftp.de.debian.org/debian/pool/main/c/clanlib/libclan2-vorbis_0.6.5-1-1.1_i386.deb
wget -Nc http://ftp.de.debian.org/debian/pool/main/p/pingus/pingus_0.6.0-2_i386.deb
wget -Nc http://ftp.de.debian.org/debian/pool/main/p/pingus/pingus-data_0.6.0-2_all.deb
rm -rf deb/
dpkg -x libclan2-gui_0.6.5-1-1.1_i386.deb deb/
dpkg -x libclan2-jpeg_0.6.5-1-1.1_i386.deb deb/
dpkg -x libclan2-mikmod_0.6.5-1-1.1_i386.deb deb/
dpkg -x libclan2-png_0.6.5-1-1.1_i386.deb deb/
dpkg -x libclan2-sound_0.6.5-1-1.1_i386.deb deb/
#dpkg -x libclan2-vorbis_0.6.5-1-1.1_i386.deb deb/
dpkg -x pingus_0.6.0-2_i386.deb deb/
dpkg -x pingus-data_0.6.0-2_all.deb deb/ 
cp -fa deb/usr/* ../
rm -rf deb/
cd ..
mkdir -p bin
ln -sf ../games/pingus bin/pingus
# message
cat <<EOF

to start open a new console, then: pingus
EOF
