#!/bin/bash

# Note : this script will probably work on Debian too.

# run as root! su or sudo.

who=$(whoami)

if [[ "$who" != root ]]
then
	echo "This script must be run as root."
	echo "Please try again: sudo cwb-install-ubuntu"
	echo "Thanks!"
	exit
fi

apt-get install autoconf bison flex gcc pkg-config libc6-dev libncurses5-dev make libpcre3-dev libglib2.0-0 libglib2.0-dev libreadline6 libreadline6-dev

./install-scripts/cwb-config-basic

make clean
make depend
make cl
make utils
make cqp

make install

# restore original state of config file (so subversion doesn't get confused if this is a checked-out version)
rm config.mk
mv config.mk.bak config.mk
