From 447c6554a4ecb120c407459bb4a173e414ce25e2 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 4 Jul 2018 01:24:34 +0200 Subject: [pkg] add osx bundle stub --- osx/generate.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 osx/generate.py (limited to 'osx') diff --git a/osx/generate.py b/osx/generate.py new file mode 100644 index 0000000..8982d94 --- /dev/null +++ b/osx/generate.py @@ -0,0 +1,78 @@ +#!/usr/bin/python + +import os +import os.path +import shutil +import sys +import stat + +# Variables ---------------------------- +# TODO consolidate version string for all builds. + +VERSION = "0.0.1" +APP_NAME = "RiseupVPN" +BUNDLE_IDENTIFIER = "se.leap.riseupvpn" +ENTRYPOINT = "bitmask-systray" +# Do not edit below -------------------- + + +here = os.path.split(os.path.abspath(__file__))[0] +APP_PATH = os.path.abspath(here + '/../dist/' + APP_NAME + ".app") +STAGING = os.path.abspath(here + '/../staging/') + +os.makedirs(APP_PATH + "/Contents/MacOS", exist_ok=True) + + +f = open(APP_PATH + "/Contents/Info.plist", "w") +f.write(""" + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + %s + CFBundleGetInfoString + %s + CFBundleIconFile + app.icns + CFBundleIdentifier + %s + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + %s + CFBundlePackageType + APPL + CFBundleShortVersionString + %s + CFBundleSignature + ???? + CFBundleVersion + %s + NSAppleScriptEnabled + YES + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + +""" % ( + ENTRYPOINT, + APP_NAME + " " + VERSION, + BUNDLE_IDENTIFIER, + APP_NAME, + APP_NAME + " " + VERSION, + VERSION)) +f.close() + +f = open(APP_PATH + "/Contents/PkgInfo", "w") +f.write("APPL????") +f.close() + +entrypoint_file = APP_PATH + "/Contents/MacOS/" + ENTRYPOINT +shutil.copyfile(STAGING + '/' + ENTRYPOINT, entrypoint_file) + +oldmode = os.stat(entrypoint_file).st_mode +os.chmod(entrypoint_file, oldmode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) -- cgit v1.2.3