#!/usr/bin/python import lutinDebug as debug import lutinTarget import lutinTools import os import stat class Target(lutinTarget.Target): def __init__(self, typeCompilator, debugMode): cross = "" # http://biolpc22.york.ac.uk/pub/linux-mac-cross/ # http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt lutinTarget.Target.__init__(self, "Windows", typeCompilator, debugMode, "", cross) self.folder_bin="/MacOS" self.folder_lib="/lib" self.folder_data="/Resources" self.folder_doc="/doc" self.suffix_lib_static='.a' self.suffix_lib_dynamic='.dll' self.suffix_binary='.exe' self.suffix_package='' def GetStagingFolder(self, binaryName): return lutinTools.GetRunFolder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/Contents/" def MakePackage(self, pkgName, pkgProperties): debug.debug("------------------------------------------------------------------------") debug.info("Generate package '" + pkgName + "'") debug.debug("------------------------------------------------------------------------") # http://www.sandroid.org/imcross/#Deployment infoFile=self.GetStagingFolder(pkgName) + "/Info.plist" # Create the info file tmpFile = open(infoFile, 'w') tmpFile.write("\n") tmpFile.write("\n") tmpFile.write("\n") tmpFile.write(" \n") tmpFile.write(" CFBundleExecutableFile\n") tmpFile.write(" "+pkgName+"\n") tmpFile.write(" CFBundleName\n") tmpFile.write(" "+pkgName+"\n") tmpFile.write(" CFBundleIdentifier\n") tmpFile.write(" com."+pkgProperties["COMPAGNY_NAME2"]+"."+pkgName+"\n") tmpFile.write(" CFBundleIconFile\n") tmpFile.write(" "+pkgName+".icns\n") tmpFile.write(" \n") tmpFile.write("\n") tmpFile.write("\n\n") tmpFile.flush() tmpFile.close() # Must create the tarball of the application #cd $(TARGET_OUT_FINAL)/; tar -cf $(PROJECT_NAME).tar $(PROJECT_NAME).app #cd $(TARGET_OUT_FINAL)/; tar -czf $(PROJECT_NAME).tar.gz $(PROJECT_NAME).app def InstallPackage(self, pkgName): debug.debug("------------------------------------------------------------------------") debug.info("Install package '" + pkgName + "'") debug.debug("------------------------------------------------------------------------") debug.warning(" ==> TODO") #sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package def UnInstallPackage(self, pkgName): debug.debug("------------------------------------------------------------------------") debug.info("Un-Install package '" + pkgName + "'") debug.debug("------------------------------------------------------------------------") debug.warning(" ==> TODO") #sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package