#!/bin/sh

#########################################################################
# This is a quick hack to help Debian users install legoctl more easily.
# Hopefully someone will create a Debian package and make this script
# unnecessary.
#
# Just run ./debian-install
#
# To uninstall libbacon, enter the libbacon directory and run 
#   make uninstall

apt-get install make
apt-get install gcc
apt-get install libc6-dev
apt-get install libusb-dev
apt-get install libbluetooth1-dev
apt-get install bluez-utils

# Install libbacon (for strlcpy())
if [ ! -e /usr/local/lib/libbacon.a ]; then
    rm -f libbacon-1.0.tar.gz
    wget http://personalpages.tds.net/~jwbacon/Ports/distfiles/libbacon-1.0.tar.gz
    tar zxf libbacon-1.0.tar.gz
    cd libbacon-1.0
    make clean
    make
    make install
    cd ..
fi

# Install legoctl
make clean
make depend
make MANPREFIX=/usr/local/share EXTRALIBS=-lbacon install

