def packageAndSend(server):
    pkgutil.debug("sending to %s, script=%s..." % (server.host, server.task))

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")
    os.makedirs("tmptree")

    print " - setting up lgpl subdir..."
    shutil.copytree("qt", "tmptree/lgpl")
    pkgutil.expandMacroes("tmptree/lgpl", lgpl_header)

    print " - setting up commercial subdir..."
    shutil.copytree("qt", "tmptree/commercial")
    pkgutil.expandMacroes("tmptree/commercial", commercial_header)

    if server.platform == pkgutil.PLATFORM_WINDOWS:
        shutil.copy(server.task, "tmptree/task.bat")
    else:
        shutil.copy(server.task, "tmptree/task.sh")

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending to host: %s.." % (server.host))
    pkgutil.sendDataFileToHost(server.host, pkgutil.PORT_SERVER, zipFile)
Beispiel #2
0
def packageAndSend(server):
    pkgutil.debug("sending to %s, script=%s..." % (server.host, server.task))

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")
    os.makedirs("tmptree")

    print " - setting up lgpl subdir..."
    shutil.copytree("qt", "tmptree/lgpl");
    pkgutil.expandMacroes("tmptree/lgpl", lgpl_header)
    

    print " - setting up commercial subdir..."
    shutil.copytree("qt", "tmptree/commercial");
    pkgutil.expandMacroes("tmptree/commercial", commercial_header)


    if server.platform == pkgutil.PLATFORM_WINDOWS:
        shutil.copy(server.task, "tmptree/task.bat")
    else:
        shutil.copy(server.task, "tmptree/task.sh")

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending to host: %s.." % (server.host))
    pkgutil.sendDataFileToHost(server.host, pkgutil.PORT_SERVER, zipFile)
Beispiel #3
0
def postProcessPackage(package):
    pkgutil.debug("Post process package " + package.name())
    os.chdir(package.packageDir)

    if os.path.isfile("FATAL.ERROR"):
        print "\nFATAL ERROR on package %s\n" % (package.name())
        return

    if package.hasEclipse():
        doEclipse(package)
    logFile = package.packageDir + "/.task.log"
    if os.path.isfile(logFile):
        shutil.copy(logFile, options.packageRoot + "/." + package.name() + ".tasklog");

    pkgutil.debug(" - creating directories...")
    for mkdir in package.mkdirs:
        os.makedirs(mkdir)

    pkgutil.debug(" - copying files around...")
    copyFiles(package)

    pkgutil.debug(" - deleting files and directories...")
    removeFiles(package)

    # Patch uic.pri since this does not include all necessary files
    if not package.binary:
        pkgutil.debug(" - patching uic.pri")
        tmpFile = open("juic/uic.pri", "a")
        tmpFile.write("\nSOURCES += uic.cpp\n")
        tmpFile.write("HEADERS += uic.h\n")
        tmpFile.close()
    
    if package.binary:
        # move platform jar to startdir for webstart, take the examples and classes from windows
        if package.license == pkgutil.LICENSE_LGPL:
            shutil.copy(package.platformJarName, options.startDir)
            if package.platform == pkgutil.PLATFORM_WINDOWS:
                shutil.copy("qtjambi-%s.jar" % (options.qtJambiVersion), options.startDir);
                shutil.copy("qtjambi-examples-%s.jar" % (options.qtJambiVersion), options.startDir);
        
        # unjar docs into doc directory...
        pkgutil.debug(" - doing docs...")
        os.makedirs("doc/html")
        os.chdir("doc/html")
        os.system("jar -xf %s/javadoc-%s.jar" % (options.startDir, options.qtJambiVersion) )
        os.chdir(package.packageDir)

        # unpack the platform .jar to get the correct binary content into
        # the package...
        pkgutil.debug(" - doing native libraries...")
        os.system("jar -xf %s" % package.platformJarName)
        shutil.rmtree("%s/META-INF" % package.packageDir)
        os.remove("qtjambi-deployment.xml")

        if package.license == pkgutil.LICENSE_EVAL:
            # Eval packages cannot use platform jar's as these cannot
            # be patched with eval key...
            os.remove(package.platformJarName)

        if not package.platform == pkgutil.PLATFORM_WINDOWS:
            os.system("chmod a+rx designer.sh qtjambi.sh")
            os.system("chmod -R a+rw .")
            if package.license == pkgutil.LICENSE_EVAL:
                os.system("chmod a+rx binpatch")

        if package.platform == pkgutil.PLATFORM_LINUX:
            os.chdir("lib")
            os.system("ln -s libqtjambi.so libqtjambi.so.1")
            os.chdir(package.packageDir)

        if package.platform == pkgutil.PLATFORM_MAC:
            os.chdir("lib")
            os.system("ln -s libqtjambi.jnilib libqtjambi.1.jnilib")
            os.chdir(package.packageDir)
            if not package.license == pkgutil.LICENSE_EVAL:
                os.system("chmod a+x Demos.app/Contents/MacOS/JavaApplicationStub")

        if package.platform == pkgutil.PLATFORM_WINDOWS:
            shutil.copytree("plugins/imageformats/Microsoft.VC80.CRT", "plugins/designer/Microsoft.VC80.CRT");

    pkgutil.expandMacroes(package.packageDir, package.licenseHeader)
 
    bundle(package)

    package.success = True
Beispiel #4
0
def packageAndSend(package):
    pkgutil.debug("packaging and sending: %s..." % package.name())

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")

    shutil.copytree("qtjambi", "tmptree");

    qtEdition = "qt-" + package.license;
    if package.license == pkgutil.LICENSE_PREVIEW:
        qtEdition = "qt-commercial"

    pkgutil.debug(" - creating task script")
    arch = "x86";
    if arch == pkgutil.ARCH_64:
        arch = "x86_64"
    if package.platform == pkgutil.PLATFORM_WINDOWS:
        buildFile = open("tmptree/task.bat", "w")
        buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\" + qtEdition))

        # build eclipse on 32-bit windows...
        if package.hasEclipse():
#            if package.license == pkgutil.LICENSE_EVAL:
#                buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\qt-commercial"))
            buildFile.write("cd scripts\n")
            buildFile.write("call build_eclipse.bat %%cd%%\\..\\eclipse\\qtjambi-4.5 %s %s\n" % (options.eclipseVersion, arch))
            buildFile.write("cd ..\n")
#            if package.license == pkgutil.LICENSE_EVAL:
#                buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\" + qtEdition))
            
        buildFile.write("call ant\n")
        buildFile.write('if "%ERRORLEVEL%" == "0" ' + package.make + ' clean\n')
        buildFile.write("copy %QTDIR%\\bin\\designer.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\lrelease.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\lupdate.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\linguist.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtDesigner4.dll bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtDesignerComponents4.dll bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtScript4.dll bin\n")

    else:
        buildFile = open("tmptree/task.sh", "w")

        qtLocation = "/tmp/qtjambi-package-builder/" + qtEdition
        
        buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, qtLocation))
        buildFile.write("ant\n")
        buildFile.write(package.make + " clean \n")
        
        if package.hasEclipse():
            # a little trick needed to bypass that eclipse tools use
            # gui which will pop up eval dialogs on the build
            # servers...
#            if package.license == pkgutil.LICENSE_EVAL: 
#                buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, "/tmp/qtjambi-package-builder/qt-commercial"))            
            buildFile.write("cd scripts\n")
            buildFile.write("bash ./build_eclipse.sh $PWD/../eclipse/qtjambi-4.5 %s %s\n" % (options.eclipseVersion, arch))
            buildFile.write("cd ..\n")
            buildFile.write("cp -v lib/libqtdesigner.so lib/libqtdesignerplugin.so\n")
            buildFile.write("rm -v lib/libqtdesigner.*\n")
#            if package.license == pkgutil.LICENSE_EVAL: 
#                buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, qtLocation))

        if package.platform == pkgutil.PLATFORM_LINUX:
            buildFile.write("cp -v $QTDIR/bin/designer bin\n")
            buildFile.write("cp -v $QTDIR/bin/lrelease bin\n")
            buildFile.write("cp -v $QTDIR/bin/lupdate bin\n")
            buildFile.write("cp -v $QTDIR/bin/linguist bin\n")
            buildFile.write("jar -xf qtjambi-linux*.jar\n")
            buildFile.write("rm -rf META-INF\n");
            buildFile.write("cp -v $QTDIR/lib/libQtDesigner.so.4 lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtDesignerComponents.so.4 lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtScript.so.4 lib\n")
            buildFile.write("chmod 755 scripts/update_rpath.sh\n");
            buildFile.write("./scripts/update_rpath.sh\n");
        else:
            buildFile.write("cp -vR $QTDIR/bin/Designer.app bin\n")
            buildFile.write("cp -v $QTDIR/bin/lrelease bin\n")
            buildFile.write("cp -v $QTDIR/bin/lupdate bin\n")
            buildFile.write("cp -vR $QTDIR/bin/Linguist.app bin\n")
            buildFile.write("jar -xf qtjambi-mac*.jar\n");
            buildFile.write("rm -rf META-INF\n");
            buildFile.write("cp -v $QTDIR/lib/libQtDesigner.4.dylib lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtDesignerComponents.4.dylib lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtScript.4.dylib lib\n")
            buildFile.write("chmod 755 scripts/update_installname.sh\n");
            buildFile.write("./scripts/update_installname.sh\n");

    buildFile.close()

    pkgutil.debug(" - expanding macroes prior to sending...");
    pkgutil.expandMacroes("tmptree", package.licenseHeader)

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending %s to host: %s.." % (package.name(), package.buildServer))
    pkgutil.sendDataFileToHost(package.buildServer, pkgutil.PORT_SERVER, zipFile)