From 5ba1fb8eaa5317107a104bc7c6b3d43deddc01d3 Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Tue, 3 May 2011 14:43:07 +0200 Subject: [PATCH] Added manpages and updated setup.py to generate them while packaging. --- debian/cc-server.manpages | 2 ++ doc/cc-addaccount.rst | 42 +++++++++++++++++++++++++++++++++++++++ doc/cc-server.rst | 36 +++++++++++++++++++++++++++++++++ setup.py | 25 +++++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 debian/cc-server.manpages create mode 100644 doc/cc-addaccount.rst create mode 100644 doc/cc-server.rst diff --git a/debian/cc-server.manpages b/debian/cc-server.manpages new file mode 100644 index 0000000..b73fc8c --- /dev/null +++ b/debian/cc-server.manpages @@ -0,0 +1,2 @@ +cc-server.1 +cc-addaccount.1 diff --git a/doc/cc-addaccount.rst b/doc/cc-addaccount.rst new file mode 100644 index 0000000..915701d --- /dev/null +++ b/doc/cc-addaccount.rst @@ -0,0 +1,42 @@ +=============== + cc-addaccount +=============== + +---------------------------------------------------- +A tool to create account on your cc-server directory +---------------------------------------------------- + +:Author: Antoine Millet +:Manual section: 1 + +SYNOPSIS +======== + +cc-addaccount [options] + +DESCRIPTION +=========== + +CloudControl is a tool designed to facilitate administration of a wide set of +virtualised or not machines. This binary allow to create account on cc-server +account directory, even if cc-server is not started. + +By default, the cc-server account directory is defined as +``/var/lib/cc-server`` (it's also the default for cc-server), but if you +changed it, you can use the ``--directory`` option. + +OPTIONS +======= + +-h, --help show this help message and exit +-d DIRECTORY, --directory=DIRECTORY + account directory +-p, --password ask for the password +-g, --god add a rule to allow all actions +-c COPY, --copy=COPY copy this already existing account +-r ROLE, --role=ROLE specify the role (default cli) + +SEE ALSO +======== + +* Manual of cc-server ``man 1 cc-server`` diff --git a/doc/cc-server.rst b/doc/cc-server.rst new file mode 100644 index 0000000..888575e --- /dev/null +++ b/doc/cc-server.rst @@ -0,0 +1,36 @@ +=========== + cc-server +=========== + +------------------------------------------------ +Launch the CloudControl server on your computer. +------------------------------------------------ + +:Author: Antoine Millet +:Manual section: 1 + +SYNOPSIS +======== + +cc-server [options] + +DESCRIPTION +=========== + +CloudControl is a tool designed to facilitate administration of a wide set of +virtualised or not machines. This binary allow to launch the central server of +this system. + +OPTIONS +======= + +--version show program's version number and exit +-h, --help show this help message and exit +-c CONFIG, --config=CONFIG configuration file (default: /etc/cc-server.conf) +-d, --daemonize run as daemon and write pid file +-p PID_FILE, --pid-file=PID_FILE pid file (default: /var/run/cc-server.pid) + +SEE ALSO +======== + +* Manual of cc-addaccount: ``man 1 cc-addaccount`` diff --git a/setup.py b/setup.py index e7d26a9..dac44b4 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from setuptools import setup +from distutils.command.build import build import os import sys @@ -7,6 +8,29 @@ from ccserver 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 + + 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} + setup( name='cc-server', version=__version__, @@ -24,4 +48,5 @@ setup( 'Operating System :: Unix', 'Programming Language :: Python', ], + cmdclass=cmdclass ) -- GitLab