summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-03-29 14:25:57 +0200
committerRob Crittenden <rcritten@redhat.com>2010-04-07 08:59:04 -0400
commit2736177938ae7bf1452660cce0fa75a5d7e733ca (patch)
treecf001d3f57d68785137ff1af6e5efdb03f018eb6 /setup.py
parent9dd082eb338e7917744d00359ac6ba55b490caee (diff)
downloadfreeipa-2736177938ae7bf1452660cce0fa75a5d7e733ca.zip
freeipa-2736177938ae7bf1452660cce0fa75a5d7e733ca.tar.gz
freeipa-2736177938ae7bf1452660cce0fa75a5d7e733ca.tar.xz
Add ipa man page.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 06eba41..4c2b0e8 100755
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,51 @@ Python-level packaging using distutils.
"""
from distutils.core import setup
+from distutils.command.install_data import install_data as _install_data
+from distutils.util import change_root, convert_path
+from distutils import log
+from types import StringType
import ipalib
+import os
+
+class install_data(_install_data):
+ """Override the built-in install_data to gzip files once they
+ are installed.
+ """
+
+ def run(self):
+ # install_data is a classic class so super() won't work. Call it
+ # directly to copy the files first.
+ _install_data.run(self)
+
+ # Now gzip them
+ for f in self.data_files:
+ if type(f) is StringType:
+ # it's a simple file
+ f = convert_path(f)
+ cmd = '/bin/gzip %s/%s' % (self.install_dir, f)
+ log.info("gzipping %s/%s" % (self.install_dir, f))
+ os.system(cmd)
+ else:
+ # it's a tuple with path and a list of files
+ dir = convert_path(f[0])
+ if not os.path.isabs(dir):
+ dir = os.path.join(self.install_dir, dir)
+ elif self.root:
+ dir = change_root(self.root, dir)
+
+ if f[1] == []:
+ # If there are no files listed the user must be
+ # trying to create an empty directory. So nothing
+ # to do here.
+ pass
+ else:
+ # gzip the files
+ for data in f[1]:
+ data = convert_path(data)
+ cmd = '/bin/gzip %s/%s' % (dir, data)
+ log.info("gzipping %s/%s" % (dir, data))
+ os.system(cmd)
setup(
name='freeipa',
@@ -40,4 +84,5 @@ setup(
'ipawebui',
],
scripts=['ipa'],
+ data_files = [('share/man/man1', ["ipa.1"])],
)