#!/bin/sh

#########################################################################
# This is a quick hack to help Gentoo users install legoctl more easily.
# There is a portage port, but if you want the latest version, you may
# need to use this script instead.
#
# Just run ./debian-install
#
# To uninstall libbacon, enter the libbacon directory and run 
#   make uninstall

if [ ! -e /usr/lib/libusb.so ]; then
    emerge libusb
fi

# 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

