summaryrefslogtreecommitdiff
path: root/pkg/pyinst
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-05-18 12:13:52 -0400
committerKali Kaneko <kali@leap.se>2016-05-18 12:13:52 -0400
commit90aa7a275c41af130dcddaefd798ae35c505b6d5 (patch)
tree95441aa18d1022eea56d9348e0c32f392bb674ea /pkg/pyinst
parentaecb13feed8797acaa3f91be45a82a52b64d4723 (diff)
parentfacefed990195bd89bf1064e75b171edd084f632 (diff)
Merge tag '0.9.2'
Tag leap.bitmask version 0.9.2
Diffstat (limited to 'pkg/pyinst')
-rw-r--r--pkg/pyinst/README.rst17
-rw-r--r--pkg/pyinst/bitmask.spec41
-rw-r--r--pkg/pyinst/bitmask.spec.orig38
l---------pkg/pyinst/bitmask_cli1
-rw-r--r--pkg/pyinst/bitmask_cli.spec32
l---------pkg/pyinst/bitmaskd1
-rw-r--r--pkg/pyinst/bitmaskd.spec33
-rw-r--r--pkg/pyinst/multi.spec75
-rw-r--r--pkg/pyinst/pyinst-build.mk98
-rw-r--r--pkg/pyinst/qt.conf2
-rw-r--r--pkg/pyinst/trim-notes.txt12
11 files changed, 339 insertions, 11 deletions
diff --git a/pkg/pyinst/README.rst b/pkg/pyinst/README.rst
new file mode 100644
index 00000000..b6784a52
--- /dev/null
+++ b/pkg/pyinst/README.rst
@@ -0,0 +1,17 @@
+Building da bundles
+--------------------
+Because, you know, bundles are cool. Who needs a decent package manager nowadays? </rant>.
+
+You need a couple of things in your virtualenv:
+
+- All the dependencies. A sumo tarball is probably a good idea.
+- PyInstaller. Version 3 or higher.
+- A PySide build. While the postmkenv.sh hack is good enough for
+ developing, you will need a wheel built with --standalone flag.
+ See
+ http://pyside.readthedocs.org/en/latest/building/linux.html#building-pyside-distribution::
+
+ $ python2.7 setup.py bdist_wheel --qmake=/usr/bin/qmake-qt4 --standalone
+
+ (since this takes a while, you can probably grab the already built wheel from
+ the leap servers).
diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec
index 2bc2f9d2..8c6561cf 100644
--- a/pkg/pyinst/bitmask.spec
+++ b/pkg/pyinst/bitmask.spec
@@ -1,31 +1,49 @@
# -*- mode: python -*-
+import sys
block_cipher = None
-
-a = Analysis([os.path.join('pkg', 'pyinst', 'bitmask.py')],
+# TODO remove QtWebKit for bundles that don't ship pixelated???
+a = Analysis(['bitmask.py'],
hiddenimports=[
- 'zope.interface', 'zope.proxy',
- 'PySide.QtCore', 'PySide.QtGui'],
+ 'zope.interface', 'zope.proxy',
+ 'PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit',
+ 'pysqlcipher', 'service_identity',
+ 'leap.common', 'leap.bitmask'
+ ],
+ binaries=None,
+ datas=None,
hookspath=None,
runtime_hooks=None,
excludes=None,
+ win_no_prefer_redirects=None,
+ win_private_assemblies=None,
cipher=block_cipher)
-pyz = PYZ(a.pure,
+pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
+
+# Binary files you need to include in the form of:
+# (<destination>, <source>, '<TYPE>')
+
+# Data files you want to include, in the form of:
+# (<destination>, <source>, '<TYPE>')
+data = [
+ ('qt.conf', 'qt.conf', 'DATA')
+]
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='bitmask',
- debug=False,
- strip=False,
+ debug=True,
+ strip=None,
upx=True,
- console=False )
+ console=False,
+ icon='../../data/images/mask-icon.ico')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
- strip=False,
+ strip=None,
upx=True,
name='bitmask')
if sys.platform.startswith("darwin"):
@@ -33,6 +51,7 @@ if sys.platform.startswith("darwin"):
name=os.path.join(
'dist', 'Bitmask.app'),
appname='Bitmask',
- version='0.9.0rc2',
+ # TODO get this from ../next-version.txt
+ version='0.9.0.rc1',
icon='pkg/osx/bitmask.icns',
- bundle_identifier='bitmask-0.9.0rc2')
+ bundle_identifier='bitmask-0.9.0alpha7')
diff --git a/pkg/pyinst/bitmask.spec.orig b/pkg/pyinst/bitmask.spec.orig
new file mode 100644
index 00000000..617104b9
--- /dev/null
+++ b/pkg/pyinst/bitmask.spec.orig
@@ -0,0 +1,38 @@
+# -*- mode: python -*-
+
+block_cipher = None
+
+
+a = Analysis([os.path.join('bitmask.py')],
+ hiddenimports=[
+ 'zope.interface', 'zope.proxy',
+ 'PySide.QtCore', 'PySide.QtGui'],
+ hookspath=None,
+ runtime_hooks=None,
+ excludes=None,
+ cipher=block_cipher)
+pyz = PYZ(a.pure,
+ cipher=block_cipher)
+exe = EXE(pyz,
+ a.scripts,
+ exclude_binaries=True,
+ name='bitmask',
+ debug=False,
+ strip=False,
+ upx=True,
+ console=False )
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=True,
+ name='bitmask')
+if sys.platform.startswith("darwin"):
+ app = BUNDLE(coll,
+ name=os.path.join(
+ 'dist', 'Bitmask.app'),
+ appname='Bitmask',
+ version='0.9.0rc2',
+ icon='pkg/osx/bitmask.icns',
+ bundle_identifier='bitmask-0.9.0rc2')
diff --git a/pkg/pyinst/bitmask_cli b/pkg/pyinst/bitmask_cli
new file mode 120000
index 00000000..7842f03b
--- /dev/null
+++ b/pkg/pyinst/bitmask_cli
@@ -0,0 +1 @@
+../../src/leap/bitmask/cli/bitmask_cli.py \ No newline at end of file
diff --git a/pkg/pyinst/bitmask_cli.spec b/pkg/pyinst/bitmask_cli.spec
new file mode 100644
index 00000000..5157e179
--- /dev/null
+++ b/pkg/pyinst/bitmask_cli.spec
@@ -0,0 +1,32 @@
+# -*- mode: python -*-
+
+block_cipher = None
+
+
+a = Analysis(['bitmask_cli'],
+ pathex=['/home/kali/leap/bitmask_client/pkg/pyinst'],
+ binaries=None,
+ datas=None,
+ hiddenimports=[],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher)
+pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
+exe = EXE(pyz,
+ a.scripts,
+ exclude_binaries=True,
+ name='bitmask_cli',
+ debug=False,
+ strip=False,
+ upx=True,
+ console=True )
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=True,
+ name='bitmask_cli')
diff --git a/pkg/pyinst/bitmaskd b/pkg/pyinst/bitmaskd
new file mode 120000
index 00000000..c5b08597
--- /dev/null
+++ b/pkg/pyinst/bitmaskd
@@ -0,0 +1 @@
+../../src/leap/bitmask/core/launcher.py \ No newline at end of file
diff --git a/pkg/pyinst/bitmaskd.spec b/pkg/pyinst/bitmaskd.spec
new file mode 100644
index 00000000..4e2e2d6a
--- /dev/null
+++ b/pkg/pyinst/bitmaskd.spec
@@ -0,0 +1,33 @@
+# -*- mode: python -*-
+
+block_cipher = None
+
+
+a = Analysis(['bitmaskd'],
+ pathex=['/home/kali/leap/bitmask_client/pkg/pyinst'],
+ binaries=None,
+ datas=None,
+ hiddenimports=[],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher)
+pyz = PYZ(a.pure, a.zipped_data,
+ cipher=block_cipher)
+exe = EXE(pyz,
+ a.scripts,
+ exclude_binaries=True,
+ name='bitmaskd',
+ debug=False,
+ strip=False,
+ upx=True,
+ console=True )
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=True,
+ name='bitmaskd')
diff --git a/pkg/pyinst/multi.spec b/pkg/pyinst/multi.spec
new file mode 100644
index 00000000..aa5c83c0
--- /dev/null
+++ b/pkg/pyinst/multi.spec
@@ -0,0 +1,75 @@
+
+# -*- mode: python -*-
+
+block_cipher = None
+
+
+gui_a = Analysis(['bitmask.py'],
+ hiddenimports=[
+ 'zope.interface', 'zope.proxy',
+ 'PySide.QtCore', 'PySide.QtGui'],
+ hookspath=None,
+ runtime_hooks=None,
+ excludes=None,
+ cipher=block_cipher)
+cli_a = Analysis(['bitmask_cli'],
+ binaries=None,
+ datas=None,
+ hiddenimports=[
+ 'zope.interface', 'zope.proxy'],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher)
+daemon_a = Analysis(['bitmaskd'],
+ binaries=None,
+ datas=None,
+ hiddenimports=[
+ 'leap.bitmask.core.service'],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher)
+
+MERGE( (gui_a, 'bitmask', 'bitmask'),
+ (cli_a, 'bitmask_cli', 'bitmask'),
+ (daemon_a, 'bitmaskd', 'bitmaskd'))
+
+gui_pyz = PYZ(gui_a.pure, gui_a.zipped_data, cipher=block_cipher)
+gui_exe = EXE(gui_pyz,
+ gui_a.scripts,
+ exclude_binaries=True,
+ name='bitmask', debug=False, strip=False,
+ upx=True, console=False )
+
+cli_pyz = PYZ(cli_a.pure, cli_a.zipped_data, cipher=block_cipher)
+cli_exe = EXE(cli_pyz,
+ cli_a.scripts,
+ exclude_binaries=True,
+ name='bitmask_cli', debug=False, strip=False,
+ upx=True, console=True)
+daemon_pyz = PYZ(daemon_a.pure, daemon_a.zipped_data, cipher=block_cipher)
+daemon_exe = EXE(daemon_pyz,
+ daemon_a.scripts,
+ exclude_binaries=True,
+ name='bitmaskd', debug=False, strip=False, upx=True, console=True )
+
+gui_coll = COLLECT(gui_exe,
+ gui_a.binaries,
+ gui_a.zipfiles,
+ gui_a.datas,
+ strip=False, upx=True, name='bitmask')
+cli_coll = COLLECT(cli_exe,
+ cli_a.binaries,
+ cli_a.zipfiles,
+ cli_a.datas,
+ strip=False, upx=True, name='bitmask_cli')
+daemon_coll = COLLECT(daemon_exe,
+ daemon_a.binaries,
+ daemon_a.zipfiles,
+ daemon_a.datas,
+ strip=False, upx=True, name='bitmaskd')
diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk
new file mode 100644
index 00000000..32239f8e
--- /dev/null
+++ b/pkg/pyinst/pyinst-build.mk
@@ -0,0 +1,98 @@
+freeze-ver:
+ cp pkg/version-template src/leap/bitmask/_version.py
+ sed -i 's/^version_version\(.*\)/version_version = "$(NEXT_VERSION)"/' src/leap/bitmask/_version.py
+ sed -i "s/^full_revisionid\(.*\)/full_revisionid='$(GIT_COMMIT)'/" src/leap/bitmask/_version.py
+
+freeze-ver-osx:
+ cp pkg/version-template src/leap/bitmask/_version.py
+ sed -i ' ' 's/^version_version\(.*\)/version_version = "$(NEXT_VERSION)"/' src/leap/bitmask/_version.py
+ sed -i ' ' "s/^full_revisionid\(.*\)/full_revisionid='$(GIT_COMMIT)'/" src/leap/bitmask/_version.py
+
+hash-binaries:
+ OPENVPN_BIN=$(LEAP_BUILD_DIR)openvpn BITMASK_ROOT=pkg/linux/bitmask-root python setup.py hash_binaries
+
+pyinst: freeze-ver hash-binaries
+ pyinstaller -y pkg/pyinst/bitmask.spec
+
+pyinst_osx: freeze-ver-osx hash-binaries
+ pyinstaller -y pkg/pyinst/bitmask.spec
+
+reset-ver:
+ git checkout -- src/leap/bitmask/_version.py
+
+pyinst-hacks-linux:
+ # XXX this should be taken care of by pyinstaller data collector
+ cp ../leap_common/src/leap/common/cacert.pem $(DIST)
+ mkdir -p $(DIST)pysqlcipher
+ mkdir -p $(DIST)pixelated
+ mkdir -p $(DIST)twisted/web
+ cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/pysqlcipher/_sqlite.so $(DIST)pysqlcipher
+ cp -r $(VIRTUAL_ENV)/lib/python2.7/site-packages/pixelated_www $(DIST)
+ cp -r $(VIRTUAL_ENV)/lib/python2.7/site-packages/pixelated/assets/ $(DIST)pixelated
+ cp -r $(VIRTUAL_ENV)/lib/python2.7/site-packages/twisted/web/failure.xhtml $(DIST)twisted/web/
+
+pyinst-hacks-osx:
+ # XXX this should be taken care of by pyinstaller data collector
+ cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/leap/common/cacert.pem $(DIST)
+ cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/leap/common/cacert.pem $(DIST_OSX)Contents/MacOS/
+ mv $(DIST_OSX)Contents/MacOS/bitmask $(DIST_OSX)Contents/MacOS/bitmask-app
+ cp pkg/osx/bitmask-wrapper $(DIST_OSX)Contents/MacOS/bitmask
+ # XXX need the rest???
+
+pyinst-trim:
+ rm -f $(DIST)libQtOpenGL.so.4
+ rm -f $(DIST)libQtSql.so.4
+ rm -f $(DIST)libQt3Support.so.4
+ rm -f $(DIST)libaudio.so.2
+ rm -f $(DIST)libnvidia-*
+
+pyinst-cleanup:
+ rm -rf $(DIST)config
+ mkdir -p $(DIST_VERSION)
+ mv $(DIST) $(DIST_VERSION)lib
+ cd pkg/launcher && make
+ mv pkg/launcher/bitmask $(DIST_VERSION)
+
+pyinst-distribution-data:
+ cp release-notes.rst $(DIST_VERSION)
+ cp LICENSE $(DIST_VERSION)
+
+pyinst-helpers-linux:
+ mkdir -p $(DIST_VERSION)apps/eip/files
+ cp $(LEAP_BUILD_DIR)openvpn $(DIST_VERSION)apps/eip/files/leap-openvpn
+ cp pkg/linux/bitmask-root $(DIST_VERSION)apps/eip/files/
+ cp pkg/linux/leap-install-helper.sh $(DIST_VERSION)apps/eip/files/
+ cp pkg/linux/polkit/se.leap.bitmask.bundle.policy $(DIST_VERSION)apps/eip/files/
+ mkdir -p $(DIST_VERSION)apps/mail
+ cp $(LEAP_BUILD_DIR)gpg $(DIST_VERSION)apps/mail
+
+pyinst-helpers-osx:
+ mkdir -p $(DIST_OSX_RES)bitmask-helper
+ mkdir -p $(DIST_OSX)Contents/MacOS/apps/mail
+ cp pkg/osx/client.up.sh $(DIST_OSX_RES)
+ cp pkg/osx/client.down.sh $(DIST_OSX_RES)
+ cp pkg/osx/bitmask-helper $(DIST_OSX_RES)bitmask-helper/
+ cp pkg/osx/bitmask.pf.conf $(DIST_OSX_RES)bitmask-helper/
+ cp pkg/osx/se.leap.bitmask-helper.plist $(DIST_OSX_RES)bitmask-helper/
+ cp pkg/osx/post-inst.sh $(DIST_OSX_RES)bitmask-helper/
+ cp pkg/osx/daemon/daemon.py $(DIST_OSX_RES)bitmask-helper/
+ cp /opt/homebrew-cask/Caskroom/tuntap/20150118/tuntap_20150118.pkg $(DIST_OSX_RES)
+ # TODO make the build script put it there
+ cp $(LEAP_BUILD_DIR)openvpn.leap.polarssl $(DIST_OSX_RES)openvpn.leap
+ cp $(LEAP_BUILD_DIR)gpg $(DIST_OSX)Contents/MacOS/apps/mail/
+
+pyinst-tar:
+ cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION)
+
+pyinst-sign:
+ gpg2 -a --sign --detach-sign dist/Bitmask.$(NEXT_VERSION).tar.gz
+
+pyinst-upload:
+ rsync --rsh='ssh' -avztlpog --progress --partial dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./
+
+pyinst-linux: pyinst reset-ver pyinst-hacks-linux pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-helpers-linux pyinst-tar
+
+pyinst-osx: pyinst_osx reset-ver pyinst-hacks-osx pyinst-helpers-osx
+
+clean_pkg:
+ rm -rf build dist
diff --git a/pkg/pyinst/qt.conf b/pkg/pyinst/qt.conf
new file mode 100644
index 00000000..7eecd342
--- /dev/null
+++ b/pkg/pyinst/qt.conf
@@ -0,0 +1,2 @@
+[Paths]
+Plugins=qt4_plugins \ No newline at end of file
diff --git a/pkg/pyinst/trim-notes.txt b/pkg/pyinst/trim-notes.txt
new file mode 100644
index 00000000..2d825760
--- /dev/null
+++ b/pkg/pyinst/trim-notes.txt
@@ -0,0 +1,12 @@
+88M
+-------------
+libaudio.so.2
+libQt3Support.so.4
+libQtNetwork.so.4
+libtiff.so.5
+libQtSvg.so.4
+libQtXml.so.4
+libQtSql.so.4
+libQtOpenGL.so.4
+libnvidia-glcore.so.352.79
+PySide.QtNetwork.x86_64-linux-gnu.so