Build GeeXboX from repository

#!/bin/bash
 
 
# install required packages
sudo apt-get install -y mercurial build-essential libncurses5-dev flex bison gawk \
gettext libreadline5 libreadline5-dev libunistring0 texinfo
 
# get source code
hg clone http://hg.openbricks.org/openbricks
 
# change into source code directory
cd openbricks/
 
# configure
make menuconfig
 
# compile
make
 
exit
 
 
 
# OLD
 
#
# PARAMETERS
#
GEEXBOX_PATH=~/gxdev
 
 
#
# FUNCTIONS
#
add_patch() {
	echo "-- add_path ---"
 
	# echo "http://www.uclibc.org/downloads/snapshots/uClibc-20070829.tar.bz2" > $GEEXBOX_PATH/geexbox/packages/uClibc/url
}
 
optimize_cpu() {
	echo "--- optimize_cpu ---"
 
	#sed 's|TARGET_CPU=|TARGET_CPU=pentium3|g' $GEEXBOX_PATH/geexbox/config/options > $GEEXBOX_PATH/geexbox/config/options.tmp
	#mv ./geexbox/config/options.tmp $GEEXBOX_PATH/geexbox/config/options
}
 
enable_services() {
        echo "--- enable_services ---"
 
        #sed 's|SERVICES=no|SERVICES=no|g' $GEEXBOX_PATH/geexbox/config/options > $GEEXBOX_PATH/geexbox/config/options.tmp
        #mv ./geexbox/config/options.tmp $GEEXBOX_PATH/geexbox/config/options
}
 
 
#
# MAIN
#
# check target path
if [ ! -d $GEEXBOX_PATH ]; then
	mkdir $GEEXBOX_PATH
fi
 
# change to dev directory
echo "change to $GEEXBOX_PATH ..."
cd $GEEXBOX_PATH
 
# delete previous build
echo "delete previous build in $GEEXBOX_PATH/geexbox..."
if [ -d $GEEXBOX_PATH/geexbox ]; then
	rm -r $GEEXBOX_PATH/geexbox
fi
 
# get source
echo "get source files ..."
hg clone http://hg.geexbox.org/geexbox
 
# configure
echo "configure..."
optimize_cpu
enable_services
add_patch
 
# compile
echo "compile ..."
cd geexbox
make