Advertisement
robn

Untitled

Sep 29th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #url_format=http://eatenbyagrue.org/f/pioneer=%s
  4. #upload_dir=fce2@kalamazoo.dreamhost.com:eatenbyagrue.org/f/pioneer
  5. url_format=http://sourceforge.net/projects/pioneerspacesim/files/nightly/%s/download
  6. upload_dir=robertnorris,pioneerspacesim@frs.sf.net:/home/frs/project/p/pi/pioneerspacesim/nightly
  7.  
  8. branch=master
  9. #branch=alpha14-freeze
  10. ref=0
  11.  
  12. configure_opts="--enable-debug"
  13.  
  14. function build_linux {
  15.     cd /home/rob/pioneer
  16.  
  17.     make distclean
  18.     (./bootstrap && ./configure $configure_opts --with-extra-version=$ref && make clean && make -j3) || exit 1
  19.  
  20.     base="pioneer-$ref-linux"
  21.     dir="/home/rob/$base"
  22.     mkdir $dir
  23.     cp -v src/pioneer src/modelviewer $dir
  24.     cp -v AUTHORS.txt Modelviewer.txt README.txt Changelog.txt *COPYING.txt Quickstart.txt $dir
  25.     cp -rv data $dir/data
  26.  
  27.     find $dir/data -name .gitignore -exec rm '{}' ';'
  28.  
  29.     cd /home/rob
  30.     tar cvf $base.tar $base
  31.     bzip2 $base.tar
  32.  
  33.     rm -rf $dir
  34. }
  35.  
  36. function build_win32 {
  37.     old_path=$PATH
  38.     export PATH=/home/rob/mingw-cross-env-2.19/usr/bin:/home/rob/mingw-cross-env-2.19/usr/i686-pc-mingw32/bin:$PATH
  39.  
  40.     cd /home/rob/pioneer
  41.  
  42.     make distclean
  43.     (./bootstrap && ./configure --host=i686-pc-mingw32 $configure_opts --with-extra-version=$ref && make clean && make -j3) || exit 1
  44.  
  45.     base="pioneer-$ref-win32"
  46.     dir="/home/rob/$base"
  47.     mkdir $dir
  48.     cp -v src/pioneer.exe src/modelviewer.exe $dir
  49.     cp -v AUTHORS.txt Modelviewer.txt README.txt Changelog.txt *COPYING.txt Quickstart.txt $dir
  50.     #cp -v win32/lib/*.dll $dir
  51.     cp -rv data $dir/data
  52.  
  53.     find $dir/data -name .gitignore -exec rm '{}' ';'
  54.  
  55.     cd /home/rob
  56.     7za a $base.7z $base
  57.  
  58.     rm -rf $dir
  59.  
  60.     export PATH=$old_path
  61. }
  62.  
  63. echo "updating source"
  64.  
  65. cd /home/rob/pioneer
  66. git fetch || exit 1
  67. git checkout $branch
  68. git merge robn/$branch
  69. ref=`git log -n1 --pretty=%h $branch`
  70.  
  71. linux_url=`printf $url_format pioneer-$ref-linux.tar.bz2`
  72. win32_url=`printf $url_format pioneer-$ref-win32.tar.bz2`
  73.  
  74. #curl -fsIo /dev/null $linux_url
  75. #if [ $? == 0 ] ; then
  76. #    echo "Builds are up to date."
  77. #    exit 0
  78. #fi
  79.  
  80. build_linux
  81. build_win32
  82.  
  83. echo "uploading"
  84. scp "pioneer-$ref-linux.tar.bz2" "pioneer-$ref-win32.7z" $upload_dir
  85. if [ $? != 0 ] ; then
  86.     echo "Upload failed, bailing out."
  87.     exit 1
  88. fi
  89. rm "pioneer-$ref-linux.tar.bz2" "pioneer-$ref-win32.7z"
  90.  
  91. echo "tweeting"
  92. twidge update "new dev build available! linux $linux_url windows $win32_url #pioneerspacesim"
  93.  
  94. exit 0
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement