2013-11-27 07:53:57 -06:00
|
|
|
#!/usr/bin/python2
|
2008-10-21 20:46:07 -05:00
|
|
|
|
2008-10-22 16:52:32 -05:00
|
|
|
# Authors:
|
|
|
|
# Jason Gerard DeRose <jderose@redhat.com>
|
2008-10-21 20:46:07 -05:00
|
|
|
#
|
|
|
|
# Copyright (C) 2008 Red Hat
|
|
|
|
# see file 'COPYING' for use and warranty information
|
|
|
|
#
|
2010-12-09 06:59:11 -06:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2008-10-21 20:46:07 -05:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2010-12-09 06:59:11 -06:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2008-10-21 20:46:07 -05:00
|
|
|
|
|
|
|
"""
|
|
|
|
Python-level packaging using distutils.
|
|
|
|
"""
|
|
|
|
|
2009-10-13 12:28:00 -05:00
|
|
|
from distutils.core import setup
|
2010-03-29 07:25:57 -05:00
|
|
|
from distutils.command.install_data import install_data as _install_data
|
|
|
|
from distutils.util import change_root, convert_path
|
|
|
|
from distutils import log
|
2009-01-31 00:46:51 -06:00
|
|
|
import ipalib
|
2010-03-29 07:25:57 -05:00
|
|
|
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:
|
2015-09-17 10:56:45 -05:00
|
|
|
if isinstance(f, str):
|
2010-03-29 07:25:57 -05:00
|
|
|
# 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)
|
2008-10-21 20:46:07 -05:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name='freeipa',
|
2009-01-31 00:46:51 -06:00
|
|
|
version=ipalib.__version__,
|
2013-12-03 08:21:45 -06:00
|
|
|
license='GPLv3+',
|
2008-10-22 16:52:32 -05:00
|
|
|
url='http://freeipa.org/',
|
2008-10-21 20:46:07 -05:00
|
|
|
packages=[
|
2009-01-04 19:39:39 -06:00
|
|
|
'ipaserver',
|
2013-06-10 07:43:24 -05:00
|
|
|
'ipaserver.advise',
|
|
|
|
'ipaserver.advise.plugins',
|
2009-01-04 19:39:39 -06:00
|
|
|
'ipaserver.plugins',
|
2009-02-02 12:50:53 -06:00
|
|
|
'ipaserver.install',
|
2011-11-23 15:52:40 -06:00
|
|
|
'ipaserver.install.plugins',
|
2015-05-27 04:05:23 -05:00
|
|
|
'ipaserver.install.server',
|
2008-10-21 20:46:07 -05:00
|
|
|
],
|
|
|
|
scripts=['ipa'],
|
2010-03-29 07:25:57 -05:00
|
|
|
data_files = [('share/man/man1', ["ipa.1"])],
|
2008-10-21 20:46:07 -05:00
|
|
|
)
|