From b226c1a3c44df3bfe9b888be1f8661a69f53a88b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 15 Jan 2015 17:21:01 -0400 Subject: gather bitmask dependency tree --- pkg/scripts/filter-bitmask-deps | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 pkg/scripts/filter-bitmask-deps (limited to 'pkg') diff --git a/pkg/scripts/filter-bitmask-deps b/pkg/scripts/filter-bitmask-deps new file mode 100755 index 00000000..9808d394 --- /dev/null +++ b/pkg/scripts/filter-bitmask-deps @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +""" +Filter bitmask dependencies. + +Usage: pipdeptree | filter-bitmask-deps +""" +import fileinput + +TARGET = "leap.bitmask" + + +def get_bitmask_deps(dep_lines): + res = [] + begin = False + for dep in dep_lines: + if dep.startswith(TARGET): + begin = True + res.append(dep) + continue + elif dep.startswith(' ') and begin: + res.append(dep) + continue + if begin: + return res + + +if __name__ == "__main__": + lines = [] + for line in fileinput.input(): + lines.append(line) + + bitmask_deps = get_bitmask_deps(lines) + for line in bitmask_deps: + print line[:-1] -- cgit v1.2.3 From fb7d75a6556026d097a03c61bb167d689f1e1f06 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 13 Feb 2015 12:12:09 -0400 Subject: add pipdeptree to requirements-dev --- pkg/requirements-dev.pip | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements-dev.pip b/pkg/requirements-dev.pip index 799376d2..45f5fa70 100644 --- a/pkg/requirements-dev.pip +++ b/pkg/requirements-dev.pip @@ -1,3 +1,13 @@ +# ------------------------------------ +# -- useful tools that you probably -- +# -- will want during development -- +# ------------------------------------ + +wheel +sphinx +ipdb +pipdeptree + # --------------------------- # -- external requirements -- # -- during development -- @@ -11,11 +21,7 @@ # to install it. (do it after python setup.py develop and it # will only install this) # -wheel -sphinx -ipdb # in case you want to install a package from a git source, you can use this: # Useful to test pre-release branches together. #-e git+https://github.com/leapcode/leap_pycommon.git@develop#egg=leap.common -#-e git+https://github.com/leapcode/soledad.git@develop#egg=leap.soledad -- cgit v1.2.3 From c06bf409d3fe2268011214301c59dc1c279fae44 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 4 Feb 2015 00:59:32 -0400 Subject: create sumo tarball with leap dependencies (Closes: #6683) --- pkg/leap_versions.txt | 4 ++++ pkg/scripts/checkout_leap_versions.sh | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 pkg/leap_versions.txt create mode 100755 pkg/scripts/checkout_leap_versions.sh (limited to 'pkg') diff --git a/pkg/leap_versions.txt b/pkg/leap_versions.txt new file mode 100644 index 00000000..b95d1b29 --- /dev/null +++ b/pkg/leap_versions.txt @@ -0,0 +1,4 @@ +soledad 0.6.3 +keymanager 0.3.8 +leap_common 0.3.9 +leap_mail 0.3.11 diff --git a/pkg/scripts/checkout_leap_versions.sh b/pkg/scripts/checkout_leap_versions.sh new file mode 100755 index 00000000..9d6c6fab --- /dev/null +++ b/pkg/scripts/checkout_leap_versions.sh @@ -0,0 +1,7 @@ +#!/bin/sh +cat pkg/leap_versions.txt | while read line +do + package=$(echo $line | cut -f1 -d' ') + tag=$(echo $line | cut -f2 -d' ') + cd ../$package && git checkout $tag +done -- cgit v1.2.3 From 649b869f76730da78fcd40dacf8da45166ebd750 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 22 Apr 2015 15:40:49 -0300 Subject: [bug] support /usr/lib64 python path for symlinks On 64bit Fedora/RHEL systems the python path is /usr/lib64 instead of /usr/lib like on Ubuntu systems. This fix allows those users to use the bootstrap_develop.sh script. --- pkg/postmkvenv.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh index 7b06fa6d..015464d3 100755 --- a/pkg/postmkvenv.sh +++ b/pkg/postmkvenv.sh @@ -21,16 +21,18 @@ LIBS=( PySide pysideuic ) PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") VAR=( $(which -a $PYTHON_VERSION) ) -GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())" +# this takes care of the /usr/lib vs /usr/lib64 differences between platforms +GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib(plat_specific=True))" + LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD") if [[ $platform == 'linux' ]]; then LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD") elif [[ $platform == 'darwin' ]]; then ORIGINAL_PATH=$PATH - #change first colon of path to | because path substitution is greedy + # change first colon of path to | because path substitution is greedy PATH=${PATH/:/|} - #remove everything up to | from path + # remove everything up to | from path PATH=${PATH/*|/} LIB_SYSTEM_PATH=$(python -c "$GET_PYTHON_LIB_CMD") PATH=$ORIGINAL_PATH -- cgit v1.2.3 From 456941648223a14fe144264c27a5dce4e4e702e5 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 23 Apr 2015 12:41:08 -0300 Subject: [bug] change the ip command location to /sbin/ Change the 'ip' command location to support Fedora/RHEL distros. /bin/ip is pressent on Debian/Ubuntu but not on Fedora. /sbin/ip is a symlink to /bin/ip on Debian/Ubuntu and a binary on Fedora. - Resolves: #6894 --- pkg/linux/bitmask-root | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/linux/bitmask-root b/pkg/linux/bitmask-root index 6fb1f0b3..80ac12e8 100755 --- a/pkg/linux/bitmask-root +++ b/pkg/linux/bitmask-root @@ -73,7 +73,7 @@ def get_no_group_name(): return None -VERSION = "5" +VERSION = "6" SCRIPT = "bitmask-root" NAMESERVER = "10.42.0.1" BITMASK_CHAIN = "bitmask" @@ -85,7 +85,7 @@ LOCAL_INTERFACE = "lo" IMAP_PORT = "1984" SMTP_PORT = "2013" -IP = "/bin/ip" +IP = "/sbin/ip" IPTABLES = "/sbin/iptables" IP6TABLES = "/sbin/ip6tables" -- cgit v1.2.3 From 01b005b0642454e3d670089ed7e530eda8e9ef91 Mon Sep 17 00:00:00 2001 From: drebs Date: Wed, 28 Jan 2015 16:17:51 -0200 Subject: [feat] use txzmq in backend Before this commit, the backend used plain pyzmq bindings for communicating with the frontend. This implements the txzmq twisted-powered bindings instead. Closes: #6360 --- pkg/requirements.pip | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 37cc18a3..13d4da14 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -9,6 +9,7 @@ argparse requests>=1.1.0 srp>=1.0.2 pyopenssl +coloredlogs # This won't be needed after we refactor leap.common.events to use zmq. python-dateutil @@ -24,6 +25,7 @@ zope.proxy # You will want to install this bundled if you don't have sodium in your system: # pip install pyzmq --install-option="--zmq=bundled" pyzmq +txzmq leap.common>=0.3.7 leap.soledad.client>=0.6.0 -- cgit v1.2.3 From 5a0de9fd25d783039345674680c67a2bd91815a5 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 7 May 2015 11:21:02 -0300 Subject: [feat] adapt to new events api on common - Related: #6359 --- pkg/requirements.pip | 4 ---- 1 file changed, 4 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 13d4da14..5fec3be5 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -11,9 +11,6 @@ srp>=1.0.2 pyopenssl coloredlogs -# This won't be needed after we refactor leap.common.events to use zmq. -python-dateutil - psutil ipaddr @@ -27,7 +24,6 @@ zope.proxy pyzmq txzmq -leap.common>=0.3.7 leap.soledad.client>=0.6.0 leap.keymanager>=0.3.8 leap.mail>=0.3.9 -- cgit v1.2.3 From 01e62e35a69aa13f86a06d8839169ea69d716009 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 8 Jun 2015 16:40:04 -0300 Subject: [pkg] add missing taskthread dependency This dependency was previously installed through soledad, but it doesn't use that lib anymore. --- pkg/requirements.pip | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 5fec3be5..5b997ac9 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -30,3 +30,5 @@ leap.mail>=0.3.9 # Remove this when u1db fixes its dependency on oauth oauth + +taskthread -- cgit v1.2.3 From 584a6d93ad1fe1ba46929108f002a16a8b70e95d Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 5 Jun 2015 13:36:51 -0300 Subject: [feat] add a zmq based logger, change log window - Add a new handler for a zmq/thread-safe log send between components. - Update the log window to use this new handler. - Remove old custom handler We have implemented a new handler that uses logbook, so this one is no longer needed. - Adapt log silencer to new handler - Use log file always as default - Related: #6733 --- pkg/requirements.pip | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 5b997ac9..c6174648 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -32,3 +32,4 @@ leap.mail>=0.3.9 oauth taskthread +logbook -- cgit v1.2.3 From 3a5eba162db77c76bd0bb035c84ffa42a8a08b0e Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 10 Jul 2015 19:27:47 -0300 Subject: [pkg] bump dependencies --- pkg/requirements.pip | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index c6174648..c9fc7216 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -25,8 +25,9 @@ pyzmq txzmq leap.soledad.client>=0.6.0 -leap.keymanager>=0.3.8 -leap.mail>=0.3.9 +leap.keymanager>=0.4.0 +leap.mail>=0.4.0rc1 +leap.common>=0.4.0 # Remove this when u1db fixes its dependency on oauth oauth -- cgit v1.2.3 From 325dded67dd9ca0ad84e323bed7b6b157d2f870b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 21 Jul 2015 00:51:33 -0400 Subject: [pkg] bump versions for bitmask 0.9.0rc1 bundles - Releases: 0.9.0 --- pkg/leap_versions.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg') diff --git a/pkg/leap_versions.txt b/pkg/leap_versions.txt index b95d1b29..0351c758 100644 --- a/pkg/leap_versions.txt +++ b/pkg/leap_versions.txt @@ -1,4 +1,4 @@ -soledad 0.6.3 -keymanager 0.3.8 -leap_common 0.3.9 -leap_mail 0.3.11 +soledad 0.7.1 +keymanager 0.4.1 +leap_common 0.4.0 +leap_mail 0.4.0rc1 -- cgit v1.2.3 From 7482e04ab1e75ba4b3d98a1129f8d044919a4b02 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 22 Jul 2015 16:50:07 -0400 Subject: [pkg] separate leap requirements this is part of a process to make the setup of the development mode less troublesome. from now on, setting up a virtualenv in pure development mode will be as easy as telling pip to just install the external dependencies:: pip install -r pkg/requirements.pip and traversing all the leap repos for the needed leap dependencies doing:: python setup.py develop - Related: #7288 --- pkg/requirements-leap.pip | 4 ++++ pkg/requirements.pip | 5 ----- pkg/utils.py | 18 ++++++++++++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 pkg/requirements-leap.pip (limited to 'pkg') diff --git a/pkg/requirements-leap.pip b/pkg/requirements-leap.pip new file mode 100644 index 00000000..df2d1974 --- /dev/null +++ b/pkg/requirements-leap.pip @@ -0,0 +1,4 @@ +leap.soledad.client>=0.6.0 +leap.keymanager>=0.4.0 +leap.mail>=0.4.0rc1 +leap.common>=0.4.0 diff --git a/pkg/requirements.pip b/pkg/requirements.pip index c9fc7216..7bc15e25 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -24,11 +24,6 @@ zope.proxy pyzmq txzmq -leap.soledad.client>=0.6.0 -leap.keymanager>=0.4.0 -leap.mail>=0.4.0rc1 -leap.common>=0.4.0 - # Remove this when u1db fixes its dependency on oauth oauth diff --git a/pkg/utils.py b/pkg/utils.py index deace14b..2e316d45 100644 --- a/pkg/utils.py +++ b/pkg/utils.py @@ -14,16 +14,30 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - """ Utils to help in the setup process """ - import os import re import sys +def is_develop_mode(): + """ + Returns True if we're calling the setup script using the argument for + setuptools development mode. + + This avoids messing up with dependency pinning and order, the + responsibility of installing the leap dependencies is left to the + developer. + """ + args = sys.argv + devflags = "setup.py", "develop" + if (args[0], args[1]) == devflags: + return True + return False + + def get_reqs_from_files(reqfiles): """ Returns the contents of the top requirement file listed as a -- cgit v1.2.3 From 7f64872e77c0a362cd689be1bc5f465a64b4eec7 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 27 Jul 2015 22:34:12 -0400 Subject: [pkg] add script to install base requirements - update pip - install base reqs --- pkg/pip_install_requirements.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 pkg/pip_install_requirements.sh (limited to 'pkg') diff --git a/pkg/pip_install_requirements.sh b/pkg/pip_install_requirements.sh new file mode 100755 index 00000000..29f03f3a --- /dev/null +++ b/pkg/pip_install_requirements.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Update pip and install LEAP base requirements. +pip install -U pip +pip install -r pkg/requirements.pip -- cgit v1.2.3 From f66ad4ce4ea1958e9cae9cd74727c3a93d8c369a Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 27 Jul 2015 22:36:44 -0400 Subject: [pkg] add AUTHORS file + one-liner to generate it --- pkg/tools/get_authors.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 pkg/tools/get_authors.sh (limited to 'pkg') diff --git a/pkg/tools/get_authors.sh b/pkg/tools/get_authors.sh new file mode 100755 index 00000000..0169bb17 --- /dev/null +++ b/pkg/tools/get_authors.sh @@ -0,0 +1,2 @@ +#!/bin/sh +git log --format='%aN <%aE>' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn | cut -d' ' -f2- -- cgit v1.2.3 From c68754c16629a6b45c7feba57f14d51a1617c4a2 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 22 Jun 2015 19:15:22 -0400 Subject: [feat] initial working bundle with pyinstaller linux only, at the moment, but it's a good start :) --- pkg/pyinst/bitmask.py | 1 + pkg/pyinst/bitmask.spec | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 120000 pkg/pyinst/bitmask.py create mode 100644 pkg/pyinst/bitmask.spec (limited to 'pkg') diff --git a/pkg/pyinst/bitmask.py b/pkg/pyinst/bitmask.py new file mode 120000 index 00000000..3da791e6 --- /dev/null +++ b/pkg/pyinst/bitmask.py @@ -0,0 +1 @@ +../../src/leap/bitmask/app.py \ No newline at end of file diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec new file mode 100644 index 00000000..efdbf167 --- /dev/null +++ b/pkg/pyinst/bitmask.spec @@ -0,0 +1,59 @@ +# -*- mode: python -*- +a = Analysis(['pkg/pyinst/bitmask.py'], + pathex=['/home/kali/Virtualenvs/leap-pyinst/lib/python2.7/site-packages/zope', '/home/kali/Virtualenvs/leap-pyinst/lib/python2.7/site-packages/zope/interface', '/home/kali/Virtualenvs/leap-pyinst/lib/python2.7/site-packages/zope/proxy', '/home/kali/leap/bitmask_client/src/leap/bitmask'], + hiddenimports=[ + 'zope.interface', 'zope.proxy', + 'leap.common', + 'leap.common.config', + 'PySide.QtCore', 'PySide.QtGui', + # not needed with latest develop pyinstaller + 'cryptography.hazmat.bindings.openssl', + 'cryptography.hazmat.bindings.openssl.aes', + 'cryptography.hazmat.bindings.openssl.asn1', + 'cryptography.hazmat.bindings.openssl.bignum', + 'cryptography.hazmat.bindings.openssl.bio', + 'cryptography.hazmat.bindings.openssl.cmac', + 'cryptography.hazmat.bindings.openssl.cms', + 'cryptography.hazmat.bindings.openssl.conf', + 'cryptography.hazmat.bindings.openssl.crypto', + 'cryptography.hazmat.bindings.openssl.dh', + 'cryptography.hazmat.bindings.openssl.dsa', + 'cryptography.hazmat.bindings.openssl.ec', + 'cryptography.hazmat.bindings.openssl.ecdh', + 'cryptography.hazmat.bindings.openssl.ecdsa', + 'cryptography.hazmat.bindings.openssl.engine', + 'cryptography.hazmat.bindings.openssl.err', + 'cryptography.hazmat.bindings.openssl.evp', + 'cryptography.hazmat.bindings.openssl.hmac', + 'cryptography.hazmat.bindings.openssl.nid', + 'cryptography.hazmat.bindings.openssl.objects', + 'cryptography.hazmat.bindings.openssl.opensslv', + 'cryptography.hazmat.bindings.openssl.osrandom_engine', + 'cryptography.hazmat.bindings.openssl.pem', + 'cryptography.hazmat.bindings.openssl.pkcs12', + 'cryptography.hazmat.bindings.openssl.pkcs7', + 'cryptography.hazmat.bindings.openssl.rand', + 'cryptography.hazmat.bindings.openssl.rsa', + 'cryptography.hazmat.bindings.openssl.ssl', + 'cryptography.hazmat.bindings.openssl.x509name', + 'cryptography.hazmat.bindings.openssl.x509', + 'cryptography.hazmat.bindings.openssl.x509v3', + 'cryptography.hazmat.bindings.openssl.x509_vfy'], + hookspath=None, + runtime_hooks=None) +pyz = PYZ(a.pure) +exe = EXE(pyz, + a.scripts, + exclude_binaries=True, + name='bitmask', + debug=False, + strip=None, + upx=True, + console=True ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=None, + upx=True, + name='bitmask') -- cgit v1.2.3 From 7fef8b6258e203ac364d0e566fe9d1490e83a5ef Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 23 Jul 2015 15:48:06 -0400 Subject: [pkg] add notes about needed hacks with pyinstaller there are a couple of manual steps needed --- pkg/linux/pyinst-notes.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pkg/linux/pyinst-notes.txt (limited to 'pkg') diff --git a/pkg/linux/pyinst-notes.txt b/pkg/linux/pyinst-notes.txt new file mode 100644 index 00000000..e4310e6d --- /dev/null +++ b/pkg/linux/pyinst-notes.txt @@ -0,0 +1,20 @@ +hacks +----- +**because nobody's perfect, at least the first time** + +missing osrandom_engine header +=============================== + +1. extract osrandom_engine.* from original cryptography tarball: + +cp /src/cryptography/hazmat/bindings/openssl/src/osrandom_engine.h /tmp +cp /src/cryptography/hazmat/bindings/openssl/src/osrandom_engine.c /tmp + +cd dist/bitmask +mkdir -p cryptography/hazmat/bindings/openssl/src +cp /tmp/osrandom_engine.* cryptography/hazmat/bindings/openssl/src + +missing dbschema.sql +==================== +mkdir -p u1db/backends +cp ~VIRTUAL_ENV/lib/python2.7/site-packages/u1db/backends/dbschema.sql u1db/backends -- cgit v1.2.3 From be08bd222ef498dad6f4fa5902f45fc6845b86ac Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 24 Jul 2015 01:31:17 -0400 Subject: [pkg] add small shell launcher for linux bundle to workaround the incompatibility problem with Qt libs found in ubuntu --- pkg/linux/bitmask-launcher | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 pkg/linux/bitmask-launcher (limited to 'pkg') diff --git a/pkg/linux/bitmask-launcher b/pkg/linux/bitmask-launcher new file mode 100755 index 00000000..550dd134 --- /dev/null +++ b/pkg/linux/bitmask-launcher @@ -0,0 +1,9 @@ +#!/bin/sh +# The Bitmask Launcher +# (c) 2015 - The LEAP Encryption Access Project + +[ -f libQtCore.so.4 ] || ln -s libQtCore.so.4.orig libQtCore.so.4 +[ -f libQtGui.so.4 ] || ln -s libQtGui.so.4.orig libQtGui.so.4 +cat /etc/os-release | grep ID | grep -i ubuntu && unlink libQtCore.so.4 && unlink libQtGui.so.4 + +./bitmask-app "$@" -- cgit v1.2.3 From 09fed97dc5150e38086b443d5e83c6591f5d834f Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 30 Jul 2015 14:35:57 -0700 Subject: [pkg] utility targets on makefile, spec changes --- pkg/pyinst/bitmask.spec | 65 +++++++++++++++++-------------------------------- 1 file changed, 22 insertions(+), 43 deletions(-) (limited to 'pkg') diff --git a/pkg/pyinst/bitmask.spec b/pkg/pyinst/bitmask.spec index efdbf167..2bc2f9d2 100644 --- a/pkg/pyinst/bitmask.spec +++ b/pkg/pyinst/bitmask.spec @@ -1,59 +1,38 @@ # -*- mode: python -*- -a = Analysis(['pkg/pyinst/bitmask.py'], - pathex=['/home/kali/Virtualenvs/leap-pyinst/lib/python2.7/site-packages/zope', '/home/kali/Virtualenvs/leap-pyinst/lib/python2.7/site-packages/zope/interface', '/home/kali/Virtualenvs/leap-pyinst/lib/python2.7/site-packages/zope/proxy', '/home/kali/leap/bitmask_client/src/leap/bitmask'], + +block_cipher = None + + +a = Analysis([os.path.join('pkg', 'pyinst', 'bitmask.py')], hiddenimports=[ 'zope.interface', 'zope.proxy', - 'leap.common', - 'leap.common.config', - 'PySide.QtCore', 'PySide.QtGui', - # not needed with latest develop pyinstaller - 'cryptography.hazmat.bindings.openssl', - 'cryptography.hazmat.bindings.openssl.aes', - 'cryptography.hazmat.bindings.openssl.asn1', - 'cryptography.hazmat.bindings.openssl.bignum', - 'cryptography.hazmat.bindings.openssl.bio', - 'cryptography.hazmat.bindings.openssl.cmac', - 'cryptography.hazmat.bindings.openssl.cms', - 'cryptography.hazmat.bindings.openssl.conf', - 'cryptography.hazmat.bindings.openssl.crypto', - 'cryptography.hazmat.bindings.openssl.dh', - 'cryptography.hazmat.bindings.openssl.dsa', - 'cryptography.hazmat.bindings.openssl.ec', - 'cryptography.hazmat.bindings.openssl.ecdh', - 'cryptography.hazmat.bindings.openssl.ecdsa', - 'cryptography.hazmat.bindings.openssl.engine', - 'cryptography.hazmat.bindings.openssl.err', - 'cryptography.hazmat.bindings.openssl.evp', - 'cryptography.hazmat.bindings.openssl.hmac', - 'cryptography.hazmat.bindings.openssl.nid', - 'cryptography.hazmat.bindings.openssl.objects', - 'cryptography.hazmat.bindings.openssl.opensslv', - 'cryptography.hazmat.bindings.openssl.osrandom_engine', - 'cryptography.hazmat.bindings.openssl.pem', - 'cryptography.hazmat.bindings.openssl.pkcs12', - 'cryptography.hazmat.bindings.openssl.pkcs7', - 'cryptography.hazmat.bindings.openssl.rand', - 'cryptography.hazmat.bindings.openssl.rsa', - 'cryptography.hazmat.bindings.openssl.ssl', - 'cryptography.hazmat.bindings.openssl.x509name', - 'cryptography.hazmat.bindings.openssl.x509', - 'cryptography.hazmat.bindings.openssl.x509v3', - 'cryptography.hazmat.bindings.openssl.x509_vfy'], + 'PySide.QtCore', 'PySide.QtGui'], hookspath=None, - runtime_hooks=None) -pyz = PYZ(a.pure) + 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=None, + strip=False, upx=True, - console=True ) + console=False ) coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, - strip=None, + 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') -- cgit v1.2.3 From 568bfec7387fda24ad516a3b1ecedb017c8e8e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Fri, 31 Jul 2015 09:00:38 +0200 Subject: [feat] use wheels to install dependencies generate_wheels uses $WHEELHOUSE to generate and store the wheels for requirements.pip and requirements-testing.pip (if it exists). pip_install_requirements.sh installs requirements.pip from them if possible (if not, then it fetches them from pypi) or, if passed the --testing flag, it installs requirements-testing.pip. Related: #7327 --- pkg/generate_wheels.sh | 13 ++++++++ pkg/pip_install_requirements.sh | 71 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100755 pkg/generate_wheels.sh (limited to 'pkg') diff --git a/pkg/generate_wheels.sh b/pkg/generate_wheels.sh new file mode 100755 index 00000000..a13e2c7a --- /dev/null +++ b/pkg/generate_wheels.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Generate wheels for dependencies +# Use at your own risk. + +if [ "$WHEELHOUSE" = "" ]; then + WHEELHOUSE=$HOME/wheelhouse +fi + +pip wheel --wheel-dir $WHEELHOUSE pip +pip wheel --wheel-dir $WHEELHOUSE -r pkg/requirements.pip +if [ -f pkg/requirements-testing.pip ]; then + pip wheel --wheel-dir $WHEELHOUSE -r pkg/requirements-testing.pip +fi diff --git a/pkg/pip_install_requirements.sh b/pkg/pip_install_requirements.sh index 29f03f3a..949f738d 100755 --- a/pkg/pip_install_requirements.sh +++ b/pkg/pip_install_requirements.sh @@ -1,4 +1,69 @@ #!/bin/sh -# Update pip and install LEAP base requirements. -pip install -U pip -pip install -r pkg/requirements.pip +# Update pip and install LEAP base/testing requirements. +# For convenience, $insecure_packages are allowed with insecure flags enabled. +# Use at your own risk. +# See $usage for help + +insecure_packages="dirspec" + +return_wheelhouse() { + if [ "$WHEELHOUSE" = "" ]; then + WHEELHOUSE=$HOME/wheelhouse + fi + + if [ ! -d "$WHEELHOUSE" ]; then + mkdir $WHEELHOUSE + fi + + echo "$WHEELHOUSE" +} + +show_help() { + usage="Usage: $0 [--testing]\n --testing\tInstall dependencies from requirements-testing.pip\n +\t\tOtherwise, it will install requirements.pip" + echo $usage + + exit 1 +} + +process_arguments() { + testing=false + while [ "$#" -gt 0 ]; do + # From http://stackoverflow.com/a/31443098 + case "$1" in + --help) show_help;; + --testing) testing=true; shift 1;; + + -h) show_help;; + -*) echo "unknown option: $1" >&2; exit 1;; + esac + done +} + +return_insecure_flags() { + for insecure_package in $insecure_packages; do + flags="$flags --allow-external $insecure_package --allow-unverified $insecure_package" + done + + echo $flags +} + +return_packages() { + if $testing ; then + packages="-r pkg/requirements-testing.pip" + else + packages="-r pkg/requirements.pip" + fi + + echo $packages +} + +process_arguments $@ +wheelhouse=`return_wheelhouse` +install_options="-U --find-links=$wheelhouse" +insecure_flags=`return_insecure_flags` +packages=`return_packages` + +pip install -U wheel +pip install $install_options pip +pip install $install_options $insecure_flags $packages -- cgit v1.2.3 From efd5a850fb0938d4bb61f9a73f3608523092bfcf Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 4 Aug 2015 14:56:15 -0400 Subject: [tests] add flake8 to testing requirements, flake8 config --- pkg/requirements-testing.pip | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements-testing.pip b/pkg/requirements-testing.pip index e789664a..ede94516 100644 --- a/pkg/requirements-testing.pip +++ b/pkg/requirements-testing.pip @@ -7,12 +7,5 @@ mock unittest2 # TODO we should include this dep only for python2.6 coverage pep8>=1.1 +flake8 tox - -#sphinx>=1.1.2 - -# double reqs -# (the client already includes, which gives some errors) -# ----------- -#twisted -#zope.interface -- cgit v1.2.3 From c063a253a4ea12d19844dcf8d368f8b50789d3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 6 Aug 2015 09:02:11 +0200 Subject: [feat] WHEELHOUSE can be a url + --use-leap-wheels --use-leap-wheels sets --trusted-host (remove it when we have a proper cert) and WHEELHOUSE to https://ftp.lizard.leap.se Until we get ftp.lizard cname, use lizard as the wheels server. - Related: #7339 --- pkg/pip_install_requirements.sh | 53 +++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'pkg') diff --git a/pkg/pip_install_requirements.sh b/pkg/pip_install_requirements.sh index 949f738d..6d8ed28b 100755 --- a/pkg/pip_install_requirements.sh +++ b/pkg/pip_install_requirements.sh @@ -1,38 +1,31 @@ -#!/bin/sh +#!/bin/bash # Update pip and install LEAP base/testing requirements. # For convenience, $insecure_packages are allowed with insecure flags enabled. # Use at your own risk. # See $usage for help insecure_packages="dirspec" - -return_wheelhouse() { - if [ "$WHEELHOUSE" = "" ]; then - WHEELHOUSE=$HOME/wheelhouse - fi - - if [ ! -d "$WHEELHOUSE" ]; then - mkdir $WHEELHOUSE - fi - - echo "$WHEELHOUSE" -} +leap_wheelhouse=https://lizard.leap.se/wheels show_help() { - usage="Usage: $0 [--testing]\n --testing\tInstall dependencies from requirements-testing.pip\n -\t\tOtherwise, it will install requirements.pip" - echo $usage + usage="Usage: $0 [--testing] [--use-leap-wheels]\n --testing\t\tInstall dependencies from requirements-testing.pip\n +\t\t\tOtherwise, it will install requirements.pip\n +--use-leap-wheels\tUse wheels from leap.se" + echo -e $usage exit 1 } process_arguments() { testing=false + use_leap_wheels=false + while [ "$#" -gt 0 ]; do # From http://stackoverflow.com/a/31443098 case "$1" in --help) show_help;; --testing) testing=true; shift 1;; + --use-leap-wheels) use_leap_wheels=true; shift 1;; -h) show_help;; -*) echo "unknown option: $1" >&2; exit 1;; @@ -40,6 +33,31 @@ process_arguments() { done } +return_wheelhouse() { + if $use_leap_wheels ; then + WHEELHOUSE=$leap_wheelhouse + elif [ "$WHEELHOUSE" = "" ]; then + WHEELHOUSE=$HOME/wheelhouse + fi + + # Tested with bash and zsh + if [[ $WHEELHOUSE != http* && ! -d "$WHEELHOUSE" ]]; then + mkdir $WHEELHOUSE + fi + + echo "$WHEELHOUSE" +} + +return_install_options() { + wheelhouse=`return_wheelhouse` + install_options="-U --find-links=$wheelhouse" + if $use_leap_wheels ; then + install_options="$install_options --trusted-host lizard.leap.se" + fi + + echo $install_options +} + return_insecure_flags() { for insecure_package in $insecure_packages; do flags="$flags --allow-external $insecure_package --allow-unverified $insecure_package" @@ -59,8 +77,7 @@ return_packages() { } process_arguments $@ -wheelhouse=`return_wheelhouse` -install_options="-U --find-links=$wheelhouse" +install_options=`return_install_options` insecure_flags=`return_insecure_flags` packages=`return_packages` -- cgit v1.2.3 From 876fb9c0cf1f9145e478c8ed4bf6dabe7d62b1ff Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 5 Aug 2015 19:03:34 -0700 Subject: [pkg] make postmkenv working in osx we won't be using this for packaging though. it can be useful to avoid installing it, although installing from wheel is quite straightforward in osx. --- pkg/postmkvenv.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh index 015464d3..2407c69b 100755 --- a/pkg/postmkvenv.sh +++ b/pkg/postmkvenv.sh @@ -23,6 +23,7 @@ VAR=( $(which -a $PYTHON_VERSION) ) # this takes care of the /usr/lib vs /usr/lib64 differences between platforms GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib(plat_specific=True))" +GET_PYSIDE_LIB_CMD="import PySide; print '/'.join(PySide.__path__[0].split('/')[:-1])" LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD") @@ -34,7 +35,7 @@ elif [[ $platform == 'darwin' ]]; then PATH=${PATH/:/|} # remove everything up to | from path PATH=${PATH/*|/} - LIB_SYSTEM_PATH=$(python -c "$GET_PYTHON_LIB_CMD") + LIB_SYSTEM_PATH=$(/usr/bin/python -c "$GET_PYSIDE_LIB_CMD") PATH=$ORIGINAL_PATH else echo "unsupported platform; not doing symlinks" -- cgit v1.2.3 From a688be4894e6f7bfc4dad414b2b4c0f747af945b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 5 Aug 2015 22:48:52 -0400 Subject: [pkg] remove old files, update README a little --- pkg/osx/Info.plist | 24 ------------------------ pkg/osx/README.rst | 27 ++++++++++++--------------- pkg/osx/leap-client.spec | 36 ------------------------------------ 3 files changed, 12 insertions(+), 75 deletions(-) delete mode 100644 pkg/osx/Info.plist delete mode 100644 pkg/osx/leap-client.spec (limited to 'pkg') diff --git a/pkg/osx/Info.plist b/pkg/osx/Info.plist deleted file mode 100644 index dc427c4a..00000000 --- a/pkg/osx/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDisplayName - Bitmask - CFBundleExecutable - app - CFBundleIconFile - bitmask.icns - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Bitmask - CFBundlePackageType - APPL - CFBundleShortVersionString - 1 - LSBackgroundOnly - - CFBundleIdentifier - se.leap.bitmask - - diff --git a/pkg/osx/README.rst b/pkg/osx/README.rst index 03aac4f2..92799ebd 100644 --- a/pkg/osx/README.rst +++ b/pkg/osx/README.rst @@ -1,31 +1,28 @@ environment setup in osx ======================== -(I rm'd my README by mistake at some point. Re-do). + +TODO:: REALLY old notes, adapting to newest flow. basically you need this to setup your environment: # check and consolidate -# install xcode and macports -# port -v selfupdate -# port install python26 -# port install python_select -# port select python python26 -# port install py26-pyqt4 -# port install py26-pip -# port install py26-virtualenv -# port install git-core -# port install platypus -# port install upx +# install xcode and homebrew + +# brew install python2.7 +# brew install python-virtualenwrapper +# brew install qt +# brew install git +# brew install platypus +# brew install upx Requirements ============ pyinstaller ----------- -Expected in ~/pyinstaller -You need the development version. -Tested with: 2.0.373 +You need the development version. do `python setup.py develop` inside your +virtualenv. platypus (tested with latest macports) diff --git a/pkg/osx/leap-client.spec b/pkg/osx/leap-client.spec deleted file mode 100644 index 91aa20d6..00000000 --- a/pkg/osx/leap-client.spec +++ /dev/null @@ -1,36 +0,0 @@ -# -*- mode: python -*- -a = Analysis(['../../src/leap/app.py'], - pathex=[ - '../../src/leap', - '/Users/kaliy/leap/leap_client/src/leap-client/pkg/osx'], - hiddenimports=['atexit', 'leap.common'], - hookspath=None) -pyz = PYZ(a.pure) -exe = EXE(pyz, - a.scripts, - exclude_binaries=1, - name=os.path.join('build/pyi.darwin/leap-client', 'app'), - debug=False, - strip=True, - upx=True, - console=False) -coll = COLLECT(exe, - a.binaries + - # this will easitly break if we setup the venv - # somewhere else. FIXME - [('cacert.pem', '/Users/kaliy/.Virtualenvs/leap-client/lib/python2.6/site-packages/requests-1.1.0-py2.6.egg/requests/cacert.pem', 'DATA'), - ], - a.zipfiles, - a.datas, - strip=True, - upx=True, - name=os.path.join('dist', 'app')) -app = BUNDLE(coll, - name=os.path.join('dist', 'leap-client.app')) - -import sys -if sys.platform.startswith("darwin"): - app = BUNDLE(coll, - name=os.path.join('dist', 'LEAP Client.app'), - appname='LEAP Client', - version=1) -- cgit v1.2.3 From b5d7e5ec7b4532e39c36762a93a2c878d28d6931 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Mon, 10 Aug 2015 17:03:46 +0200 Subject: [feat] Add script apply_updates.py for pyinstaller bundle apply_updates.py applies the already downloaded files from the updates folder and removes all the obsolete files from the bundle. It's meant to be use by the pyinstaller bundle. - Resolves: #7342 - Related: #5876 --- pkg/tuf/apply_updates.py | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 pkg/tuf/apply_updates.py (limited to 'pkg') diff --git a/pkg/tuf/apply_updates.py b/pkg/tuf/apply_updates.py new file mode 100644 index 00000000..7b52ef11 --- /dev/null +++ b/pkg/tuf/apply_updates.py @@ -0,0 +1,83 @@ +#!/usr/local/bin python +# -*- coding: utf-8 -*- +# apply_updates.py +# Copyright (C) 2015 LEAP +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +""" +Apply downloaded updates to the bundle +""" + +import os +import os.path +import shutil +import tuf.client.updater + + +REPO_DIR = "repo/" +UPDATES_DIR = "updates/" + + +def update_if_needed(): + if not os.path.isdir(UPDATES_DIR): + print "No updates found" + return + + print "Found updates, merging directories before doing anything..." + try: + remove_obsolete() + merge_directories(UPDATES_DIR, ".") + shutil.rmtree(UPDATES_DIR) + except Exception as e: + print "An error has ocurred while updating: " + e.message + + +def remove_obsolete(): + tuf.conf.repository_directory = REPO_DIR + updater = tuf.client.updater.Updater('leap-updater', {}) + updater.remove_obsolete_targets(".") + + +def merge_directories(src, dest): + for root, dirs, files in os.walk(src): + if not os.path.exists(root): + # It was moved as the dir din't exist in dest + continue + + destroot = os.path.join(dest, root[len(src):]) + + for f in files: + srcpath = os.path.join(root, f) + destpath = os.path.join(destroot, f) + if os.path.exists(destpath): + # FIXME: On windows we can't remove, but we can rename and + # afterwards remove. is that still true with python? + # or was just something specific of our implementation + # with C++? + os.remove(destpath) + os.rename(srcpath, destpath) + + for d in dirs: + srcpath = os.path.join(root, d) + destpath = os.path.join(destroot, d) + + if os.path.exists(destpath) and not os.path.isdir(destpath): + os.remove(destpath) + + if not os.path.exists(destpath): + os.rename(srcpath, destpath) + + +if __name__ == "__main__": + update_if_needed() -- cgit v1.2.3 From 4e018bf8d909a2f5a2accc4f1ee89df4a2aa5cf6 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 24 Aug 2015 15:24:38 -0400 Subject: [pkg] add new .icns file for mac bundle --- pkg/osx/bitmask.icns | Bin 47303 -> 239193 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'pkg') diff --git a/pkg/osx/bitmask.icns b/pkg/osx/bitmask.icns index 7cc3e752..74fa0af6 100644 Binary files a/pkg/osx/bitmask.icns and b/pkg/osx/bitmask.icns differ -- cgit v1.2.3 From dde1b5289b12fa034eae10dfdf9354d0c7cd93bc Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 24 Aug 2015 17:42:20 -0400 Subject: [pkg] fetch origin before checkout --- pkg/scripts/checkout_leap_versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/scripts/checkout_leap_versions.sh b/pkg/scripts/checkout_leap_versions.sh index 9d6c6fab..5381625b 100755 --- a/pkg/scripts/checkout_leap_versions.sh +++ b/pkg/scripts/checkout_leap_versions.sh @@ -3,5 +3,5 @@ cat pkg/leap_versions.txt | while read line do package=$(echo $line | cut -f1 -d' ') tag=$(echo $line | cut -f2 -d' ') - cd ../$package && git checkout $tag + cd ../$package && git fetch origin && git checkout $tag done -- cgit v1.2.3