diff options
author | Micah Lee <micah@micahflee.com> | 2015-05-15 16:56:22 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2015-05-15 16:56:22 -0700 |
commit | a86cda45491bf20c1b78f63d466cad031d95bf6a (patch) | |
tree | 7c095aad9dc829818ff4fa16d29ff4d6e25b72d2 /setup.py | |
parent | aae9995c5f09a896c668aaaab303f5bc547d358f (diff) | |
download | onionshare-a86cda45491bf20c1b78f63d466cad031d95bf6a.tar.gz onionshare-a86cda45491bf20c1b78f63d466cad031d95bf6a.zip |
Ripping out dmg code, replacing pyinstaller with py2app for OSX -- still in progress (#151)
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 107 |
1 files changed, 66 insertions, 41 deletions
@@ -20,14 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import os, sys, platform -from glob import glob try: from setuptools import setup except ImportError: from distutils.core import setup - def file_list(path): files = [] for filename in os.listdir(path): @@ -35,7 +33,7 @@ def file_list(path): files.append(path+'/'+filename) return files - +system = platform.system() version = open('version').read().strip() description = ( @@ -50,41 +48,68 @@ long_description = description + " " + ( """just needs to use Tor Browser to download the file from you.""" ) -setup( - name='onionshare', - version=version, - description=description, - long_description=long_description, - author='Micah Lee', - author_email='micah@micahflee.com', - url='https://github.com/micahflee/onionshare', - license="GPL v3", - keywords='onion, share, onionshare, tor, anonymous, web server', - packages=['onionshare', 'onionshare_gui'], - include_package_data=True, - scripts=['bin/onionshare', 'bin/onionshare-gui'], - data_files=[ - (os.path.join(sys.prefix, 'share/applications'), ['install/onionshare.desktop']), - (os.path.join(sys.prefix, 'share/pixmaps'), ['install/onionshare80.xpm']), - (os.path.join(sys.prefix, 'share/onionshare/images'), [ - 'images/logo.png', - 'images/drop_files.png', - 'images/server_stopped.png', - 'images/server_started.png', - 'images/server_working.png' - ]), - (os.path.join(sys.prefix, 'share/onionshare/locale'), [ - 'locale/de.json', - 'locale/en.json', - 'locale/es.json', - 'locale/fi.json', - 'locale/fr.json', - 'locale/it.json', - 'locale/nl.json', - 'locale/no.json', - 'locale/pt.json', - 'locale/ru.json', - 'locale/tr.json' - ]) - ] -) +images = [ + 'images/logo.png', + 'images/drop_files.png', + 'images/server_stopped.png', + 'images/server_started.png', + 'images/server_working.png' +] + +locale = [ + 'locale/de.json', + 'locale/en.json', + 'locale/es.json', + 'locale/fi.json', + 'locale/fr.json', + 'locale/it.json', + 'locale/nl.json', + 'locale/no.json', + 'locale/pt.json', + 'locale/ru.json', + 'locale/tr.json' +] + +if system == 'Linux': + setup( + name='onionshare', + version=version, + description=description, + long_description=long_description, + author='Micah Lee', + author_email='micah@micahflee.com', + url='https://github.com/micahflee/onionshare', + license="GPL v3", + keywords='onion, share, onionshare, tor, anonymous, web server', + packages=['onionshare', 'onionshare_gui'], + include_package_data=True, + scripts=['bin/onionshare', 'bin/onionshare-gui'], + data_files=[ + (os.path.join(sys.prefix, 'share/applications'), ['install/onionshare.desktop']), + (os.path.join(sys.prefix, 'share/pixmaps'), ['install/onionshare80.xpm']), + (os.path.join(sys.prefix, 'share/onionshare/images'), images), + (os.path.join(sys.prefix, 'share/onionshare/locale'), locale) + ] + ) + +elif system == 'Darwin': + setup( + name='OnionShare', + version=version, + description=description, + long_description=long_description, + app=['install/onionshare-launcher.py'], + data_files=[ + ('images', images), + ('locale', locale) + ], + options={ + 'py2app': { + 'argv_emulation': True, + 'iconfile':'install/onionshare.icns', + 'includes': ['pip', 'PyQt4', 'PyQt4.QtCore', 'PyQt4.QtGui'], + 'excludes': ['PyQt4.QtDesigner', 'PyQt4.QtNetwork', 'PyQt4.QtOpenGL', 'PyQt4.QtScript', 'PyQt4.QtSql', 'PyQt4.QtTest', 'PyQt4.QtWebKit', 'PyQt4.QtXml', 'PyQt4.phonon'] + } + }, + setup_requires=['py2app'], + ) |