Ejemplo n.º 1
0
def packageFrontend():
    import tarfile 

    path = "bin/"
    baseResources = "resources/"

    name = getPackageName()

    tmpDir = os.path.join("build", "package", "nidium.tmp")
    Utils.mkdir(tmpDir)

    Utils.run("echo \"%s\" > %s/LICENSE" % (LICENSE, tmpDir))

    if Platform.system == "Darwin":
        signCode(path + "nidium.app")

        Log.info("Create dmg...")

        resources = "%s/osx/" % (baseResources)
        name += ".dmg"
        cmd = [
            "tools/installer/osx/create-dmg",
            "--volname 'Nidium'",
            "--no-internet-enable",
            "--volicon " + resources + "/nidium.icns",
            "--background " + resources + "/dmg-background.png",
            "--window-size 555 418",
            "--icon-size 96",
            "--eula %s/LICENSE" % tmpDir,
            "--app-drop-link 460 290",
            "--icon 'nidium.app' 460 80",
            "build/package/%s" % name,
            path + "nidium.app/"
        ]
        code, output = Utils.run(" ".join(cmd))
        if code != 0:
            Utils.exit("Failed to build dmg")
    elif Platform.system == "Linux":
        resources = "%s/linux/" % (baseResources)
        name += ".run"

        Utils.mkdir(tmpDir + "/dist/")
        Utils.mkdir(tmpDir + "/resources/")

        shutil.copy(resources + "/nidium.desktop", tmpDir + "/resources/")
        shutil.copy(resources + "/x-application-nidium.xml", tmpDir + "/resources/")
        shutil.copy(baseResources + "/icons/nidium.iconset/[email protected]", tmpDir + "/resources/nidium.png")
        shutil.copy(resources + "/installer.sh", tmpDir)
        shutil.copy(path + "nidium",  tmpDir + "/dist/")

        # XXX : Uncomment once breakpad & landing net are back
        #shutil.copy(path + "nidium-crash-reporter", tmpDir + "dist/")

        Utils.run("tools/installer/linux/makeself.sh --license %s/LICENSE %s build/package/%s 'Nidium installer' ./installer.sh " % (tmpDir, tmpDir, name))
    else:
        # Window TODO
        print("TODO")

    shutil.rmtree(tmpDir);
Ejemplo n.º 2
0
def packageFrontend():
    import tarfile 

    path = "bin/"
    baseResources = "resources/"

    name = getPackageName()

    tmpDir = os.path.join("build", "package", "nidium.tmp")
    Utils.mkdir(tmpDir)

    Utils.run("echo \"%s\" > %s/LICENSE" % (LICENSE, tmpDir))

    if Platform.system == "Darwin":
        signCode(path + "nidium.app")

        Log.info("Create dmg...")

        resources = "%s/osx/" % (baseResources)
        name += ".dmg"
        cmd = [
            "tools/installer/osx/create-dmg",
            "--volname 'Nidium'",
            "--no-internet-enable",
            "--volicon " + resources + "/nidium.icns",
            "--background " + resources + "/dmg-background.png",
            "--window-size 555 418",
            "--icon-size 96",
            "--eula %s/LICENSE" % tmpDir,
            "--app-drop-link 460 290",
            "--icon 'nidium.app' 460 80",
            "build/package/%s" % name,
            path + "nidium.app/"
        ]
        code, output = Utils.run(" ".join(cmd))
        if code != 0:
            Utils.exit("Failed to build dmg")
    elif Platform.system == "Linux":
        resources = "%s/linux/" % (baseResources)
        name += ".run"

        Utils.mkdir(tmpDir + "/dist/")
        Utils.mkdir(tmpDir + "/resources/")

        shutil.copy(resources + "/nidium.desktop", tmpDir + "/resources/")
        shutil.copy(resources + "/x-application-nidium.xml", tmpDir + "/resources/")
        shutil.copy(baseResources + "/icons/nidium_64x64.png", tmpDir + "/resources/nidium.png")
        shutil.copy(resources + "/installer.sh", tmpDir)
        shutil.copy(path + "nidium",  tmpDir + "/dist/")

        # XXX : Uncomment once breakpad & landing net are back
        #shutil.copy(path + "nidium-crash-reporter", tmpDir + "dist/")

        Utils.run("tools/installer/linux/makeself.sh --license %s/LICENSE %s build/package/%s 'Nidium installer' ./installer.sh " % (tmpDir, tmpDir, name))
    else:
        # Window TODO
        print("TODO")

    shutil.rmtree(tmpDir);
Ejemplo n.º 3
0
def packageServer():
    name = getPackageName()

    tmpDir = os.path.join("build", "package", "nidium-server")

    Utils.mkdir(tmpDir)

    Utils.run("echo \"%s\" > %s/LICENSE" % (LICENSE, tmpDir))

    shutil.copy(OUTPUT_BINARY, tmpDir)

    with Utils.Chdir("build/package/"):
        Utils.run("tar -czvf %s.tar.gz nidium-server/" % (name))

    shutil.rmtree(tmpDir);
Ejemplo n.º 4
0
def packageServer():
    name = getPackageName()

    tmpDir = os.path.join("build", "package", "nidium-server")

    Utils.mkdir(tmpDir)

    Utils.run("echo \"%s\" > %s/LICENSE" % (LICENSE, tmpDir))

    shutil.copy(OUTPUT_BINARY, tmpDir)

    with Utils.Chdir("build/package/"):
        Utils.run("tar -czvf %s.tar.gz nidium-server/" % (name))

    shutil.rmtree(tmpDir);
Ejemplo n.º 5
0
def signCode(path):
    if SIGN_IDENTITY is None:
        Log.info("No identity providen, not signing app")
        return

    Log.info("Signing nidium package...")

    code, output = Utils.run(" ".join([
        "codesign",
        "--force",
        "--sign",
        "'Developer ID Application: %s '" % SIGN_IDENTITY,
        path
    ]), failExit=False)

    if code != 0:
        Log.error("WARNING : App signing failed with identity %s. Not signing app" % identity)
        Log.error(output)

    Log.info(path)
Ejemplo n.º 6
0
def signCode(path):
    if SIGN_IDENTITY is None:
        Log.info("No identity providen, not signing app")
        return

    Log.info("Signing nidium package...")

    code, output = Utils.run(" ".join([
        "codesign",
        "--force",
        "--sign",
        "'Developer ID Application: %s '" % SIGN_IDENTITY,
        path
    ]), failExit=False)

    if code != 0:
        Log.error("WARNING : App signing failed with identity %s. Not signing app" % identity)
        Log.error(output)

    Log.info(path)
Ejemplo n.º 7
0
def stripExecutable():
    Log.info("Striping executable")
    Utils.run("strip " + OUTPUT_BINARY)
Ejemplo n.º 8
0
def stripExecutable():
    Log.info("Striping executable")
    Utils.run("strip " + OUTPUT_BINARY)