setup.py 1.92 KB
Newer Older
1
#!/usr/bin/python3
2

3 4
import os

5
from distutils.core import setup
Dan Pascu's avatar
Dan Pascu committed
6 7 8
from distutils.extension import Extension
from Cython.Build import cythonize

9

Dan Pascu's avatar
Dan Pascu committed
10 11 12 13 14
class PackageInfo(object):
    def __init__(self, info_file):
        with open(info_file) as f:
            exec(f.read(), self.__dict__)
        self.__dict__.pop('__builtins__', None)
15

Dan Pascu's avatar
Dan Pascu committed
16 17
    def __getattribute__(self, name):  # this is here to silence the IDE about missing attributes
        return super(PackageInfo, self).__getattribute__(name)
18

Dan Pascu's avatar
Dan Pascu committed
19 20 21

def find_packages(root):
    return [directory.replace(os.path.sep, '.') for directory, sub_dirs, files in os.walk(root) if '__init__.py' in files]
22

23

24 25
def list_resources(source_directory, destination_directory):
    return [(directory.replace(source_directory, destination_directory), [os.path.join(directory, file) for file in files]) for directory, sub_dirs, files in os.walk(source_directory)]
Dan Pascu's avatar
Dan Pascu committed
26 27 28


package_info = PackageInfo(os.path.join('blink', '__info__.py'))
29
package_info.__description__ = "Fully featured, easy to use SIP client with a Qt based UI"
Dan Pascu's avatar
Dan Pascu committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51


setup(
    name=package_info.__project__,
    version=package_info.__version__,

    description=package_info.__summary__,
    long_description=package_info.__description__,
    license=package_info.__license__,
    url=package_info.__webpage__,

    author=package_info.__author__,
    author_email=package_info.__email__,

    platforms=["Platform Independent"],
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: End Users/Desktop",
        "License :: GNU General Public License 3 (GPLv3)",
        "Operating System :: OS Independent",
        "Programming Language :: Python"
    ],
52

Dan Pascu's avatar
Dan Pascu committed
53 54 55 56 57
    packages=find_packages('blink'),
    ext_modules=cythonize([Extension(name="blink.screensharing._rfb", sources=["blink/screensharing/_rfb.pyx"], libraries=["vncclient"])]),
    data_files=list_resources('resources', destination_directory='share/blink'),
    scripts=['bin/blink']
)