From 406c2abb8071de61e910db6a487472f7aa4ee632 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 21 Dec 2012 17:54:36 +0100 Subject: Make distutils package the doc/ dir and compress man page on install Signed-off-by: David Sommerseth --- setup.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 579d442..30ff468 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.sysconfig import get_python_lib from distutils.core import setup from os.path import isfile, join -import glob, os, shutil +import glob, os, shutil, gzip from rteval import RTEVAL_VERSION @@ -21,6 +21,15 @@ except OSError, e: raise e shutil.copy('rteval-cmd','dist/rteval') +# Compress the man page, so distutil will only care for the compressed file +mangz = gzip.GzipFile('dist/rteval.8.gz', 'w', 9) +man = open('doc/rteval.8', 'r') +mangz.writelines(man) +man.close() +mangz.close() + + +# Do the distutils stuff setup(name="rteval", version = RTEVAL_VERSION, description = "Evaluate system performance for Realtime", @@ -54,13 +63,16 @@ mean, variance and standard deviation) and a report is generated. data_files = [("share/rteval", ["rteval/rteval_dmi.xsl", "rteval/rteval_histogram_raw.xsl", "rteval/rteval_text.xsl"]), - ("/etc", ["rteval.conf"]) + ("/etc", ["rteval.conf"]), + ("share/man/man8", ["dist/rteval.8.gz"]) ], scripts = ["dist/rteval"] ) + # Clean-up from our little hack os.unlink('dist/rteval') +os.unlink('dist/rteval.8.gz') if distcreated: try: os.rmdir('dist') -- cgit