Newer
Older
from setuptools import setup, find_packages
from distutils.command.build import build
import sys
# Retrieval of version:
from cloudcontrol.server import __version__
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
srcdir = os.path.split(os.path.abspath(__file__))[0]
for man in self.MANPAGES:
publish_file(source_path=os.path.join(srcdir, 'doc/%s.rst' % man),
destination_path=os.path.join(srcdir, '%s.1' % man),
writer=manpage.Writer())
build.sub_commands.insert(0, ('build_man', None))
cmdclass = {'build_man': BuildMan}
description='CloudControl server',
long_description=ldesc,
author='Antoine Millet',
author_email='antoine.millet@smartjog.com',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
scripts=['bin/cc-server', 'bin/cc-addaccount'],
namespace_packages=['cloudcontrol'],
data_files=(
('/etc/', ('etc/cc-server.conf',)),
),
classifiers=[
'Operating System :: Unix',
'Programming Language :: Python',
],
cmdclass=cmdclass