#!/bin/bash
# I'm going to try to do this in a somewhat scripted format.
echo "You've entered your password, this will go faster now"
echo "Go eat something, this takes a while"
#grab latest GHC
curl http://www.haskell.org/ghc/dist/6.8.2/ghc-6.8.2-src.tar.bz2 > ghc-6.8.2-src.tar.bz2
curl http://www.haskell.org/ghc/dist/6.8.2/ghc-6.8.2-src-extralibs.tar.bz2 > ghc-6.8.2-src-extralibs.tar.bz2
# Unzip & build GHC
tar xvfj ghc-6.8.2-src.tar.bz2 && tar xvfj ghc-6.8.2-src-extralibs.tar.bz2 && cd ghc-6.8.2 && ./configure && make && make install && cd ..
# install cabal-install
curl http://hackage.haskell.org/packages/archive/cabal-install/0.4.0/cabal-install-0.4.0.tar.gz > cabal-install-0.4.0.tar.gz
tar xvfz cabal-install-0.4.0.tar.gz && cd cabal-install-0.4.0 && runghc Setup.lhs configure && runghc Setup.lhs build && runghc Setup.lhs install && cd ..
# install some libraries
cabal install HaXml-1.13.3 hslogger HTTP
#grab all of HAppS...
darcs get http://happs.org/repos/HAppS-State/
darcs get http://happs.org/repos/HAppS-IxSet/
darcs get http://happs.org/repos/HAppS-HTTP/
darcs get http://happs.org/repos/HAppS-Plugins/
darcs get http://happs.org/repos/HAppS-Util/
darcs get http://happs.org/repos/HAppS-Data/
darcs get http://happs.org/repos/syb-with-class/
#Install them in the order that I had to do it.
cd syb-with-class && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
cd HAppS-Util && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
cd HAppS-Data && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
cd HAppS-State && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
cd HAppS-IxSet && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
cd HAppS-Plugins && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
cd HAppS-HTTP && runghc Setup.hs configure && runghc Setup.hs build && runghc Setup.hs install && cd ..
echo "All done (hopefully)!"