Ubuntu build script. Tested with ubuntu 13.04.
Work in progress.
#!/bin/bash
#
# bitcoind linux buildscript
#
# tested on ubuntu 13
# v.0.03
# last updated 3/1/2014
#
#
#----------------------------------------------------------
#required packages
#----------------------------------------------------------
apt-get -y upgrade
apt-get -y update
apt-get install -y git
apt-get install -y build-essential
apt-get install -y python-pip
apt-get install -y libssl-dev
apt-get install -y libboost-all-dev
apt-get install -y dh-autoreconf
apt-get install -y ccache
apt-get install -y pkg-config
#undocumented issues with bitcoin unix install
apt-get install -y libdb++-dev
apt-get install -y libprotobuf-dev
apt-get install -y alien
#----------------------------------------------------------
# Build berkley db4.8
#----------------------------------------------------------
cd $HOME/Downloads
if [ ! -e db-4.8.30 ]
then
wget
http://download.oracle.com/berkeley-db/db-4.8.30.tar.gztar zxvf db-4.8.30.tar.gz
rm -f db-4.8.30.tar.gz
fi
cd db-4.8.30/build_unix
sh ../dist/configure --prefix=/usr/local --enable-cxx
make
sudo make install
cd $HOME/Downloads
rm -fr db-4.8.30/
#----------------------------------------------------------
#build bitcoin from source
#----------------------------------------------------------
mkdir $HOME/bitcoin; cd bitcoin
git clone git://github.com/bitcoin/bitcoin.git $HOME/bitcoin
/bin/bash $HOME/bitcoin/autogen.sh
#build without QT
cd $HOME/bitcoin && ./configure --without-qt
sudo make
#copy the binary. better perhaps a init script and change privs
cp $HOME/bitcoin/src/bitcoind /usr/local/bin
#----------------------------------------------------------
#create config
#----------------------------------------------------------
mkdir $HOME/.bitcoin
touch $HOME/.bitcoin/bitcoin.conf
echo "########### Creating config"
config=".bitcoin/bitcoin.conf"
touch $config
echo "server=1" > $config
echo "daemon=1" >> $config
echo "connections=40" >> $config
randUser=`< /dev/urandom tr -dc A-Za-z0-9 | head -c30`
randPass=`< /dev/urandom tr -dc A-Za-z0-9 | head -c30`
echo "rpcuser=$randUser" >> $config
echo "rpcpassword=$randPass" >> $config
# other config
#echo "########### Firewall rules; allow 22,8333"
#ufw allow 22/tcp
#ufw allow 8333/tcp
#ufw --force enable
#echo "########### Creating Swap"
#dd if=/dev/zero of=/swapfile bs=1M count=1024 ; mkswap /swapfile ; swapon /swapfile
#echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
#echo "########### Setting up autostart (cron)"
#crontab -l > tempcron
#echo "@reboot bitcoind -daemon" >> tempcron
#crontab tempcron
#rm tempcron
#rebootoot password!"
#passwd