


cd /home/endrov/hp/nightly
#rm -Rf Endrov
rm -Rf javadoc
#git clone git://github.com/mahogny/Endrov.git
cd Endrov
git pull
cd ..
mkdir -p Endrov/release
rm -Rf Endrov/release/*
cd Endrov/ev


#remove stuff that causes problems on linux
rm -Rf endrov/macBinding/

#Build endrov and javadoc
make
cp -r ../../macBinding endrov/    #this is pre-built code
javadoc -classpath `java -jar startEndrov.jar --printcp` -d ../../javadoc endrov/*/*.java endrov/*/*/*.java endrov/*/*/*/*.java
#rm ../release/ev*.zip   
rm ../release/*deb
cd util
./makerelease.sh
cd ..


#remove macbinding again, to avoid problems with git
rm -Rf endrov/macBinding/


cd ..

#Move generated files to nightly build downloads
cd release
rm /home/endrov/hp/download/nightly/endrov*zip
rm /home/endrov/hp/download/nightly/endrov*deb
cp *zip *deb /home/endrov/hp/download/nightly

#Update repository
reprepro -b /home/endrov/hp/debian remove karmic endrov
reprepro -b /home/endrov/hp/debian includedeb karmic /home/endrov/hp/download/nightly/*deb
#TODO problem: need new version numbers for nightly builds!?

cd ../..
date > last.txt
