Skip to content
setup.py 1.25 KiB
Newer Older
Antoine Millet's avatar
Antoine Millet committed
from setuptools import setup
from distutils.command.build import build
Antoine Millet's avatar
Antoine Millet committed
import os
import sys

# Retrieval of version:
from ccserver import __version__
Antoine Millet's avatar
Antoine Millet committed

ldesc = open(os.path.join(os.path.dirname(__file__), 'README')).read()

class BuildMan(build):

    '''
    Build command class used by distutil to generate manpages from RST sources
    while packaging.
    '''

    MANPAGES = ('cc-server', 'cc-addaccount')
    description = 'Build manual from RSt source'

    def run(self):
	from docutils.core import publish_file
	from docutils.writers import manpage
	
	for man in self.MANPAGES:
	    publish_file(source_path='doc/%s.rst' % man,
			 destination_path='%s.1' % man,
			 writer=manpage.Writer())

build.sub_commands.insert(0, ('build_man', None))

cmdclass = {'build_man': BuildMan}

Antoine Millet's avatar
Antoine Millet committed
setup(
    name='cc-server',
    version=__version__,
Antoine Millet's avatar
Antoine Millet committed
    description='CloudControl server',
    long_description=ldesc,
    author='Antoine Millet',
    author_email='antoine.millet@smartjog.com',
    license='GPL2', 
    packages=['ccserver'],
    scripts=['bin/cc-server', 'bin/cc-addaccount'],
Antoine Millet's avatar
Antoine Millet committed
    data_files=(
        ('/etc/', ('etc/cc-server.conf',)),
    ),
    classifiers=[
        'Operating System :: Unix',
        'Programming Language :: Python',
    ],
Antoine Millet's avatar
Antoine Millet committed
)