Simple packaging scripts

develop
Petr Mrázek 2011-04-02 02:34:21 +02:00
parent 6abd2d76bb
commit 42366c238f
12 changed files with 104 additions and 35 deletions

@ -56,6 +56,7 @@ SET( DFHACK_INSTALL ${DFHACK_INST_DEFAULT} CACHE STRING
'portable' for a portable zip or tar.gz package (windows default) 'portable' for a portable zip or tar.gz package (windows default)
'linux' for generic packaging and system installs on linux (linux default) 'linux' for generic packaging and system installs on linux (linux default)
'ubuntu-10.10' for ubuntu maverick package.") 'ubuntu-10.10' for ubuntu maverick package.")
SET( MEMXML_DATA_PATH . CACHE PATH SET( MEMXML_DATA_PATH . CACHE PATH
"Path to a valid Memory.xml file. "Path to a valid Memory.xml file.
This is baked into the library, so when you package DFHack for linux, set it to the right path.") This is baked into the library, so when you package DFHack for linux, set it to the right path.")
@ -104,7 +105,7 @@ IF(${DFHACK_INSTALL} STREQUAL "linux")
SET(DFHACK_DOXYGEN_DESTINATION share/dfhack/doc/doxygen) SET(DFHACK_DOXYGEN_DESTINATION share/dfhack/doc/doxygen)
ENDIF() ENDIF()
IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10") IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10" OR ${DFHACK_INSTALL} STREQUAL "debian")
if(WIN32) if(WIN32)
MESSAGE(FATAL_ERROR "WTF are you doing?") MESSAGE(FATAL_ERROR "WTF are you doing?")
endif() endif()
@ -123,7 +124,7 @@ IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10")
SET(DFHACK_DEVDOC_DESTINATION usr/share/dfhack/doc) SET(DFHACK_DEVDOC_DESTINATION usr/share/dfhack/doc)
SET(DFHACK_DOXYGEN_DESTINATION usr/share/dfhack/doc/doxygen) SET(DFHACK_DOXYGEN_DESTINATION usr/share/dfhack/doc/doxygen)
INSTALL(FILES INSTALL(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/package/ubuntu-10.10/99-dfhack.conf" "${CMAKE_CURRENT_SOURCE_DIR}/package/${DFHACK_INSTALL}/99-dfhack.conf"
DESTINATION etc/sysctl.d) DESTINATION etc/sysctl.d)
ENDIF() ENDIF()
@ -220,7 +221,7 @@ FUNCTION(GET_DEBIAN_ARCHITECTURE arch)
SET(${arch} ${dpkgarch} PARENT_SCOPE) SET(${arch} ${dpkgarch} PARENT_SCOPE)
ENDFUNCTION() ENDFUNCTION()
IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10") IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10" OR ${DFHACK_INSTALL} STREQUAL "debian")
SET(CPACK_GENERATOR "DEB") SET(CPACK_GENERATOR "DEB")
#wtf, wtf, wtf. force them to be empty #wtf, wtf, wtf. force them to be empty
@ -232,11 +233,11 @@ IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Games") # yep. magma. SET(CPACK_DEBIAN_PACKAGE_SECTION "Games") # yep. magma.
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") # very. SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") # very.
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) # find deps automatically! hopefully... maybe... SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) # find deps automatically! hopefully... maybe...
SET(INSTSCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/package/ubuntu-10.10") SET(INSTSCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/package/${DFHACK_INSTALL}")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${INSTSCRIPT}/postinst;${INSTSCRIPT}/preinst;${INSTSCRIPT}/postrm") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${INSTSCRIPT}/postinst;${INSTSCRIPT}/preinst;${INSTSCRIPT}/postrm")
GET_DEBIAN_ARCHITECTURE(PKG_ARCHITECTURE) GET_DEBIAN_ARCHITECTURE(PKG_ARCHITECTURE)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${DFHACK_VERSION}-${DFHACK_REVISION}_${PKG_ARCHITECTURE}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${DFHACK_VERSION}-${DFHACK_REVISION}_${DFHACK_INSTALL}-${PKG_ARCHITECTURE}")
INCLUDE(CPack) INCLUDE(CPack)
ENDIF() ENDIF()

@ -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

@ -16,25 +16,40 @@ expect {
return 1 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 spawn telnet win7
set rez [connect] set rez [connect]
if { $rez == 0 } { if { $rez == 1 } {
puts "\nError connecting to server!\n"
exit 1
}
send "net use X: \\\\vboxsvr\\projects\r\n" send "net use X: \\\\vboxsvr\\projects\r\n"
expect "The command completed successfully." expect "The command completed successfully."
send "X:\r\n" send "X:\r\n"
expect "X:" expect "X:"
send "cd X:\\dfhack\\build\r\n" send "cd X:\\dfhack\\build\r\n"
expect "build" expect "build"
send "\"C:\\Program Files (x86)\\MSVC10\\VC\\vcvarsall.bat\" x86\r\n"
expect "build" set buildrez [dobuild]
set timeout -1 if { $buildrez == 1 } {
send "linux-remote.bat\r\n" puts "\nThere was an error during build.\n"
# can detect build errors here, pass them out using 'exit' } else {
expect "FINISHED_BUILD" puts "\nAll OK.\n"
}
send "exit\r" send "exit\r"
expect eof expect eof
exit 0 exit $buildrez
}
puts "\nError connecting to server!\n"
exit 1

@ -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 ../

@ -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 ../

@ -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 ../

@ -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

@ -12,11 +12,3 @@ VBoxManage startvm "7 Prof"
sleep 20 sleep 20
expect linux-remote.expect $TARGET 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"

@ -0,0 +1,2 @@
# some settings required for dfhack. fucks up local security...
kernel.randomize_va_space = 0

@ -0,0 +1,2 @@
#!/bin/sh
# do nothing. blah.

@ -0,0 +1,2 @@
#!/bin/sh