From 42366c238fa9537ee8c1a287a89cdb34915eb83e Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sat, 2 Apr 2011 02:34:21 +0200 Subject: Simple packaging scripts --- build/linux-remote.bat | 5 ----- build/linux-remote.expect | 49 ++++++++++++++++++++++++++++--------------- build/linux-remote.sh | 22 ------------------- build/pkg-debian.sh | 7 +++++++ build/pkg-ubuntu-10.10-x64.sh | 7 +++++++ build/pkg-ubuntu-10.10.sh | 7 +++++++ build/pkg-win32.bat | 37 ++++++++++++++++++++++++++++++++ build/pkg-win32.sh | 14 +++++++++++++ 8 files changed, 104 insertions(+), 44 deletions(-) delete mode 100644 build/linux-remote.bat delete mode 100755 build/linux-remote.sh create mode 100644 build/pkg-debian.sh create mode 100644 build/pkg-ubuntu-10.10-x64.sh create mode 100644 build/pkg-ubuntu-10.10.sh create mode 100644 build/pkg-win32.bat create mode 100755 build/pkg-win32.sh (limited to 'build') diff --git a/build/linux-remote.bat b/build/linux-remote.bat deleted file mode 100644 index bbf03d44..00000000 --- a/build/linux-remote.bat +++ /dev/null @@ -1,5 +0,0 @@ -mkdir linux-remote -cd linux-remote -cmake ..\.. -G"Visual Studio 10" -msbuild ALL_BUILD.vcxproj /p:Configuration=Release -echo FINISHED_BUILD \ No newline at end of file diff --git a/build/linux-remote.expect b/build/linux-remote.expect index c694a755..18fcdc8b 100644 --- a/build/linux-remote.expect +++ b/build/linux-remote.expect @@ -16,25 +16,40 @@ expect { return 1 } +# procedure to do build stuff; result 0 if OK, 1 otherwise +proc dobuild {} { + set timeout -1 + send "pkg-win32.bat\r\n" + puts "\nBuilding...\n" +expect { + "BUILD OK" {return 0} + "MSVC ERROR" {return 1} + "CMAKE ERROR" {return 1} + "ENV ERROR" {return 1} +} +} + spawn telnet win7 set rez [connect] -if { $rez == 0 } { - send "net use X: \\\\vboxsvr\\projects\r\n" - expect "The command completed successfully." - send "X:\r\n" - expect "X:" - send "cd X:\\dfhack\\build\r\n" - expect "build" - send "\"C:\\Program Files (x86)\\MSVC10\\VC\\vcvarsall.bat\" x86\r\n" - expect "build" - set timeout -1 - send "linux-remote.bat\r\n" - # can detect build errors here, pass them out using 'exit' - expect "FINISHED_BUILD" - send "exit\r" - expect eof - exit 0 -} +if { $rez == 1 } { puts "\nError connecting to server!\n" exit 1 +} + +send "net use X: \\\\vboxsvr\\projects\r\n" +expect "The command completed successfully." +send "X:\r\n" +expect "X:" +send "cd X:\\dfhack\\build\r\n" +expect "build" + +set buildrez [dobuild] +if { $buildrez == 1 } { + puts "\nThere was an error during build.\n" +} else { + puts "\nAll OK.\n" +} +send "exit\r" +expect eof +exit $buildrez diff --git a/build/linux-remote.sh b/build/linux-remote.sh deleted file mode 100755 index 333e682b..00000000 --- a/build/linux-remote.sh +++ /dev/null @@ -1,22 +0,0 @@ -#/bin/sh -# Remote into a virtualbox VM to build with MSVC. -# Very specific to my own local setup. ~px - -# VARS. TODO: parametrize -export DFHACK_VER=0.5.7 -export PKG=dfhack-bin-$DFHACK_VER -export TARGET=Release - -# let's build it all -VBoxManage startvm "7 Prof" -sleep 20 -expect linux-remote.expect $TARGET - -echo "Creating package..." -cd ../output/$TARGET -rm -r $PKG -rm $PKG.zip -mkdir $PKG -mv *.exe *.dll *.html *.txt *.xml $PKG -zip -r $PKG.zip $PKG -echo "DONE" diff --git a/build/pkg-debian.sh b/build/pkg-debian.sh new file mode 100644 index 00000000..6d3bce5d --- /dev/null +++ b/build/pkg-debian.sh @@ -0,0 +1,7 @@ +#!/bin/sh +rm -r debian +mkdir debian +cd debian +cmake ../.. -DCMAKE_BUILD_TYPE="Release" -DDFHACK_INSTALL="debian" -DMEMXML_DATA_PATH="/usr/share/dfhack" -DBUILD_DFHACK_C_BINDINGS=ON -DBUILD_DFHACK_DEVEL=ON -DBUILD_DFHACK_DOXYGEN=OFF -DBUILD_DFHACK_EXAMPLES=OFF -DBUILD_DFHACK_PLAYGROUND=OFF -DBUILD_DFHACK_PYTHON_BINDINGS=ON +make package +mv *.deb ../ \ No newline at end of file diff --git a/build/pkg-ubuntu-10.10-x64.sh b/build/pkg-ubuntu-10.10-x64.sh new file mode 100644 index 00000000..5f4e17b3 --- /dev/null +++ b/build/pkg-ubuntu-10.10-x64.sh @@ -0,0 +1,7 @@ +#!/bin/sh +rm -r ubuntu64 +mkdir ubuntu64 +cd ubuntu64 +cmake ../.. -DCMAKE_BUILD_TYPE="Release" -DDFHACK_INSTALL="ubuntu-10.10" -DMEMXML_DATA_PATH="/usr/share/dfhack" -DDFHACK_PACKAGE_DIR=".." -DBUILD_DFHACK_C_BINDINGS=ON -DBUILD_DFHACK_DEVEL=ON -DBUILD_DFHACK_DOXYGEN=OFF -DBUILD_DFHACK_EXAMPLES=OFF -DBUILD_DFHACK_PLAYGROUND=OFF -DBUILD_DFHACK_PYTHON_BINDINGS=ON +make package +mv *.deb ../ \ No newline at end of file diff --git a/build/pkg-ubuntu-10.10.sh b/build/pkg-ubuntu-10.10.sh new file mode 100644 index 00000000..01baab90 --- /dev/null +++ b/build/pkg-ubuntu-10.10.sh @@ -0,0 +1,7 @@ +#!/bin/sh +rm -r ubuntu +mkdir ubuntu +cd ubuntu +cmake ../.. -DCMAKE_BUILD_TYPE="Release" -DDFHACK_INSTALL="ubuntu-10.10" -DMEMXML_DATA_PATH="/usr/share/dfhack" -DDFHACK_PACKAGE_DIR=".." -DBUILD_DFHACK_C_BINDINGS=ON -DBUILD_DFHACK_DEVEL=ON -DBUILD_DFHACK_DOXYGEN=OFF -DBUILD_DFHACK_EXAMPLES=OFF -DBUILD_DFHACK_PLAYGROUND=OFF -DBUILD_DFHACK_PYTHON_BINDINGS=ON +make package +mv *.deb ../ diff --git a/build/pkg-win32.bat b/build/pkg-win32.bat new file mode 100644 index 00000000..ff71e974 --- /dev/null +++ b/build/pkg-win32.bat @@ -0,0 +1,37 @@ +@ECHO OFF +rd /S /Q MSVC10 +mkdir MSVC10 +cd MSVC10 +echo CLEANUP DONE + +cmake ..\.. -G"Visual Studio 10" -DDFHACK_INSTALL="portable" -DMEMXML_DATA_PATH="." -DBUILD_DFHACK_C_BINDINGS=OFF -DBUILD_DFHACK_DEVEL=OFF -DBUILD_DFHACK_DOXYGEN=OFF -DBUILD_DFHACK_EXAMPLES=OFF -DBUILD_DFHACK_PLAYGROUND=OFF -DBUILD_DFHACK_PYTHON_BINDINGS=OFF > ..\pkg-win32-cmake.log +if errorlevel 1 goto cmakeerror +echo CMAKE OK + +call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" > ..\pkg-win32-env.log +if errorlevel 1 goto enverror +echo ENV OK + +msbuild PACKAGE.vcxproj /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=..\pkg-win32-msbuild.log;encoding=utf-8 -noconsolelogger > NUL +if errorlevel 1 goto msvcerror +move /Y *.zip .. +echo BUILD OK +set errorlevel=0 +goto end + +:cmakeerror +echo CMAKE ERROR +set errorlevel=1 +goto end + +:enverror +echo ENV ERROR +set errorlevel=1 +goto end + +:msvcerror +echo MSVC ERROR +set errorlevel=1 +goto end + +:end \ No newline at end of file diff --git a/build/pkg-win32.sh b/build/pkg-win32.sh new file mode 100755 index 00000000..6e81264f --- /dev/null +++ b/build/pkg-win32.sh @@ -0,0 +1,14 @@ +#/bin/sh +# Remote into a virtualbox VM to build with MSVC. +# Very specific to my own local setup. ~px + +# VARS. TODO: parametrize +export DFHACK_VER=0.5.7 +export PKG=dfhack-bin-$DFHACK_VER +export TARGET=Release + +# let's build it all +VBoxManage startvm "7 Prof" +sleep 20 +expect linux-remote.expect $TARGET + -- cgit v1.2.1