about summary refs log tree commit diff
path: root/setup.py
diff options
context:
space:
mode:
authorPaweł Jastrzębski <[email protected]>2017-03-17 11:11:00 +0100
committerGitHub <[email protected]>2017-03-17 11:11:00 +0100
commitc01ff83fce6e91a7ee417c113377996400770572 (patch)
treec76b5d0398d5085a7a57e63a688856f28c3cab1b /setup.py
parentMerge pull request #224 from ciromattia/dev (diff)
parentUpdate README.md (diff)
downloadkcc-c01ff83fce6e91a7ee417c113377996400770572.tar.gz
kcc-c01ff83fce6e91a7ee417c113377996400770572.tar.bz2
kcc-c01ff83fce6e91a7ee417c113377996400770572.zip
Merge pull request #231 from ciromattia/dev
5.3.1
Diffstat (limited to '')
-rwxr-xr-xsetup.py92
1 files changed, 23 insertions, 69 deletions
diff --git a/setup.py b/setup.py
index d355265..7e330fe 100755
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ Usage (Windows):
     py -3 setup.py build_binary
 
 Usage (Linux/OS X):
-    python3 setup.py build_binary or python3 setup.py build_binary --pyz
+    python3 setup.py build_binary
 """
 
 import os
@@ -20,8 +20,6 @@ from kindlecomicconverter import __version__
 NAME = 'KindleComicConverter'
 MAIN = 'kcc.py'
 VERSION = __version__
-OPTIONS = {}
-
 
 class BuildBinaryCommand(distutils.cmd.Command):
     description = 'build binary release'
@@ -62,74 +60,12 @@ class BuildBinaryCommand(distutils.cmd.Command):
                 os.system('setup.bat')
             exit(0)
         else:
-            if self.pyz:
-                script = '''
-                cp kcc.py __main__.py
-                zip kcc.zip __main__.py kindlecomicconverter/*.py
-                echo "#!/usr/bin/env python3" > kcc-bin
-                cat kcc.zip >> kcc-bin
-                chmod +x kcc-bin
-
-                cp kcc-c2e.py __main__.py
-                zip kcc-c2e.zip __main__.py kindlecomicconverter/*.py
-                echo "#!/usr/bin/env python3" > kcc-c2e-bin
-                cat kcc-c2e.zip >> kcc-c2e-bin
-                chmod +x kcc-c2e-bin
-
-                cp kcc-c2p.py __main__.py
-                zip kcc-c2p.zip __main__.py kindlecomicconverter/*.py
-                echo "#!/usr/bin/env python3" > kcc-c2p-bin
-                cat kcc-c2p.zip >> kcc-c2p-bin
-                chmod +x kcc-c2p-bin
-
-                mkdir dist
-                tar --xform s:^.*/:: \
-                --xform s/LICENSE.txt/LICENSE/ \
-                --xform s/kcc-bin/kcc/ \
-                --xform s/kcc-c2p-bin/kcc-c2p/ \
-                --xform s/kcc-c2e-bin/kcc-c2e/ \
-                --xform s/comic2ebook/kcc/ \
-                -czf dist/KindleComicConverter_linux_''' + VERSION + '''.tar.gz \
-                kcc-bin kcc-c2e-bin kcc-c2p-bin LICENSE.txt README.md icons/comic2ebook.png
-                rm __main__.py kcc.zip kcc-c2e.zip kcc-c2p.zip kcc-bin kcc-c2e-bin kcc-c2p-bin
-                '''
-                os.system("bash -c '%s'" % script)
-                exit(0)
-            else:
-                os.system('docker run --rm -v ' + os.getcwd() + ':/app -e KCCVER=' + VERSION + ' acidweb/kcc')
-                exit(0)
-
-
-class BuildCommand(build):
-    def run(self):
-        os.makedirs('build/_scripts/', exist_ok=True)
-        shutil.copyfile('kcc.py', 'build/_scripts/kcc')
-        shutil.copyfile('kcc-c2e.py', 'build/_scripts/kcc-c2e')
-        shutil.copyfile('kcc-c2p.py', 'build/_scripts/kcc-c2p')
-        # noinspection PyShadowingNames
-        OPTIONS = dict(
-            scripts=['build/_scripts/kcc',
-                     'build/_scripts/kcc-c2e',
-                     'build/_scripts/kcc-c2p'],
-            packages=['kcc'],
-            install_requires=[
-                'PyQt5>=5.6.0'
-                'Pillow>=3.2.0',
-                'psutil>=4.1.0',
-                'python-slugify>=1.2.0',
-                'raven>=5.13.0',
-            ],
-            zip_safe=False,
-        )
-        if sys.version_info[1] < 5:
-            OPTIONS['install_requires'].append('scandir>=1.2.0')
-        build.run(self)
-
+            os.system('docker run --rm -v ' + os.getcwd() + ':/app -e KCCVER=' + VERSION + ' acidweb/kcc')
+            exit(0)
 
 setuptools.setup(
     cmdclass={
         'build_binary': BuildBinaryCommand,
-        'build': BuildCommand,
     },
     name=NAME,
     version=VERSION,
@@ -137,7 +73,25 @@ setuptools.setup(
     author_email='[email protected], [email protected]',
     description='Comic and Manga converter for e-book readers.',
     license='ISC License (ISCL)',
-    keywords='kindle comic mobipocket mobi cbz cbr manga',
+    keywords=['kindle', 'kobo', 'comic', 'manga', 'mobi', 'epub', 'cbz'],
     url='http://github.com/ciromattia/kcc',
-    **OPTIONS
+    entry_points={
+        'console_scripts': [
+            'kcc-c2e = kindlecomicconverter.startup:startC2E',
+            'kcc-c2p = kindlecomicconverter.startup:startC2P',
+        ],
+        'gui_scripts': [
+            'kcc = kindlecomicconverter.startup:start',
+        ],
+    },
+    packages=['kindlecomicconverter'],
+    install_requires=[
+        'PyQt5>=5.6.0',
+        'Pillow>=4.0.0',
+        'psutil>=5.0.0',
+        'python-slugify>=1.2.1',
+        'raven>=6.0.0',
+    ],
+    classifiers = [],
+    zip_safe=False,
 )