Commit e0450dcc authored by Kevin Lyda's avatar Kevin Lyda 💬
Browse files

Manpage edits and installer.

parent f55b63de
......@@ -61,8 +61,10 @@ Reports any bare \fB%\fP in a command.
.UNINDENT
.SH BUGS
.sp
Quite possibly. Report them via the \fI\%issue tracker\fP at the project
website.
Quite possibly. Report them via the issue tracker at the project
website:
.sp
\fI\%http://code.google.com/p/chkcrontab/issues/list\fP
.SH SEE ALSO
.sp
\fBlint\fP (1)
......
......@@ -36,8 +36,10 @@ The following check are run against the given crontab file.
Bugs
----
Quite possibly. Report them via the `issue tracker`_ at the project
website.
Quite possibly. Report them via the issue tracker at the project
website:
http://code.google.com/p/chkcrontab/issues/list
See Also
--------
......@@ -52,5 +54,3 @@ Copying
Copyright (C) 2012 Kevin Lyda.
Free use of this software is granted under the terms of the GNU General
Public License version 3 or any later version.
.. _`issue tracker`: http://code.google.com/p/chkcrontab/issues/list
......@@ -20,7 +20,9 @@ This installs the chkcrontab command and the crontab.check module.
import os
import sys
from distutils import file_util
from distutils import log
from distutils.command.install import install
from distutils.core import setup
from distutils.core import Command
if sys.version_info < (2, 7):
......@@ -31,7 +33,7 @@ else:
BASE_DIR = os.path.dirname(globals().get('__file__', os.getcwd()))
class TestCommand(Command):
class TestCmd(Command):
description = 'Runs all available tests.'
user_options = [ ]
......@@ -50,7 +52,7 @@ class TestCommand(Command):
if not result.wasSuccessful():
sys.exit(1)
class CleanCommand(Command):
class CleanCmd(Command):
description = 'Remove all generated files.'
user_options = [ ]
......@@ -117,9 +119,45 @@ class CleanCommand(Command):
except:
log.warn('unable to remove "%s"', os.path.normpath(accused))
class InstallCmd(install):
user_options = install.user_options[:]
user_options.extend([('manprefix=', None,
'installation prefix for man pages')])
def initialize_options(self):
self.manprefix = None
install.initialize_options(self)
def finalize_options(self):
install.finalize_options(self)
if self.manprefix is None :
self.manprefix = os.path.join(self.install_scripts,
'..', 'share', 'man')
def run(self):
install.run(self)
manpages=['doc/chkcrontab.1']
if self.manprefix:
for manpage in manpages:
section = manpage.split('/')[-1].split('.')[-1]
manpage_file = manpage.split('/')[-1]
manpage_dir = os.path.realpath(os.path.join(self.manprefix,
'man%s' % section))
if not self.dry_run:
try:
os.makedirs(manpage_dir)
except OSError:
pass
file_util.copy_file(manpage,
os.path.join(manpage_dir, manpage_file),
dry_run=self.dry_run)
setup(
cmdclass={'test': TestCommand,
'dist_clean': CleanCommand
cmdclass={'test': TestCmd,
'dist_clean': CleanCmd,
'dist_clean': CleanCmd,
'install': InstallCmd,
},
name='chkcrontab',
version='1.2',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment