diff --git a/setup.py b/setup.py index 1c905c4..27d2db5 100755 --- a/setup.py +++ b/setup.py @@ -78,14 +78,38 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): #('docs/magic.tex', #['IPython/Magic.py'], #"cd doc && ./update_magic.sh" ), - + + ('docs/man/ipcluster.1.gz', + ['docs/man/ipcluster.1'], + 'cd docs/man && gzip -9c ipcluster.1 > ipcluster.1.gz'), + + ('docs/man/ipcontroller.1.gz', + ['docs/man/ipcontroller.1'], + 'cd docs/man && gzip -9c ipcontroller.1 > ipcontroller.1.gz'), + + ('docs/man/ipengine.1.gz', + ['docs/man/ipengine.1'], + 'cd docs/man && gzip -9c ipengine.1 > ipengine.1.gz'), + ('docs/man/ipython.1.gz', ['docs/man/ipython.1'], - "cd docs/man && gzip -9c ipython.1 > ipython.1.gz"), + 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'), + + ('docs/man/ipython-wx.1.gz', + ['docs/man/ipython-wx.1'], + 'cd docs/man && gzip -9c ipython-wx.1 > ipython-wx.1.gz'), + + ('docs/man/ipythonx.1.gz', + ['docs/man/ipythonx.1'], + 'cd docs/man && gzip -9c ipythonx.1 > ipythonx.1.gz'), + + ('docs/man/irunner.1.gz', + ['docs/man/irunner.1'], + 'cd docs/man && gzip -9c irunner.1 > irunner.1.gz'), ('docs/man/pycolor.1.gz', ['docs/man/pycolor.1'], - "cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz"), + 'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'), ] # Only build the docs if sphinx is present diff --git a/setupbase.py b/setupbase.py index 9c00a35..94a1ca7 100644 --- a/setupbase.py +++ b/setupbase.py @@ -212,6 +212,31 @@ def find_data_files(): return data_files + +def make_man_update_target(manpage): + """Return a target_update-compliant tuple for the given manpage. + + Parameters + ---------- + manpage : string + Name of the manpage, must include the section number (trailing number). + + Example + ------- + + >>> make_man_update_target('ipython.1') #doctest: +NORMALIZE_WHITESPACE + ('docs/man/ipython.1.gz', + ['docs/man/ipython.1'], + 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz') + """ + man_dir = pjoin('docs', 'man') + manpage_gz = manpage + '.gz' + manpath = pjoin(man_dir, manpage) + manpath_gz = pjoin(man_dir, manpage_gz) + gz_cmd = ( "cd %(man_dir)s && gzip -9c %(manpage)s > %(manpage_gz)s" % + locals() ) + return (manpath_gz, [manpath], gz_cmd) + #--------------------------------------------------------------------------- # Find scripts #---------------------------------------------------------------------------