diff options
author | Ciro Mattia Gonano <ciromattia@gmail.com> | 2012-12-09 12:37:25 +0100 |
---|---|---|
committer | Ciro Mattia Gonano <ciromattia@gmail.com> | 2012-12-09 12:37:25 +0100 |
commit | 4d96eb346f90d33bdc3aef2555e86c112c18e241 (patch) | |
tree | cb89a028f01f58069358a26d8a62c4095f2e17ce /setup.py | |
parent | Return if rarfile module is not found (diff) | |
download | kcc-4d96eb346f90d33bdc3aef2555e86c112c18e241.tar.gz kcc-4d96eb346f90d33bdc3aef2555e86c112c18e241.tar.bz2 kcc-4d96eb346f90d33bdc3aef2555e86c112c18e241.zip |
Preparing the field for switching towards a full-fledged app (get rid of AppleScript) via py2app/py2exe
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f2628e9 --- /dev/null +++ b/setup.py @@ -0,0 +1,73 @@ +""" +py2app/py2exe build script for MyApplication. + +Will automatically ensure that all build prerequisites are available +via ez_setup + +Usage (Mac OS X): + python setup.py py2app + +Usage (Windows): + python setup.py py2exe +""" +import ez_setup +ez_setup.use_setuptools() + +import sys +from setuptools import setup + +NAME="KindleComicConverter" +VERSION="1.2.0" +IDENTIFIER="com.github.ciromattia.kcc" +EXENAME="KindleComicConverter" + +APP = ['kcc/comic2ebook.py'] +DATA_FILES = [] +OPTIONS = { 'argv_emulation': True, + 'iconfile': 'resources/comic2ebook.icns', + 'includes': 'kcc/*.py'} + +if sys.platform == 'darwin': + extra_options = dict( + setup_requires=['py2app'], + options=dict( + py2app=dict(OPTIONS, + resources=['LICENSE.txt','resources/Scripts','resources/description.rtfd'], + plist=dict( + CFBundleName = NAME, + CFBundleShortVersionString = VERSION, + CFBundleGetInfoString = NAME + " " + VERSION, + CFBundleExecutable = EXENAME, + CFBundleIdentifier = IDENTIFIER, + CFBundleDocumentTypes = dict( + CFBundleTypeExtensions=["zip","rar","cbz","cbr"], + CFBundleTypeName="Comics", + CFBundleTypeRole="Editor", + LSItemContentTypes = [ + "public.plain-text", + "public.text", + "public.data", + "com.apple.application-bundle" + ] + ) + ) + ) + ) + ) +elif sys.platform == 'win32': + extra_options = dict( + setup_requires=['py2exe'], + ) +else: + extra_options = dict( + # Normally unix-like platforms will use "setup.py install" + # and install the main script as such + scripts=APP, + ) + +setup( + name=NAME, + app=APP, + data_files=DATA_FILES, + **extra_options +) |