From 7133000f82b79470fa91c42b286fffeeece28631 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 28 Mar 2016 12:24:48 -0400 Subject: [pkg] update versions for bundle --- pkg/pyinst/bitmask.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec index 2bc2f9d2..a76ccb17 100644 --- a/pkg/pyinst/bitmask.spec +++ b/pkg/pyinst/bitmask.spec @@ -1,12 +1,13 @@ # -*- mode: python -*- +import sys block_cipher = None -a = Analysis([os.path.join('pkg', 'pyinst', 'bitmask.py')], +a = Analysis([os.path.join('bitmask.py')], hiddenimports=[ 'zope.interface', 'zope.proxy', - 'PySide.QtCore', 'PySide.QtGui'], + 'PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit'], hookspath=None, runtime_hooks=None, excludes=None, @@ -33,6 +34,6 @@ if sys.platform.startswith("darwin"): name=os.path.join( 'dist', 'Bitmask.app'), appname='Bitmask', - version='0.9.0rc2', + version='0.9.2alpha1', icon='pkg/osx/bitmask.icns', - bundle_identifier='bitmask-0.9.0rc2') + bundle_identifier='bitmask-0.9.2alpha1') -- cgit v1.2.3 From b4dde3d5112c95574f85f62daf0c2c75db391f52 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 4 Apr 2016 22:19:52 -0400 Subject: [pkg] modularize main makefile to remove clutter --- pkg/pyinst/pyinst-build.mk | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pkg/pyinst/pyinst-build.mk (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk new file mode 100644 index 00000000..532ec88c --- /dev/null +++ b/pkg/pyinst/pyinst-build.mk @@ -0,0 +1,39 @@ +pyinst: + echo "MAKE SURE OF FREEZING VERSION FIRST!" + pyinstaller -y pkg/pyinst/bitmask.spec + +pyinst-hacks: + cp ../leap_common/src/leap/common/cacert.pem $(DIST) + mkdir -p $(DIST)pysqlcipher + 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) + +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-* + #rm -f dist/bitmask/libgstvideo-1.0.so.0 + #rm -f dist/bitmask/libgstaudio0.0.so.0 + #rm -f dist/bitmask/libgstreamer-1.0.so.0 + +pyinst-wrapper: + mv $(DIST)libQtCore.so.4 $(DIST)libQtCore.so.4.orig + mv $(DIST)libQtGui.so.4 $(DIST)libQtGui.so.4.orig + mv $(DIST)libQtNetwork.so.4 $(DIST)libQtNetwork.so.4.orig + mv $(DIST)libQtSvg.so.4 $(DIST)libQtSvg.so.4.orig + mv $(DIST)libQtWebKit.so.4 $(DIST)libQtWebKit.so.4.orig + mv $(DIST)libQtXmlPatterns.so.4 $(DIST)libQtXmlPatterns.so.4.orig + mv $(DIST)libQtXml.so.4 $(DIST)libQtXml.so.4.orig + mv $(DIST)bitmask $(DIST)bitmask-app + cp pkg/linux/bitmask-launcher $(DIST)bitmask + cp pkg/PixelatedWebmail.README $(DIST) + + +pyinst-dist: + rm -rf $(DIST)config + cd dist/ && tar cvzf Bitmask.0.9.2.alpha2.tar.gz bitmask + +clean_pkg: + rm -rf build dist -- cgit v1.2.3 From c35d9f6338300dcf6f1688ee2df9475dd14b8c94 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 4 Apr 2016 22:49:56 -0400 Subject: [pkg] move the pyinstaller bundle to a child folder --- pkg/pyinst/pyinst-build.mk | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 532ec88c..637390a8 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -1,5 +1,7 @@ pyinst: - echo "MAKE SURE OF FREEZING VERSION FIRST!" + echo "*********************************************" + echo "MAKE SURE OF MANUALLY FREEZING VERSION FIRST!" + echo "*********************************************" pyinstaller -y pkg/pyinst/bitmask.spec pyinst-hacks: @@ -19,6 +21,7 @@ pyinst-trim: #rm -f dist/bitmask/libgstreamer-1.0.so.0 pyinst-wrapper: + # TODO this *is* an ugly hack, See #7352 mv $(DIST)libQtCore.so.4 $(DIST)libQtCore.so.4.orig mv $(DIST)libQtGui.so.4 $(DIST)libQtGui.so.4.orig mv $(DIST)libQtNetwork.so.4 $(DIST)libQtNetwork.so.4.orig @@ -28,12 +31,26 @@ pyinst-wrapper: mv $(DIST)libQtXml.so.4 $(DIST)libQtXml.so.4.orig mv $(DIST)bitmask $(DIST)bitmask-app cp pkg/linux/bitmask-launcher $(DIST)bitmask - cp pkg/PixelatedWebmail.README $(DIST) - -pyinst-dist: +pyinst-cleanup: rm -rf $(DIST)config - cd dist/ && tar cvzf Bitmask.0.9.2.alpha2.tar.gz bitmask + mkdir -p $(DIST_VERSION) + mv $(DIST) $(DIST_VERSION)libs + cd pkg/launcher && make + mv pkg/launcher/bitmask $(DIST_VERSION) + +pyinst-distribution-data: + cp release-notes.rst $(DIST_VERSION) + cp pkg/PixelatedWebmail.README $(DIST_VERSION) + cp LICENSE $(DIST_VERSION) + +pyinst-tar: + cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) + +pyinst-sign: + # TODO ---- get LEAP_MAINTAINER from environment + +pyinst-linux: pyinst pyinst-hacks pyinst-trim pyinst-wrapper pyinst-cleanup pyinst-distribution-data pyinst-tar clean_pkg: rm -rf build dist -- cgit v1.2.3 From 40604c0b2abe4d51e5e7b41a0e71c78a958b0b87 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 6 Apr 2016 16:02:11 -0400 Subject: [pkg] copy helpers, freeze version --- pkg/pyinst/pyinst-build.mk | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 637390a8..a14f2a8d 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -1,9 +1,14 @@ -pyinst: - echo "*********************************************" - echo "MAKE SURE OF MANUALLY FREEZING VERSION FIRST!" - echo "*********************************************" +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 + +pyinst: freeze-ver pyinstaller -y pkg/pyinst/bitmask.spec +reset-ver: + git checkout -- src/leap/bitmask/_version.py + pyinst-hacks: cp ../leap_common/src/leap/common/cacert.pem $(DIST) mkdir -p $(DIST)pysqlcipher @@ -44,13 +49,28 @@ pyinst-distribution-data: cp pkg/PixelatedWebmail.README $(DIST_VERSION) cp LICENSE $(DIST_VERSION) +pyinst-linux-helpers: + mkdir -p $(DIST_VERSION)apps/eip/files + # TODO compile static + cp /usr/sbin/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 + # TODO compile static + cp /usr/bin/gpg $(DIST_VERSION)apps/mail + pyinst-tar: cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) pyinst-sign: - # TODO ---- get LEAP_MAINTAINER from environment + gpg2 -a --sign --detach-sign dist/Bitmask.$(NEXT_VERSION).tar.gz + +pyinst-upload: + scp dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./ -pyinst-linux: pyinst pyinst-hacks pyinst-trim pyinst-wrapper pyinst-cleanup pyinst-distribution-data pyinst-tar +#pyinst-linux: pyinst pyinst-hacks pyinst-trim pyinst-wrapper pyinst-cleanup pyinst-distribution-data pyinst-tar +pyinst-linux: pyinst reset-ver pyinst-hacks pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-linux-helpers pyinst-tar clean_pkg: rm -rf build dist -- cgit v1.2.3 From 8836413ae5d0d22bca3c512ff4164d7559f9ada9 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 6 Apr 2016 16:07:29 -0400 Subject: typo: mimmick older bundles path --- pkg/pyinst/pyinst-build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index a14f2a8d..16737ead 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -40,7 +40,7 @@ pyinst-wrapper: pyinst-cleanup: rm -rf $(DIST)config mkdir -p $(DIST_VERSION) - mv $(DIST) $(DIST_VERSION)libs + mv $(DIST) $(DIST_VERSION)lib cd pkg/launcher && make mv pkg/launcher/bitmask $(DIST_VERSION) -- cgit v1.2.3 From 5fc9a8c68216bcdd7a4d847e75bac428aafda5e4 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 11 Apr 2016 17:49:01 -0400 Subject: [bug] hash the installed binaries this was the cause for the previous alpha releases keep insisting on re-installing the helper files. - Resolves: #7989 - Releases: 0.9.2 --- pkg/pyinst/pyinst-build.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 16737ead..348395cc 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -3,7 +3,11 @@ freeze-ver: 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 -pyinst: freeze-ver +hash-binaries: + # TODO get from a build dir + OPENVPN_BIN=/usr/sbin/openvpn BITMASK_ROOT=pkg/linux/bitmask-root python setup.py hash_binaries + +pyinst: freeze-ver hash-binaries pyinstaller -y pkg/pyinst/bitmask.spec reset-ver: -- cgit v1.2.3 From f05ec77ae21f8b01f20267c129307c91683c74d7 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 11 Apr 2016 17:55:19 -0400 Subject: [pkg] remove wrapper hacks, not needed anymore --- pkg/pyinst/pyinst-build.mk | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 348395cc..cbbef198 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -29,18 +29,6 @@ pyinst-trim: #rm -f dist/bitmask/libgstaudio0.0.so.0 #rm -f dist/bitmask/libgstreamer-1.0.so.0 -pyinst-wrapper: - # TODO this *is* an ugly hack, See #7352 - mv $(DIST)libQtCore.so.4 $(DIST)libQtCore.so.4.orig - mv $(DIST)libQtGui.so.4 $(DIST)libQtGui.so.4.orig - mv $(DIST)libQtNetwork.so.4 $(DIST)libQtNetwork.so.4.orig - mv $(DIST)libQtSvg.so.4 $(DIST)libQtSvg.so.4.orig - mv $(DIST)libQtWebKit.so.4 $(DIST)libQtWebKit.so.4.orig - mv $(DIST)libQtXmlPatterns.so.4 $(DIST)libQtXmlPatterns.so.4.orig - mv $(DIST)libQtXml.so.4 $(DIST)libQtXml.so.4.orig - mv $(DIST)bitmask $(DIST)bitmask-app - cp pkg/linux/bitmask-launcher $(DIST)bitmask - pyinst-cleanup: rm -rf $(DIST)config mkdir -p $(DIST_VERSION) @@ -73,7 +61,6 @@ pyinst-sign: pyinst-upload: scp dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./ -#pyinst-linux: pyinst pyinst-hacks pyinst-trim pyinst-wrapper pyinst-cleanup pyinst-distribution-data pyinst-tar pyinst-linux: pyinst reset-ver pyinst-hacks pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-linux-helpers pyinst-tar clean_pkg: -- cgit v1.2.3 From ed7c2bdf2efc2ce4e0ef4d761d9470604efa9969 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 11 Apr 2016 18:01:42 -0400 Subject: [docs] add some important info about building bundles --- pkg/pyinst/README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pkg/pyinst/README.rst (limited to 'pkg/pyinst') 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? . + +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). -- cgit v1.2.3 From 054e337ecf18e0a3ddd1d5568bfbdef507a3d136 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 14 Apr 2016 15:37:14 -0400 Subject: [bug] add missing assets for pixelated --- pkg/pyinst/pyinst-build.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index cbbef198..2c2fe45a 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -16,8 +16,10 @@ reset-ver: pyinst-hacks: cp ../leap_common/src/leap/common/cacert.pem $(DIST) mkdir -p $(DIST)pysqlcipher + mkdir -p $(DIST)pixelated 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 pyinst-trim: rm -f $(DIST)libQtOpenGL.so.4 -- cgit v1.2.3 From b4de087fee85b7831b70cde31e7ed34f196a5ca9 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 14 Apr 2016 15:38:39 -0400 Subject: [bug] add twisted.web.failure.xhtml --- pkg/pyinst/pyinst-build.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 2c2fe45a..b6a7a6f3 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -17,9 +17,11 @@ pyinst-hacks: 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-trim: rm -f $(DIST)libQtOpenGL.so.4 -- cgit v1.2.3 From c201029c3070da1bd9c2a7d65ac426e49f3cc241 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 14 Apr 2016 15:40:05 -0400 Subject: [pkg] ship statically built binaries - mention the versions in the next relnotes - add the leap_thirdparty_build to gitignore. the build scripts are supposed to place the binaries here. --- pkg/pyinst/pyinst-build.mk | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index b6a7a6f3..9120e7a1 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -4,8 +4,7 @@ freeze-ver: sed -i 's/^full_revisionid\(.*\)/full_revisionid = "$(GIT_COMMIT)"/' src/leap/bitmask/_version.py hash-binaries: - # TODO get from a build dir - OPENVPN_BIN=/usr/sbin/openvpn BITMASK_ROOT=pkg/linux/bitmask-root python setup.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 @@ -47,14 +46,12 @@ pyinst-distribution-data: pyinst-linux-helpers: mkdir -p $(DIST_VERSION)apps/eip/files - # TODO compile static - cp /usr/sbin/openvpn $(DIST_VERSION)apps/eip/files/leap-openvpn + 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 - # TODO compile static - cp /usr/bin/gpg $(DIST_VERSION)apps/mail + cp $(LEAP_BUILD_DIR)gpg $(DIST_VERSION)apps/mail pyinst-tar: cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) -- cgit v1.2.3 From 249864008ae8640042573bd6dfc42b6ce28324e8 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 14 Apr 2016 18:49:26 -0400 Subject: [tools] make uploads resumable --- pkg/pyinst/pyinst-build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 9120e7a1..9595ad50 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -60,7 +60,7 @@ pyinst-sign: gpg2 -a --sign --detach-sign dist/Bitmask.$(NEXT_VERSION).tar.gz pyinst-upload: - scp dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./ + rsync --rsh='ssh' -avztlpog --progress --partial dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./ pyinst-linux: pyinst reset-ver pyinst-hacks pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-linux-helpers pyinst-tar -- cgit v1.2.3 From 0a5d24d64b5f637038a15b01bbe1b3d4bf4108f2 Mon Sep 17 00:00:00 2001 From: Paixu Aabuizia Date: Sun, 10 Jan 2016 15:40:35 +0100 Subject: [pkg] reproducible windows installer for bitmask_client provide a environment that allows automated builds of windows installers - prepare dockerized environment with wine, python, openssl, zlib and mingw to build windows binaries from python sourcecode - prepare dockerized environment with nullsoft installer to build installers from binaries - configure pyinstaller to build binaries - configure nsis to build distributable executables for bitmask - configure make all in pkg/windows that results in installers - add documentation - ico conversion from data/images - avoid polluting / in docker image - install dirspec and copy to wine env - remove obsolete comments - fix python path - figure out that pip install leap.a and pyinstalling a leap.b does not work - so the build script fixes that - rename dependencies to pyinstaller and move nsis code to installer - build openvpn, export the binaries for further processing - correct openvpn dependencies, fetch tap installer compatible with openvpn just built - install tap-driver with nsis - pyinstaller-build: fix mixed mkdir / show errors if there are some - installer-build: prepare rw-copy, do not expose nsh files - add openvpn_leap.exe to install directory so it gets picked up by nsis - use setup.py to install bitmask to site-packages to have a version - separate build directories for granular make - copy all openvpn dlls to installer - die to signal failure to parent makefile - cache installDependencies for quick turn-arround times - share openssl version between openvpn and pysqlcipher/other pip builds - collect files during prepare for installer - default to eip:false, mail:true - configuration in pyinstaller-build.sh - win64 tap drivers need special care getting removed from 32bit nsis - correct registry key that identifies if we installed TAP - extract version from git-tree, expose to wine python - create nsh with version for build installer - allow clean/dirty version with patches - cleanup / indent / remove comments - die when pysqlchipher patch failed - add psutil in mingw compatible version --- pkg/pyinst/bitmask.spec | 30 +++++++++++++++++++++++------- pkg/pyinst/qt.conf | 2 ++ 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 pkg/pyinst/qt.conf (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec index a76ccb17..cd207816 100644 --- a/pkg/pyinst/bitmask.spec +++ b/pkg/pyinst/bitmask.spec @@ -3,17 +3,32 @@ import sys block_cipher = None - -a = Analysis([os.path.join('bitmask.py')], +a = Analysis(['bitmask.py'], hiddenimports=[ - 'zope.interface', 'zope.proxy', - 'PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit'], + 'zope.interface', 'zope.proxy', + 'PySide.QtCore', 'PySide.QtGui', + '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: +# (, , '') + +# Data files you want to include, in the form of: +# (, , '') +data = [ + ('qt.conf', 'qt.conf', 'DATA') +] exe = EXE(pyz, a.scripts, exclude_binaries=True, @@ -21,12 +36,13 @@ exe = EXE(pyz, debug=False, strip=False, 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"): 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 -- cgit v1.2.3 From 748dea614050dca9d1baf8e6b36900109066b2bb Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 11 Sep 2015 07:44:14 -0700 Subject: [pkg] packaging hacks + update osx bundling notes --- pkg/pyinst/bitmask.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec index cd207816..149093eb 100644 --- a/pkg/pyinst/bitmask.spec +++ b/pkg/pyinst/bitmask.spec @@ -33,8 +33,8 @@ exe = EXE(pyz, a.scripts, exclude_binaries=True, name='bitmask', - debug=False, - strip=False, + debug=True, + strip=None, upx=True, console=False, icon='../../data/images/mask-icon.ico') @@ -50,6 +50,6 @@ if sys.platform.startswith("darwin"): name=os.path.join( 'dist', 'Bitmask.app'), appname='Bitmask', - version='0.9.2alpha1', + version='0.9.0rc4', icon='pkg/osx/bitmask.icns', - bundle_identifier='bitmask-0.9.2alpha1') + bundle_identifier='bitmask-0.9.0rc4') -- cgit v1.2.3 From e9e9abc4ec26be29b3a6b09e6a0b67786269183b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 29 Jan 2016 13:18:36 -0800 Subject: [feature] privileged bitmask helper This is still quite untested, and a bit hacky, but the main idea behind let us have a daemonized bitmask helper, that should be installed by the Bitmask installer. Its responsibilities are to launch the vpn process as a privileged user, and start/stop the firewall. --- pkg/pyinst/bitmask.spec.orig | 38 +++++++ pkg/pyinst/cryptography/osrandom_engine.c | 167 ++++++++++++++++++++++++++++++ pkg/pyinst/cryptography/osrandom_engine.h | 6 ++ 3 files changed, 211 insertions(+) create mode 100644 pkg/pyinst/bitmask.spec.orig create mode 100644 pkg/pyinst/cryptography/osrandom_engine.c create mode 100644 pkg/pyinst/cryptography/osrandom_engine.h (limited to 'pkg/pyinst') 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/cryptography/osrandom_engine.c b/pkg/pyinst/cryptography/osrandom_engine.c new file mode 100644 index 00000000..27894712 --- /dev/null +++ b/pkg/pyinst/cryptography/osrandom_engine.c @@ -0,0 +1,167 @@ +static const char *Cryptography_osrandom_engine_id = "osrandom"; +static const char *Cryptography_osrandom_engine_name = "osrandom_engine"; + +#if defined(_WIN32) +static HCRYPTPROV hCryptProv = 0; + +static int osrandom_init(ENGINE *e) { + if (hCryptProv > 0) { + return 1; + } + if (CryptAcquireContext(&hCryptProv, NULL, NULL, + PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { + return 1; + } else { + return 0; + } +} + +static int osrandom_rand_bytes(unsigned char *buffer, int size) { + if (hCryptProv == 0) { + return 0; + } + + if (!CryptGenRandom(hCryptProv, (DWORD)size, buffer)) { + ERR_put_error( + ERR_LIB_RAND, 0, ERR_R_RAND_LIB, "osrandom_engine.py", 0 + ); + return 0; + } + return 1; +} + +static int osrandom_finish(ENGINE *e) { + if (CryptReleaseContext(hCryptProv, 0)) { + hCryptProv = 0; + return 1; + } else { + return 0; + } +} + +static int osrandom_rand_status(void) { + if (hCryptProv == 0) { + return 0; + } else { + return 1; + } +} +#else +static int urandom_fd = -1; + +static int osrandom_finish(ENGINE *e); + +static int osrandom_init(ENGINE *e) { + if (urandom_fd > -1) { + return 1; + } + urandom_fd = open("/dev/urandom", O_RDONLY); + if (urandom_fd > -1) { + int flags = fcntl(urandom_fd, F_GETFD); + if (flags == -1) { + osrandom_finish(e); + return 0; + } else if (fcntl(urandom_fd, F_SETFD, flags | FD_CLOEXEC) == -1) { + osrandom_finish(e); + return 0; + } + return 1; + } else { + return 0; + } +} + +static int osrandom_rand_bytes(unsigned char *buffer, int size) { + ssize_t n; + while (size > 0) { + do { + n = read(urandom_fd, buffer, (size_t)size); + } while (n < 0 && errno == EINTR); + if (n <= 0) { + ERR_put_error( + ERR_LIB_RAND, 0, ERR_R_RAND_LIB, "osrandom_engine.py", 0 + ); + return 0; + } + buffer += n; + size -= n; + } + return 1; +} + +static int osrandom_finish(ENGINE *e) { + int n; + do { + n = close(urandom_fd); + } while (n < 0 && errno == EINTR); + urandom_fd = -1; + if (n < 0) { + return 0; + } else { + return 1; + } +} + +static int osrandom_rand_status(void) { + if (urandom_fd == -1) { + return 0; + } else { + return 1; + } +} +#endif + +/* This replicates the behavior of the OpenSSL FIPS RNG, which returns a + -1 in the event that there is an error when calling RAND_pseudo_bytes. */ +static int osrandom_pseudo_rand_bytes(unsigned char *buffer, int size) { + int res = osrandom_rand_bytes(buffer, size); + if (res == 0) { + return -1; + } else { + return res; + } +} + +static RAND_METHOD osrandom_rand = { + NULL, + osrandom_rand_bytes, + NULL, + NULL, + osrandom_pseudo_rand_bytes, + osrandom_rand_status, +}; + +/* Returns 1 if successfully added, 2 if engine has previously been added, + and 0 for error. */ +int Cryptography_add_osrandom_engine(void) { + ENGINE *e; + e = ENGINE_by_id(Cryptography_osrandom_engine_id); + if (e != NULL) { + ENGINE_free(e); + return 2; + } else { + ERR_clear_error(); + } + + e = ENGINE_new(); + if (e == NULL) { + return 0; + } + if(!ENGINE_set_id(e, Cryptography_osrandom_engine_id) || + !ENGINE_set_name(e, Cryptography_osrandom_engine_name) || + !ENGINE_set_RAND(e, &osrandom_rand) || + !ENGINE_set_init_function(e, osrandom_init) || + !ENGINE_set_finish_function(e, osrandom_finish)) { + ENGINE_free(e); + return 0; + } + if (!ENGINE_add(e)) { + ENGINE_free(e); + return 0; + } + if (!ENGINE_free(e)) { + return 0; + } + + return 1; +} diff --git a/pkg/pyinst/cryptography/osrandom_engine.h b/pkg/pyinst/cryptography/osrandom_engine.h new file mode 100644 index 00000000..11a3159e --- /dev/null +++ b/pkg/pyinst/cryptography/osrandom_engine.h @@ -0,0 +1,6 @@ +#ifdef _WIN32 +#include +#else +#include +#include +#endif -- cgit v1.2.3 From d01772d0a83535bf45fa43786213a9a0fcb232bc Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 11 Feb 2016 13:34:46 -0800 Subject: [refactor] cleanup helper usage to adapt to new one also cleanups build process --- pkg/pyinst/pyinst-build.mk | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 9595ad50..835c793c 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -12,8 +12,9 @@ pyinst: freeze-ver hash-binaries reset-ver: git checkout -- src/leap/bitmask/_version.py -pyinst-hacks: - cp ../leap_common/src/leap/common/cacert.pem $(DIST) +pyinst-hacks-linux: + # XXX this should be taken care of by pyinstaller data collector + cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/leap/common/cacert.pem $(DIST) mkdir -p $(DIST)pysqlcipher mkdir -p $(DIST)pixelated mkdir -p $(DIST)twisted/web @@ -22,15 +23,17 @@ pyinst-hacks: 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_OSX)Contents/MacOS/ + # 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-* - #rm -f dist/bitmask/libgstvideo-1.0.so.0 - #rm -f dist/bitmask/libgstaudio0.0.so.0 - #rm -f dist/bitmask/libgstreamer-1.0.so.0 pyinst-cleanup: rm -rf $(DIST)config @@ -44,7 +47,7 @@ pyinst-distribution-data: cp pkg/PixelatedWebmail.README $(DIST_VERSION) cp LICENSE $(DIST_VERSION) -pyinst-linux-helpers: +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/ @@ -53,6 +56,21 @@ pyinst-linux-helpers: 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 + 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.$(DIST_OSX_RES)bitmask-helper/ + cp pkg/osx/post-inst.sh $(DIST_OSX_RES)bitmask-helper/ + cp pkg/osx/daemon.py $(DIST_OSX_RES)bitmask-helper/ + cp /opt/homebrew-cask/Caskroom/tuntap/20150118/tuntap_20150118.pkg $(DIST_OSX_RES) + # TODO get from the path the build script places it + cp ~/leap/openvpn.leap.polarssl $(DIST_OSX_RES)openvpn.leap + # TODO this contains the gpg binary (brew), but we need to compile it statically from sources. + cp -r src/leap/bitmask/util/apps $(DIST_OSX)Contents/MacOS/ + pyinst-tar: cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) @@ -62,7 +80,9 @@ pyinst-sign: pyinst-upload: rsync --rsh='ssh' -avztlpog --progress --partial dist/Bitmask.$(NEXT_VERSION).* salmon.leap.se:./ -pyinst-linux: pyinst reset-ver pyinst-hacks pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-linux-helpers pyinst-tar +pyinst-linux: pyinst reset-ver pyinst-hacks-linux pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-helpers-linux pyinst-tar + +pyinst-osx: pyinst reset-ver pyinst-hacks-osx pyinst-helpers-osx clean_pkg: rm -rf build dist -- cgit v1.2.3 From ec04bb1ec723f3f9a97ecc6d9daa00a5a8f86609 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 13 Apr 2016 15:42:27 -0700 Subject: [pkg] update pyinst makefile to pick our custom built gpg --- pkg/pyinst/pyinst-build.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 835c793c..4668d3f0 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -58,6 +58,7 @@ pyinst-helpers-linux: pyinst-helpers-osx: mkdir -p $(DIST_OSX_RES)bitmask-helper + mkdir $(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/ @@ -66,10 +67,9 @@ pyinst-helpers-osx: cp pkg/osx/post-inst.sh $(DIST_OSX_RES)bitmask-helper/ cp pkg/osx/daemon.py $(DIST_OSX_RES)bitmask-helper/ cp /opt/homebrew-cask/Caskroom/tuntap/20150118/tuntap_20150118.pkg $(DIST_OSX_RES) - # TODO get from the path the build script places it - cp ~/leap/openvpn.leap.polarssl $(DIST_OSX_RES)openvpn.leap - # TODO this contains the gpg binary (brew), but we need to compile it statically from sources. - cp -r src/leap/bitmask/util/apps $(DIST_OSX)Contents/MacOS/ + # TODO make the build script put it there + cp ~/leap_thirdparty_build/openvpn.leap.polarssl $(DIST_OSX_RES)openvpn.leap + cp ~/leap_thirdparty_build/gpg $(DIST_OSX)Contents/MacOS/apps/mail/ pyinst-tar: cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) -- cgit v1.2.3 From ab6746623c8907e710c053cf73db036d9c432964 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 14 Apr 2016 17:01:34 -0700 Subject: [bug] fix typos in osx build --- pkg/pyinst/pyinst-build.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 4668d3f0..a414bd4e 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -1,7 +1,7 @@ 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 + 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 @@ -58,12 +58,12 @@ pyinst-helpers-linux: pyinst-helpers-osx: mkdir -p $(DIST_OSX_RES)bitmask-helper - mkdir $(DIST_OSX)Contents/MacOS/apps/mail + 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.$(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.py $(DIST_OSX_RES)bitmask-helper/ cp /opt/homebrew-cask/Caskroom/tuntap/20150118/tuntap_20150118.pkg $(DIST_OSX_RES) -- cgit v1.2.3 From 2cb8887119ff1dade6e3a4d9368654a6b67576a4 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Sun, 17 Apr 2016 12:47:57 -0700 Subject: [refactor] re-add wrapper, cd needed --- pkg/pyinst/bitmask.spec | 7 ++++--- pkg/pyinst/pyinst-build.mk | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec index 149093eb..afee9dd1 100644 --- a/pkg/pyinst/bitmask.spec +++ b/pkg/pyinst/bitmask.spec @@ -3,10 +3,11 @@ import sys block_cipher = None +# TODO remove QtWebKit for bundles that don't ship pixelated??? a = Analysis(['bitmask.py'], hiddenimports=[ 'zope.interface', 'zope.proxy', - 'PySide.QtCore', 'PySide.QtGui', + 'PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit', 'pysqlcipher', 'service_identity', 'leap.common', 'leap.bitmask' ], @@ -50,6 +51,6 @@ if sys.platform.startswith("darwin"): name=os.path.join( 'dist', 'Bitmask.app'), appname='Bitmask', - version='0.9.0rc4', + version='0.9.0.alpha7', icon='pkg/osx/bitmask.icns', - bundle_identifier='bitmask-0.9.0rc4') + bundle_identifier='bitmask-0.9.0alpha7') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index a414bd4e..b96e5dab 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -25,7 +25,10 @@ pyinst-hacks-linux: 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: -- cgit v1.2.3 From c36e86275fe1c9ca4d6932c5103f91f5c2473b2e Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Sun, 17 Apr 2016 12:50:59 -0700 Subject: [bug] avoid osx hanging --- pkg/pyinst/bitmask.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec index afee9dd1..8c6561cf 100644 --- a/pkg/pyinst/bitmask.spec +++ b/pkg/pyinst/bitmask.spec @@ -51,6 +51,7 @@ if sys.platform.startswith("darwin"): name=os.path.join( 'dist', 'Bitmask.app'), appname='Bitmask', - version='0.9.0.alpha7', + # TODO get this from ../next-version.txt + version='0.9.0.rc1', icon='pkg/osx/bitmask.icns', bundle_identifier='bitmask-0.9.0alpha7') -- cgit v1.2.3 From 431d23021b5ac25c5a723e30698eb7465ad0949b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 18 Apr 2016 12:48:39 -0700 Subject: [pkg] remove cryptography hack, not needed with pyinst>3.0 --- pkg/pyinst/cryptography/osrandom_engine.c | 167 ------------------------------ pkg/pyinst/cryptography/osrandom_engine.h | 6 -- 2 files changed, 173 deletions(-) delete mode 100644 pkg/pyinst/cryptography/osrandom_engine.c delete mode 100644 pkg/pyinst/cryptography/osrandom_engine.h (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/cryptography/osrandom_engine.c b/pkg/pyinst/cryptography/osrandom_engine.c deleted file mode 100644 index 27894712..00000000 --- a/pkg/pyinst/cryptography/osrandom_engine.c +++ /dev/null @@ -1,167 +0,0 @@ -static const char *Cryptography_osrandom_engine_id = "osrandom"; -static const char *Cryptography_osrandom_engine_name = "osrandom_engine"; - -#if defined(_WIN32) -static HCRYPTPROV hCryptProv = 0; - -static int osrandom_init(ENGINE *e) { - if (hCryptProv > 0) { - return 1; - } - if (CryptAcquireContext(&hCryptProv, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { - return 1; - } else { - return 0; - } -} - -static int osrandom_rand_bytes(unsigned char *buffer, int size) { - if (hCryptProv == 0) { - return 0; - } - - if (!CryptGenRandom(hCryptProv, (DWORD)size, buffer)) { - ERR_put_error( - ERR_LIB_RAND, 0, ERR_R_RAND_LIB, "osrandom_engine.py", 0 - ); - return 0; - } - return 1; -} - -static int osrandom_finish(ENGINE *e) { - if (CryptReleaseContext(hCryptProv, 0)) { - hCryptProv = 0; - return 1; - } else { - return 0; - } -} - -static int osrandom_rand_status(void) { - if (hCryptProv == 0) { - return 0; - } else { - return 1; - } -} -#else -static int urandom_fd = -1; - -static int osrandom_finish(ENGINE *e); - -static int osrandom_init(ENGINE *e) { - if (urandom_fd > -1) { - return 1; - } - urandom_fd = open("/dev/urandom", O_RDONLY); - if (urandom_fd > -1) { - int flags = fcntl(urandom_fd, F_GETFD); - if (flags == -1) { - osrandom_finish(e); - return 0; - } else if (fcntl(urandom_fd, F_SETFD, flags | FD_CLOEXEC) == -1) { - osrandom_finish(e); - return 0; - } - return 1; - } else { - return 0; - } -} - -static int osrandom_rand_bytes(unsigned char *buffer, int size) { - ssize_t n; - while (size > 0) { - do { - n = read(urandom_fd, buffer, (size_t)size); - } while (n < 0 && errno == EINTR); - if (n <= 0) { - ERR_put_error( - ERR_LIB_RAND, 0, ERR_R_RAND_LIB, "osrandom_engine.py", 0 - ); - return 0; - } - buffer += n; - size -= n; - } - return 1; -} - -static int osrandom_finish(ENGINE *e) { - int n; - do { - n = close(urandom_fd); - } while (n < 0 && errno == EINTR); - urandom_fd = -1; - if (n < 0) { - return 0; - } else { - return 1; - } -} - -static int osrandom_rand_status(void) { - if (urandom_fd == -1) { - return 0; - } else { - return 1; - } -} -#endif - -/* This replicates the behavior of the OpenSSL FIPS RNG, which returns a - -1 in the event that there is an error when calling RAND_pseudo_bytes. */ -static int osrandom_pseudo_rand_bytes(unsigned char *buffer, int size) { - int res = osrandom_rand_bytes(buffer, size); - if (res == 0) { - return -1; - } else { - return res; - } -} - -static RAND_METHOD osrandom_rand = { - NULL, - osrandom_rand_bytes, - NULL, - NULL, - osrandom_pseudo_rand_bytes, - osrandom_rand_status, -}; - -/* Returns 1 if successfully added, 2 if engine has previously been added, - and 0 for error. */ -int Cryptography_add_osrandom_engine(void) { - ENGINE *e; - e = ENGINE_by_id(Cryptography_osrandom_engine_id); - if (e != NULL) { - ENGINE_free(e); - return 2; - } else { - ERR_clear_error(); - } - - e = ENGINE_new(); - if (e == NULL) { - return 0; - } - if(!ENGINE_set_id(e, Cryptography_osrandom_engine_id) || - !ENGINE_set_name(e, Cryptography_osrandom_engine_name) || - !ENGINE_set_RAND(e, &osrandom_rand) || - !ENGINE_set_init_function(e, osrandom_init) || - !ENGINE_set_finish_function(e, osrandom_finish)) { - ENGINE_free(e); - return 0; - } - if (!ENGINE_add(e)) { - ENGINE_free(e); - return 0; - } - if (!ENGINE_free(e)) { - return 0; - } - - return 1; -} diff --git a/pkg/pyinst/cryptography/osrandom_engine.h b/pkg/pyinst/cryptography/osrandom_engine.h deleted file mode 100644 index 11a3159e..00000000 --- a/pkg/pyinst/cryptography/osrandom_engine.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef _WIN32 -#include -#else -#include -#include -#endif -- cgit v1.2.3 From 21bc3df30c7e280241472c58d74a96a6c84188eb Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 18 Apr 2016 12:54:18 -0700 Subject: [pkg] move embedded copy of daemon to its own folder --- pkg/pyinst/pyinst-build.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index b96e5dab..756185bf 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -68,11 +68,11 @@ pyinst-helpers-osx: 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.py $(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_thirdparty_build/openvpn.leap.polarssl $(DIST_OSX_RES)openvpn.leap - cp ~/leap_thirdparty_build/gpg $(DIST_OSX)Contents/MacOS/apps/mail/ + 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) -- cgit v1.2.3 From e709476718d7a0aa4e80663a6a55b2931d221796 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 18 Apr 2016 12:58:13 -0700 Subject: [bug] fix BSD sed syntax --- pkg/pyinst/pyinst-build.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 756185bf..92a1cbb3 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -1,4 +1,9 @@ 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 @@ -9,6 +14,9 @@ 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 @@ -85,7 +93,7 @@ pyinst-upload: pyinst-linux: pyinst reset-ver pyinst-hacks-linux pyinst-trim pyinst-cleanup pyinst-distribution-data pyinst-helpers-linux pyinst-tar -pyinst-osx: pyinst reset-ver pyinst-hacks-osx pyinst-helpers-osx +pyinst-osx: pyinst_osx reset-ver pyinst-hacks-osx pyinst-helpers-osx clean_pkg: rm -rf build dist -- cgit v1.2.3 From 59009db169e9e75ec6271601d38cd0fba2bd8806 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 8 Mar 2016 00:58:45 -0400 Subject: [feat] multi-binary specs for cli --- pkg/pyinst/bitmask_cli | 1 + pkg/pyinst/bitmask_cli.spec | 32 +++++++++++++++++++++++++++ pkg/pyinst/multi.spec | 54 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 120000 pkg/pyinst/bitmask_cli create mode 100644 pkg/pyinst/bitmask_cli.spec create mode 100644 pkg/pyinst/multi.spec (limited to 'pkg/pyinst') 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/multi.spec b/pkg/pyinst/multi.spec new file mode 100644 index 00000000..2bb9d248 --- /dev/null +++ b/pkg/pyinst/multi.spec @@ -0,0 +1,54 @@ + +# -*- 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'], + pathex=['/home/kali/leap/bitmask_client/pkg/pyinst'], + 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) + +MERGE( (gui_a, 'bitmask', 'bitmask'), + (cli_a, 'bitmask_cli', 'bitmask')) + +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) + +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') -- cgit v1.2.3 From b546d64221f5c10d7ec076fd278b7e60c3fb6f31 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 9 Mar 2016 16:27:12 -0400 Subject: [feat] add bitmaskd to multipackage spec --- pkg/pyinst/bitmaskd | 1 + pkg/pyinst/bitmaskd.spec | 33 +++++++++++++++++++++++++++++++++ pkg/pyinst/multi.spec | 25 +++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 120000 pkg/pyinst/bitmaskd create mode 100644 pkg/pyinst/bitmaskd.spec (limited to 'pkg/pyinst') 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 index 2bb9d248..aa5c83c0 100644 --- a/pkg/pyinst/multi.spec +++ b/pkg/pyinst/multi.spec @@ -13,7 +13,6 @@ gui_a = Analysis(['bitmask.py'], excludes=None, cipher=block_cipher) cli_a = Analysis(['bitmask_cli'], - pathex=['/home/kali/leap/bitmask_client/pkg/pyinst'], binaries=None, datas=None, hiddenimports=[ @@ -24,9 +23,21 @@ cli_a = Analysis(['bitmask_cli'], 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')) + (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, @@ -41,6 +52,11 @@ cli_exe = EXE(cli_pyz, 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, @@ -52,3 +68,8 @@ cli_coll = COLLECT(cli_exe, 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') -- cgit v1.2.3 From 40235da29812dcbf767eaabe0bcf93fe8c414a07 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 9 Mar 2016 16:28:18 -0400 Subject: [doc] notes about unneeded deps in the bundle --- pkg/pyinst/trim-notes.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pkg/pyinst/trim-notes.txt (limited to 'pkg/pyinst') 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 -- cgit v1.2.3 From cc4b55926d20b81a3c381dfb41cae42ab080f557 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 26 Apr 2016 20:03:44 -0400 Subject: [pkg] pick cacert from the repo, not the venv --- pkg/pyinst/pyinst-build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 92a1cbb3..664f13ec 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -22,7 +22,7 @@ reset-ver: pyinst-hacks-linux: # 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 ../leap_common/src/leap/common/cacert.pem $(DIST) mkdir -p $(DIST)pysqlcipher mkdir -p $(DIST)pixelated mkdir -p $(DIST)twisted/web -- cgit v1.2.3 From 2a802378a6ffd1c1c677e4fa035ee3b8f932dfbe Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 3 May 2016 10:40:30 -0400 Subject: [pkg] remove pixelated readme, can be enabled in prefswin --- pkg/pyinst/pyinst-build.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'pkg/pyinst') diff --git a/pkg/pyinst/pyinst-build.mk b/pkg/pyinst/pyinst-build.mk index 664f13ec..32239f8e 100644 --- a/pkg/pyinst/pyinst-build.mk +++ b/pkg/pyinst/pyinst-build.mk @@ -55,7 +55,6 @@ pyinst-cleanup: pyinst-distribution-data: cp release-notes.rst $(DIST_VERSION) - cp pkg/PixelatedWebmail.README $(DIST_VERSION) cp LICENSE $(DIST_VERSION) pyinst-helpers-linux: -- cgit v1.2.3