diff options
author | Paweł Jastrzębski <pawelj@iosphe.re> | 2017-08-20 11:23:22 +0200 |
---|---|---|
committer | Paweł Jastrzębski <pawelj@iosphe.re> | 2017-08-20 12:21:21 +0200 |
commit | d77f04a84e53ec4f54ac464a3694746c66187860 (patch) | |
tree | 886df9cc8b9dc55ce1e86a4e692bb061325a99f8 /setup.py | |
parent | Travis update (diff) | |
download | kcc-d77f04a84e53ec4f54ac464a3694746c66187860.tar.gz kcc-d77f04a84e53ec4f54ac464a3694746c66187860.tar.bz2 kcc-d77f04a84e53ec4f54ac464a3694746c66187860.zip |
Implemented new build enviroments
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/setup.py b/setup.py index 563e5cb..fc03362 100755 --- a/setup.py +++ b/setup.py @@ -31,12 +31,11 @@ class BuildBinaryCommand(distutils.cmd.Command): def finalize_options(self): pass + # noinspection PyShadowingNames def run(self): + VERSION = __version__ if sys.platform == 'darwin': - if os.path.isfile('Kindle Comic Converter.spec'): - os.system('pyinstaller "Kindle Comic Converter.spec"') - else: - os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py') + os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py') shutil.copy('other/osx/7za', 'dist/Kindle Comic Converter.app/Contents/Resources') shutil.copy('other/osx/unrar', 'dist/Kindle Comic Converter.app/Contents/Resources') shutil.copy('other/osx/Info.plist', 'dist/Kindle Comic Converter.app/Contents') @@ -44,20 +43,32 @@ class BuildBinaryCommand(distutils.cmd.Command): shutil.copy('other/windows/Additional-LICENSE.txt', 'dist/Kindle Comic Converter.app/Contents/Resources') os.chmod('dist/Kindle Comic Converter.app/Contents/Resources/unrar', 0o777) os.chmod('dist/Kindle Comic Converter.app/Contents/Resources/7za', 0o777) - if os.path.isfile('setup.sh'): - os.system('./setup.sh') os.system('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg') exit(0) elif sys.platform == 'win32': - if os.path.isfile('KCC.spec'): - os.system('pyinstaller KCC.spec') - else: - os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w --noupx kcc.py') - if os.path.isfile('setup.bat'): - os.system('setup.bat') + os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w --noupx kcc.py') + if os.getenv('APPVEYOR'): + if len(VERSION) == 3: + VERSION = VERSION + '.0' + os.system('setup.bat ' + VERSION) exit(0) else: - os.system('docker run --rm -v ' + os.getcwd() + ':/app -e KCCVER=' + VERSION + ' acidweb/kcc') + os.system('pyinstaller -F -s kcc.py') + os.system('mkdir -p dist/usr/bin dist/usr/share/applications dist/usr/share/doc/kindlecomicconverter ' + 'dist/usr/share/kindlecomicconverter dist/usr/share/lintian/overrides') + os.system('mv dist/kcc dist/usr/bin') + os.system('cp icons/comic2ebook.png dist/usr/share/kindlecomicconverter') + os.system('cp LICENSE.txt dist/usr/share/doc/kindlecomicconverter/copyright') + os.system('cp other/linux/kindlecomicconverter.desktop dist/usr/share/applications') + os.system('cp other/linux/kindlecomicconverter dist/usr/share/lintian/overrides') + os.chdir('dist') + os.system('fpm -f -s dir -t deb -n kindlecomicconverter -v ' + VERSION + + ' -m "Paweł Jastrzębski <pawelj@iosphe.re>" --license "ISC" ' + '--description "$(printf "Comic and Manga converter for e-book ' + 'readers.\nThis app allows you to transform your PNG, JPG, GIF, ' + 'CBZ, CBR and CB7 files\ninto EPUB or MOBI format e-books.")" ' + '--url "https://kcc.iosphe.re/" --deb-priority "optional" --vendor "" ' + '--category "graphics" -d "unrar | unrar-free" -d "p7zip-full" -d "libc6" usr') exit(0) setuptools.setup( |