From aaf8ae30d7d85849b91cb931d95e2f8fd2b33633 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 10 Jun 2014 10:31:19 -0700 Subject: [PATCH] starting OSX packaging --- .gitignore | 3 +++ BUILD.md | 13 +++++++++++++ MANIFEST.in | 11 ++++++++--- setup.py | 32 ++++++++++++++++++++++++-------- setup/onionshare_osx.py | 2 ++ 5 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 BUILD.md create mode 100644 setup/onionshare_osx.py diff --git a/.gitignore b/.gitignore index 8bbc194b..946449ad 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ nosetests.xml # vim *.swp + +# OSX +.DS_Store diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 00000000..fba88efc --- /dev/null +++ b/BUILD.md @@ -0,0 +1,13 @@ +# Building OnionShare + +## Mac OS X + +If you don't already have pip installed, install it like this: + + sudo easy_install pip + +Then use pip to install py2app: + + sudo pip install py2app + + diff --git a/MANIFEST.in b/MANIFEST.in index 7e61731a..13271fc4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,12 @@ include LICENSE include README.md +include BUILD.md include version -include onionshare/*.html +include onionshare/index.html include onionshare/strings.json -include onionshare_gui/templates/* -include onionshare_gui/static/* +include onionshare_gui/templates/index.html +include onionshare_gui/static/jquery-1.11.1.min.js +include onionshare_gui/static/onionshare.js +include onionshare_gui/static/style.css +include onionshare_gui/static/loader.gif +include onionshare_gui/static/logo.png diff --git a/setup.py b/setup.py index e982c265..ce8e524d 100644 --- a/setup.py +++ b/setup.py @@ -14,12 +14,27 @@ if sys.argv[-1] == 'publish': version = open('version').read().strip() -def get_data_files(): - if platform.system == 'Linux': - return [('/usr/share/applications', ['setup/onionshare.desktop']), - ('/usr/share/pixmaps', ['setup/onionshare80.xpm'])] - else: - return None +APP = None +DATA_FILES = [ + ('/usr/share/applications', ['setup/onionshare.desktop']), + ('/usr/share/pixmaps', ['setup/onionshare80.xpm']) +] +OPTIONS = None + +if platform.system() == 'Darwin': + APP = ['setup/onionshare_osx.py'] + DATA_FILES = ['LICENSE', 'README.md', 'BUILD.md', 'version', 'onionshare', 'onionshare_gui'] + OPTIONS = { + 'py2app': { + 'argv_emulation': True, + #'iconfile': 'setup/onionshare.icns', + 'packages': ['flask', 'stem'], + 'site_packages': True, + 'plist': { + 'CFBundleName': 'OnionShare', + } + } + } setup( name='onionshare', @@ -38,6 +53,7 @@ setup( keywords='onion, share, onionshare, tor, anonymous, web server', packages=['onionshare', 'onionshare_gui'], scripts=['bin/onionshare', 'bin/onionshare-gui'], - data_files=[('/usr/share/applications', ['setup/onionshare.desktop']), - ('/usr/share/pixmaps', ['setup/onionshare80.xpm'])] + data_files=DATA_FILES, + app=APP, + options=OPTIONS ) diff --git a/setup/onionshare_osx.py b/setup/onionshare_osx.py new file mode 100644 index 00000000..f0b9b7c0 --- /dev/null +++ b/setup/onionshare_osx.py @@ -0,0 +1,2 @@ +import onionshare_gui +onionshare_gui.main()