summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-02-19 19:14:22 +0100
committerKali Kaneko <kali@leap.se>2018-02-19 19:37:43 +0100
commit6de3b4b1fb22a503fe04b3e5678a45aa81657c55 (patch)
tree7a05dfe99e761246708d7183aada662e2148f5c6
parent89dbc2c7b7f6c41b5520c3633d1f90ddb0162f37 (diff)
[pkg] osx packaging changes for riseupvpn
-rw-r--r--pkg/bundles/build.mk46
-rwxr-xr-xpkg/osx/makeicons.sh19
-rw-r--r--pkg/pyinst/anonvpn.spec13
-rw-r--r--src/leap/bitmask/gui/anonvpn.py3
-rw-r--r--src/leap/bitmask/vpn/launchers/darwin.py2
5 files changed, 75 insertions, 8 deletions
diff --git a/pkg/bundles/build.mk b/pkg/bundles/build.mk
index 3458354c..a91c771d 100644
--- a/pkg/bundles/build.mk
+++ b/pkg/bundles/build.mk
@@ -1,7 +1,9 @@
# This makefile should be called from the topmost bitmask folder
-#
+
OSX_RES = dist/Bitmask.app/Contents/Resources
OSX_CON = dist/Bitmask.app/Contents/MacOS
+OSX_ANON_RES= dist/RiseupVPN.app/Contents/Resources
+OSX_ANON_CON= dist/RiseupVPN.app/Contents/MacOS
OSX_CERT = "Developer ID Installer: LEAP Encryption Access Project"
BUILD_RELEASE?=no
@@ -128,7 +130,7 @@ bundle_headless:
mkdir -p $(HEADLESS_DIST)/leap/soledad/client/_db
cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/leap/soledad/client/_db/dbschema.sql $(HEADLESS_DIST)/leap/soledad/client/_db/
echo `git describe` > $(HEADLESS_DIST)/version
- mv $(HEADLESS_DIST) _bundlelib && mkdir $(HEADLESS_DIST_VERSION) && mv _bundlelib $(HEADLESS_DIST_VERSION)lib/
+ mv $(HEADLESS_DIST) _bundlelib && mkdir -p $(HEADLESS_DIST_VERSION) && mv _bundlelib $(HEADLESS_DIST_VERSION)lib/
ln $(HEADLESS_DIST_VERSION)lib/bitmask-nox $(HEADLESS_DIST_VERSION)lib/bitmask
mkdir -p $(HEADLESS_DIST_VERSION)apps/mail
test -f /usr/bin/gpg1 && cp /usr/bin/gpg1 $(HEADLESS_DIST_VERSION)apps/mail/gpg || cp /usr/bin/gpg $(HEADLESS_DIST_VERSION)apps/mail/gpg
@@ -136,14 +138,22 @@ bundle_headless:
cp release-notes.rst $(HEADLESS_DIST_VERSION)
cp pkg/launcher/bitmask $(HEADLESS_DIST_VERSION)
+icons_riseup:
+ pkg/osx/makeicons.sh pkg/branding/riseupvpn.svg
+ mv icon.icns pkg/branding/riseupvpn.icns
+
bundle_anonvpn:
pyinstaller -y pkg/pyinst/anonvpn.spec
+ rm pkg/branding/riseupvpn.icns
+ rm -rf icon.iconset
cp src/leap/bitmask/core/bitmaskd.tac $(ANONVPN_DIST)
cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/leap/common/cacert.pem $(ANONVPN_DIST)/
echo `git describe` > $(ANONVPN_DIST)/version
- mv $(ANONVPN_DIST) _bundlelib && mkdir $(ANONVPN_DIST_VERSION) && mv _bundlelib $(ANONVPN_DIST_VERSION)lib/
+ mv $(ANONVPN_DIST) _bundlelib && mkdir -p $(ANONVPN_DIST_VERSION) && mv _bundlelib $(ANONVPN_DIST_VERSION)lib/
mkdir -p $(ANONVPN_DIST_VERSION)/apps/providers
cp -r src/leap/bitmask/bonafide/providers/* $(ANONVPN_DIST_VERSION)/apps/providers/
+
+bundle_anonvpn_helpers_linux:
# openvpn
mkdir -p $(ANONVPN_DIST_VERSION)/apps/vpn
wget https://downloads.leap.se/thirdparty/linux/openvpn/openvpn-x64 -O $(ANONVPN_DIST_VERSION)/apps/vpn/openvpn.leap
@@ -153,4 +163,32 @@ bundle_anonvpn:
cp src/leap/bitmask/vpn/helpers/linux/bitmask-root $(ANONVPN_DIST_VERSION)/apps/helpers/
cp src/leap/bitmask/vpn/helpers/linux/se.leap.bitmask.bundle.policy $(ANONVPN_DIST_VERSION)/apps/helpers/
-bundle_anonvpn_linux: bundle_anonvpn
+bundle_anonvpn_osx_missing:
+ mv $(OSX_ANON_CON)/anonvpn $(OSX_ANON_CON)/bitmask-app
+ cp pkg/osx/bitmask-wrapper $(OSX_ANON_CON)/anonvpn
+ mkdir -p $(OSX_ANON_RES)/bitmask-helper
+ cp -r pkg/osx/daemon $(OSX_ANON_RES)/bitmask-helper/
+ cp -r pkg/osx/openvpn $(OSX_ANON_RES)/bitmask-helper/
+ mkdir -p $(OSX_ANON_RES)/../apps/providers
+ cp -r src/leap/bitmask/bonafide/providers/* $(OSX_ANON_RES)/../apps/providers/
+ cp -r $(ANONVPN_DIST_VERSION)/apps/providers/* $(OSX_ANON_RES)/../apps/providers
+ cp src/leap/bitmask/vpn/helpers/osx/bitmask-helper $(OSX_ANON_RES)/bitmask-helper/
+ cp src/leap/bitmask/vpn/helpers/osx/bitmask.pf.conf $(OSX_ANON_RES)/bitmask-helper/
+ cp pkg/osx/scripts/se.leap.bitmask-helper.plist $(OSX_ANON_RES)/bitmask-helper/
+ wget https://downloads.leap.se/thirdparty/osx/openvpn/openvpn -O $(OSX_ANON_RES)/openvpn.leap
+ chmod +x $(OSX_ANON_RES)/openvpn.leap
+
+bundle_anonvpn_osx_pkg:
+ cp src/leap/bitmask/core/bitmaskd.tac $(OSX_ANON_CON)/
+ cp ../bitmask-systray/bitmask-systray $(OSX_ANON_CON)/bitmask-systray
+ pkg/osx/quickpkg --output dist/RiseupVPN-$(NEXT_VERSION)_pre.pkg --scripts pkg/osx/scripts/ dist/RiseupVPN.app/
+ @if [ $(BUILD_RELEASE) = no ]; then\
+ echo "[!] BUILD_RELEASE=no, skipping signature";\
+ else\
+ echo "[+] Signing the bundle";\
+ productsign --sign $(OSX_CERT) dist/RiseupVPN-$(NEXT_VERSION)_pre.pkg dist/RiseupVPN-$(NEXT_VERSION).pkg;\
+ fi
+
+bundle_anonvpn_linux: bundle_anonvpn bundle_anonvpn_helpers_linux
+
+bundle_anonvpn_osx: icons_riseup bundle_anonvpn bundle_anonvpn_osx_missing bundle_anonvpn_osx_pkg
diff --git a/pkg/osx/makeicons.sh b/pkg/osx/makeicons.sh
new file mode 100755
index 00000000..823af826
--- /dev/null
+++ b/pkg/osx/makeicons.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+sizes=(16 32 64 128 256 512)
+largfile='icon_512x512@2x.png'
+if [ ! -f "$largfile" ]; then
+ convert -background none -resize 1024x1024 "$1" "$largfile"
+fi
+for s in "${sizes[@]}"; do
+ echo $s
+ convert -background none -resize ${s}x${s} "$largfile" "icon_${s}x$s.png"
+done
+
+cp 'icon_32x32.png' 'icon_16x16@2x.png'
+mv 'icon_64x64.png' 'icon_32x32@2x.png'
+cp 'icon_256x256.png' 'icon_128x128@2x.png'
+cp 'icon_512x512.png' 'icon_256x256@2x.png'
+
+mkdir icon.iconset
+mv icon_*x*.png icon.iconset
+iconutil -c icns icon.iconset
diff --git a/pkg/pyinst/anonvpn.spec b/pkg/pyinst/anonvpn.spec
index 98624dd4..ec61f04e 100644
--- a/pkg/pyinst/anonvpn.spec
+++ b/pkg/pyinst/anonvpn.spec
@@ -25,6 +25,7 @@ hiddenimports = [
VENV = os.environ.get('VIRTUAL_ENV', '')
ENTRYPOINT = ['../../src/leap/bitmask/gui/anonvpn.py']
+excludes = ['PyQt5', 'pysqlcipher', 'scrypt', 'leap.soledad', 'IPython']
a = Analysis(ENTRYPOINT,
binaries=None,
@@ -32,8 +33,7 @@ a = Analysis(ENTRYPOINT,
hiddenimports=hiddenimports,
hookspath=[],
runtime_hooks=[],
- excludes=[],
-
+ excludes=excludes,
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
@@ -55,3 +55,12 @@ coll = COLLECT(exe,
strip=False,
upx=True,
name='anonvpn')
+if IS_MAC:
+ app = BUNDLE(
+ coll,
+ name=os.path.join(
+ 'dist', 'RiseupVPN.app'),
+ appname='RiseupVPN',
+ version=BITMASK_VERSION,
+ icon='pkg/branding/riseupvpn.icns',
+ bundle_identifier='RiseupVPN-' + BITMASK_VERSION)
diff --git a/src/leap/bitmask/gui/anonvpn.py b/src/leap/bitmask/gui/anonvpn.py
index 3c1d0458..4884510f 100644
--- a/src/leap/bitmask/gui/anonvpn.py
+++ b/src/leap/bitmask/gui/anonvpn.py
@@ -30,6 +30,7 @@ import sys
from functools import partial
from multiprocessing import Process
+from leap.bitmask.util import here
from leap.bitmask.core.launcher import run_bitmaskd, pid
from leap.bitmask.gui.housekeeping import cleanup, terminate, reset_authtoken
from leap.bitmask.gui.housekeeping import check_stale_pidfile
@@ -43,7 +44,7 @@ bitmaskd = None
def launch_gui():
from leap.bitmask.util import STANDALONE
if STANDALONE:
- gui = './bitmask-systray'
+ gui = os.path.join(here(), 'bitmask-systray')
else:
gui = 'bitmask-systray'
subprocess.call([gui])
diff --git a/src/leap/bitmask/vpn/launchers/darwin.py b/src/leap/bitmask/vpn/launchers/darwin.py
index e454a2ff..03393da2 100644
--- a/src/leap/bitmask/vpn/launchers/darwin.py
+++ b/src/leap/bitmask/vpn/launchers/darwin.py
@@ -43,7 +43,7 @@ class HelperCommand(object):
try:
self._sock.connect(self.SOCKET_ADDR)
except socket.error, msg:
- raise RuntimeError(msg)
+ raise RuntimeError('Cannot connect to helper: ' + msg)
def send(self, cmd, args=''):
self._connect()