summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-01-02 18:06:13 +0900
committerkali <kali@leap.se>2013-01-02 18:09:25 +0900
commit4ad663b935fa1845d426dde99a8272942b620e11 (patch)
tree28aacf15e8a2f2d5ee3a4840641776c54f2ae63d
parent5a99186cbc1b4fc8dbd317b56f3a620b2a9f79a4 (diff)
initial OSX packaging
-rw-r--r--.gitignore3
-rw-r--r--data/images/leap-client.icnsbin0 -> 27456 bytes
-rw-r--r--pkg/osx/Info.plist22
-rw-r--r--pkg/osx/Makefile17
-rw-r--r--pkg/osx/README.rst10
-rw-r--r--pkg/osx/leap-client.spec32
-rwxr-xr-xpkg/postmkvenv.sh17
-rw-r--r--src/leap/util/leap_argparse.py2
8 files changed, 101 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 276f782a..bbe004c4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*.swp
*.swo
*.pyc
+*.log
.*
!.coveragerc
!.tx
@@ -21,4 +22,6 @@ src/leap_client.egg-info
src/leap/_branding.py
src/leap/certs/*.pem
src/*.egg-info
+pkg/osx/dist
+pkg/osx/build
MANIFEST
diff --git a/data/images/leap-client.icns b/data/images/leap-client.icns
new file mode 100644
index 00000000..d5d52cdc
--- /dev/null
+++ b/data/images/leap-client.icns
Binary files differ
diff --git a/pkg/osx/Info.plist b/pkg/osx/Info.plist
new file mode 100644
index 00000000..e90d920a
--- /dev/null
+++ b/pkg/osx/Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>leap-client</string>
+ <key>CFBundleExecutable</key>
+ <string>MacOS/app</string>
+ <key>CFBundleIconFile</key>
+ <string>icon-windowed.icns</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>leap-client</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1</string>
+ <key>LSBackgroundOnly</key>
+ <false/>
+</dict>
+</plist>
diff --git a/pkg/osx/Makefile b/pkg/osx/Makefile
new file mode 100644
index 00000000..54fbf14a
--- /dev/null
+++ b/pkg/osx/Makefile
@@ -0,0 +1,17 @@
+pkg : dist dmg
+
+dist :
+ ~/pyinstaller/pyinstaller.py -w -s leap-client.spec
+ cp -r /opt/local/Library/Frameworks/QtGui.framework/Versions/4/Resources/qt_menu.nib "dist/LEAP Client.app/Contents/Resources"
+ cp Info.plist "dist/LEAP Client.app/Contents/Info.plist"
+ cp ../../data/images/leap-client.icns "dist/LEAP Client.app/Contents/Resources/icon-windowed.icns"
+
+
+dmg :
+ #TODO: remove if already present
+ #rm dist/LEAPClient.dmg
+ hdiutil create -format UDBZ -srcfolder "dist/LEAP Client.app/" "dist/LEAP Client.dmg"
+
+clean :
+ rm -rf dist/ build/
+
diff --git a/pkg/osx/README.rst b/pkg/osx/README.rst
new file mode 100644
index 00000000..dfd8fc16
--- /dev/null
+++ b/pkg/osx/README.rst
@@ -0,0 +1,10 @@
+freezing the app
+----------------
+just type, from this dir::
+
+ $ make dist
+ $ make dmg
+
+For doing both things::
+
+ $ make pkg
diff --git a/pkg/osx/leap-client.spec b/pkg/osx/leap-client.spec
new file mode 100644
index 00000000..4a34bb7c
--- /dev/null
+++ b/pkg/osx/leap-client.spec
@@ -0,0 +1,32 @@
+# -*- mode: python -*-
+a = Analysis(['../../src/leap/app.py'],
+ pathex=[
+ '../../src/leap',
+ '/Users/kaliy/leap/leap-client-testbuild/src/leap-client/pkg/osx'],
+ hiddenimports=['atexit'],
+ 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,
+ 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)
diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh
index efdbc2fb..593b11da 100755
--- a/pkg/postmkvenv.sh
+++ b/pkg/postmkvenv.sh
@@ -8,6 +8,14 @@
# script fails in ubuntu, with path: /usr/lib/pymodules/python2.7/PyQt4
# use import PyQt4; PyQt4.__path__ instead
+platform='unknown'
+unamestr=`uname`
+if [[ "$unamestr" == 'Linux' ]]; then
+ platform='linux'
+elif [[ "$unamestr" == 'Darwin' ]]; then
+ platform='darwin'
+fi
+
LIBS=( PyQt4 sip.so )
PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))")
@@ -15,7 +23,14 @@ VAR=( $(which -a $PYTHON_VERSION) )
GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD")
-LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD")
+
+if [[ $platform == 'linux' ]]; then
+ LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD")
+elif [[ $platform == 'darwin' ]]; then
+ LIB_SYSTEM_PATH=$(/opt/local/bin/python2.6 -c "$GET_PYTHON_LIB_CMD")
+else
+ echo "unsupported platform; not doing symlinks"
+fi
for LIB in ${LIBS[@]}
do
diff --git a/src/leap/util/leap_argparse.py b/src/leap/util/leap_argparse.py
index 2f996a31..5b0775cc 100644
--- a/src/leap/util/leap_argparse.py
+++ b/src/leap/util/leap_argparse.py
@@ -37,5 +37,5 @@ Launches main LEAP Client""", epilog=epilog)
def init_leapc_args():
parser = build_parser()
- opts = parser.parse_args()
+ opts, unknown = parser.parse_known_args()
return parser, opts