diff --git a/doc/chkcrontab.1 b/doc/chkcrontab.1 index 5299ec94e6e422945bd229db5c4ccb2089b14179..511eec18a00a3b4b8c793276614f3ba2009e19a1 100644 --- a/doc/chkcrontab.1 +++ b/doc/chkcrontab.1 @@ -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) diff --git a/doc/chkcrontab.1.rst b/doc/chkcrontab.1.rst index 32393f796e2b37beda3bbdb4117d9bdd0696fe0c..814f56706bcc52920c5b7264b701db177851cdd6 100644 --- a/doc/chkcrontab.1.rst +++ b/doc/chkcrontab.1.rst @@ -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 diff --git a/setup.py b/setup.py index 41af5f89a6a348a2685a0d8123b6c7922c724352..5bc4732b14be959a08eaf5e8d6ca8d240dbcece7 100755 --- a/setup.py +++ b/setup.py @@ -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',