|
| 1 | +#!/bin/bash |
| 2 | +MAINVER=0.7.5 |
| 3 | +echo Clearing ~freenet-buildwin |
| 4 | +rm -Rf ~freenet-buildwin/* |
| 5 | +rm -Rf ~freenet-buildwin/.[a-zA-Z0-9]* |
| 6 | +mkdir ~freenet-buildwin/.ssh |
| 7 | +cat ~/.ssh/id_rsa.pub > ~freenet-buildwin/.ssh/authorized_keys |
| 8 | +chmod 700 ~freenet-buildwin/.ssh |
| 9 | +mkdir ~freenet-buildwin/bin |
| 10 | +(echo "cd tmp" ; echo "cd app-wininstaller" ; echo "wine cmd /c build.cmd") > ~freenet-buildwin/bin/build-alpha |
| 11 | +mkdir ~freenet-buildwin/tmp |
| 12 | +cp -a /usr/src/cvs/eclipse-workspace/app-wininstaller ~freenet-buildwin/tmp |
| 13 | +(cd ~freenet-buildwin/tmp/app-wininstaller; git checkout alpha) |
| 14 | +echo Copied |
| 15 | +GITVERSION=`cd ~freenet-buildwin/tmp/app-wininstaller && git describe --always --abbrev=40` |
| 16 | +if [[ -z $GITVERSION ]]; then echo Could not get git version; exit 1; fi |
| 17 | +echo Git version is $GITVERSION |
| 18 | +rm -Rf ~freenet-buildwin/tmp/app-wininstaller/.git |
| 19 | +mkdir ~freenet-buildwin/tmp/app-wininstaller/lib |
| 20 | + |
| 21 | +# Copy files |
| 22 | + |
| 23 | +ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet.jar ~freenet-buildwin/tmp/app-wininstaller/res/install_node/freenet.jar || exit |
| 24 | +ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet-ext.jar ~freenet-buildwin/tmp/app-wininstaller/res/install_node/freenet-ext.jar || exit |
| 25 | +cp ~toad/seednodes.fref ~freenet-buildwin/tmp/app-wininstaller/res/install_node/seednodes.fref || exit |
| 26 | +for x in JSTUN KeyUtils ThawIndexBrowser UPnP Library; do |
| 27 | + ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/${x}.jar ~freenet-buildwin/tmp/app-wininstaller/res/install_node/plugins/${x}.jar || exit |
| 28 | +done |
| 29 | +cp ~freenet-buildwin/tmp/app-wininstaller/bin/Ahk2Exe.exe ~freenet-buildwin/tmp/app-wininstaller/bin/AutoHotkeySC.bin ~freenet-buildwin/tmp/app-wininstaller/res/tool_ahk/ |
| 30 | +echo Copied dependancies. |
| 31 | + |
| 32 | +VERSION=`cat /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet.build` |
| 33 | +echo VERSION is $VERSION |
| 34 | +echo Updating build |
| 35 | +(cd ~freenet-buildwin/tmp/app-wininstaller; cat src/freenetinstaller/FreenetInstaller_Include_Info.inc | sed "s/_Inc_FreenetBuild = \#[0-9]\\+/_Inc_FreenetBuild = \#$VERSION/" > 1; cat 1 > src/freenetinstaller/FreenetInstaller_Include_Info.inc; cat 1) |
| 36 | +chown -R freenet-buildwin.freenet-buildwin ~freenet-buildwin |
| 37 | +chmod +x ~freenet-buildwin/bin/build-alpha |
| 38 | +echo Running the build |
| 39 | +rm ~freenet-buildwin/tmp/app-wininstaller/bin/* |
| 40 | +eval `ssh-agent -s` |
| 41 | +ssh-add |
| 42 | +ssh -n freenet-buildwin@localhost xvfb-run ~freenet-buildwin/bin/build-alpha |
| 43 | +kill -9 `pgrep -u freenet-buildwin` |
| 44 | +cd |
| 45 | +mkdir -p tmp-wi |
| 46 | +cd tmp-wi |
| 47 | +rm /root/tmp-wi/* |
| 48 | +cp ~freenet-buildwin/tmp/app-wininstaller/bin/FreenetInstaller.exe FreenetInstaller-${VERSION}.exe |
| 49 | +cd ~freenet-buildwin/tmp/app-wininstaller/res/install_node/updater/ || exit |
| 50 | +cp update.cmd update-new.cmd || exit |
| 51 | +sha1sum update-new.cmd > update-new.cmd.sha1 || exit |
| 52 | +sha1sum update.cmd > update.cmd.sha1 || exit |
| 53 | +cd ~/tmp-wi |
| 54 | + |
| 55 | +#Uncomment if just want it for testing. |
| 56 | +#echo Built it, file is in `pwd` |
| 57 | +#exit |
| 58 | + |
| 59 | +rsync ~freenet-buildwin/tmp/app-wininstaller/res/install_node/updater/update*cmd* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/update/ |
| 60 | + |
| 61 | +echo Uploading |
| 62 | +cp FreenetInstaller-${VERSION}.exe ~toad/ |
| 63 | +echo Signing |
| 64 | +su - toad -c "gpg --sign --detach-sign FreenetInstaller-${VERSION}.exe" |
| 65 | +cp ~toad/FreenetInstaller-${VERSION}.exe.sig . |
| 66 | +echo Uploading to Google Code |
| 67 | +#/root/bin/googlecode_upload.py -s "Freenet $MAINVER build $VERSION Windows installer" -p freenet -u matthew.toseland FreenetInstaller-alpha-${VERSION}.exe || exit |
| 68 | +cp FreenetInstaller-${VERSION}.exe ~browser/ |
| 69 | +chmod a+r ~browser/FreenetInstaller-${VERSION}.exe |
| 70 | +echo Uploading to emu |
| 71 | +rsync -v FreenetInstaller-${VERSION}.exe* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/ |
| 72 | +cp FreenetInstaller-${VERSION}.exe* /usr/src/cvs/eclipse-workspace/FreenetReleased/ |
| 73 | +ssh osprey.vm.bytemark.co.uk -- "cp /var/www/downloads/alpha/.registry .; cat /var/www/downloads/alpha/.registry | sed \"s/FreenetInstaller.exe .*$/FreenetInstaller.exe installer\/FreenetInstaller-${VERSION}.exe/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry" |
| 74 | + |
| 75 | +cp ~freenet-buildwin/tmp/app-wininstaller/res/install_node/wrapper/freenetwrapper.exe ~freenet-buildwin/tmp/app-wininstaller/bin/wrapper-windows-x86-32.exe || exit |
| 76 | + |
| 77 | +cp ~freenet-buildwin/tmp/app-wininstaller/res/install_node/wrapper/wrapper-windows-x86-32.dll ~freenet-buildwin/tmp/app-wininstaller/bin/ || exit |
| 78 | + |
| 79 | +cd ~freenet-buildwin/tmp/app-wininstaller/bin/ |
| 80 | +mv freenetlauncher.exe freenetlauncher-new.exe |
| 81 | + |
| 82 | +for name in wrapper-windows-x86-32.exe wrapper-windows-x86-32.dll freenetlauncher-new.exe; do |
| 83 | + |
| 84 | +cd ~freenet-buildwin/tmp/app-wininstaller/bin/ |
| 85 | + |
| 86 | +echo Uploading ${name} version ${GITVERSION} |
| 87 | + |
| 88 | +mv $name ${name}.${GITVERSION} |
| 89 | +sha1sum ${name}.${GITVERSION} > ${name}.${GITVERSION}.sha1 |
| 90 | +rsync -v ${name}.${GITVERSION}* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/ |
| 91 | + |
| 92 | +ssh osprey.vm.bytemark.co.uk -- "cat /var/www/downloads/alpha/.registry | sed \"s/$name .*$/${name} installer\/${name}.${GITVERSION}/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry" |
| 93 | + |
| 94 | +done |
| 95 | + |
| 96 | +ssh-agent -k |
| 97 | + |
| 98 | +# Doesn't work, why? |
| 99 | +#echo "http://downloads.freenetproject.org/alpha/installer/FreenetInstaller-${VERSION}.exe" > FreenetInstaller.exe.url |
| 100 | +#rsync -vz FreenetInstaller.exe.url osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/FreenetInstaller.exe.url |
| 101 | +echo Now upload ~browser/FreenetInstaller-${VERSION}.exe to Google Code! |
0 commit comments