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
19 class build_osc(distutils.command.build.build, object):
21 Custom build command which generates man page.
24 def build_man_page(self):
28 man_path = os.path.join('build', 'osc.1.gz')
29 distutils.log.info('generating %s' % man_path)
30 outfile = gzip.open(man_path, 'w')
31 osccli = commandline.Osc(stdout=outfile)
32 # FIXME: we cannot call the main method because osc expects an ~/.oscrc
33 # file (this would break builds in environments like the obs)
34 #osccli.main(argv = ['osc','man'])
35 osccli.optparser = osccli.get_optparser()
40 super(build_osc, self).run()
45 addparams['console'] = [{'script': 'osc-wrapper.py', 'dest_base': 'osc', 'icon_resources': [(1, 'osc.ico')]}]
46 addparams['zipfile'] = 'shared.lib'
47 addparams['options'] = {'py2exe': {'optimize': 0, 'compressed': True, 'packages': ['xml.etree', 'StringIO', 'gzip']}}
50 if sys.platform[:3] != 'win':
51 data_files.append((os.path.join('share', 'man', 'man1'), [os.path.join('build', 'osc.1.gz')]))
54 version = osc.core.__version__,
55 description = 'openSUSE commander',
56 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.',
57 author = 'openSUSE project',
58 author_email = 'opensuse-buildservice@opensuse.org',
60 platforms = ['Linux', 'Mac OSX', 'Windows XP/2000/NT', 'Windows 95/98/ME'],
61 keywords = ['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'],
62 url = 'http://en.opensuse.org/openSUSE:OSC',
63 download_url = 'http://gitorious.org/opensuse/osc',
65 packages = ['osc', 'osc.util'],
66 scripts = ['osc_hotshot.py', 'osc-wrapper.py'],
67 data_files = data_files,
69 # Override certain command classes with our own ones