3 from distutils.core import setup
4 import distutils.command.build
5 import distutils.command.install_data
9 from osc import commandline
10 from osc import babysitter
11 # optional support for py2exe
18 class build_osc(distutils.command.build.build, object):
20 Custom build command which generates man page.
23 def build_man_page(self):
27 man_path = os.path.join('build', 'osc.1.gz')
28 distutils.log.info('generating %s' % man_path)
29 outfile = gzip.open(man_path, 'w')
30 osccli = commandline.Osc(stdout = outfile)
31 # FIXME: we cannot call the main method because osc expects an ~/.oscrc file
32 # (this would break builds in environments like the obs)
33 #osccli.main(argv = ['osc','man'])
34 osccli.optparser = osccli.get_optparser()
39 super(build_osc, self).run()
44 addparams['console'] = [{'script': 'osc-wrapper.py', 'dest_base': 'osc', 'icon_resources': [(1, 'osc.ico')]}]
45 addparams['zipfile'] = 'shared.lib'
46 addparams['options'] = {'py2exe': { 'optimize': 0, 'compressed': True, 'packages': ['xml.etree', 'StringIO', 'gzip'] }}
49 if sys.platform[:3] != 'win':
50 data_files.append((os.path.join('share','man','man1'), [os.path.join('build', 'osc.1.gz')]))
53 version = osc.core.__version__,
54 description = 'openSUSE commander',
55 long_description = 'Command-line client for the openSUSE Build Service, which allows to access repositories in the openSUSE Build Service in similar way as Subversion repositories.',
56 author = 'openSUSE project',
57 author_email = 'opensuse-buildservice@opensuse.org',
59 platforms = ['Linux','Mac OSX','Windows XP/2000/NT','Windows 95/98/ME'],
60 keywords = ['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'],
61 url = 'http://en.opensuse.org/Build_Service/CLI',
62 download_url = 'http://gitorious.org/opensuse/osc',
64 packages = ['osc', 'osc.util'],
65 scripts = ['osc_hotshot.py', 'osc-wrapper.py'],
66 data_files = data_files,
68 # Override certain command classes with our own ones