2006-05-10 16:21:51 +02:00
#!/usr/bin/env python
from distutils . core import setup
2009-05-06 13:47:53 +02:00
import distutils . command . build
import distutils . command . install_data
import os . path
2009-05-06 11:33:18 +02:00
import osc . core
2009-05-06 13:47:53 +02:00
from osc import commandline
from osc import babysitter
class build_osc ( distutils . command . build . build , object ) :
"""
Custom build command which generates man page .
"""
def build_man_page ( self ) :
"""
"""
2009-05-09 16:16:18 +02:00
import gzip
man_path = os . path . join ( ' build ' , ' osc.1.gz ' )
2009-05-06 13:47:53 +02:00
distutils . log . info ( ' generating %s ' % man_path )
2009-05-09 16:16:18 +02:00
outfile = gzip . open ( man_path , ' w ' )
2009-05-06 13:47:53 +02:00
osccli = commandline . Osc ( stdout = outfile )
2009-05-10 12:42:36 +02:00
# FIXME: we cannot call the main method because osc expects an ~/.oscrc file
# (this would break builds in environments like the obs)
#osccli.main(argv = ['osc','man'])
osccli . optparser = osccli . get_optparser ( )
osccli . do_man ( None )
2009-05-09 16:16:18 +02:00
outfile . close ( )
2009-05-06 13:47:53 +02:00
def run ( self ) :
super ( build_osc , self ) . run ( )
2009-05-10 12:42:36 +02:00
self . build_man_page ( )
2006-05-10 16:21:51 +02:00
setup ( name = ' osc ' ,
2009-05-06 11:33:18 +02:00
version = osc . core . __version__ ,
description = ' openSUSE (buildsystem) commander ' ,
long_description = ' Commandline client for the openSUSE Build Service, which allows to access repositories in the openSUSE Build Service in similar way as Subversion repositories. ' ,
2009-03-02 15:03:06 +01:00
author = ' openSUSE project ' ,
author_email = ' opensuse-buildservice@opensuse.org ' ,
2006-05-10 16:21:51 +02:00
license = ' GPL ' ,
2009-05-06 11:33:18 +02:00
platforms = [ ' Linux ' ] ,
keywords = [ ' openSUSE ' , ' SUSE ' , ' RPM ' , ' build ' , ' buildservice ' ] ,
2006-05-10 16:21:51 +02:00
url = ' https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/python/osc/ ' ,
2009-03-24 20:12:39 +01:00
packages = [ ' osc ' , ' osc.util ' ] ,
2006-05-10 16:21:51 +02:00
scripts = [ ' osc_hotshot.py ' , ' osc-wrapper.py ' ] ,
2009-05-10 12:42:36 +02:00
data_files = [ ( os . path . join ( ' share ' , ' man ' , ' man1 ' ) , [ os . path . join ( ' build ' , ' osc.1.gz ' ) ] ) ] ,
2006-05-10 16:21:51 +02:00
2009-05-06 13:47:53 +02:00
# Override certain command classes with our own ones
cmdclass = {
' build ' : build_osc ,
} ,
2006-05-10 16:21:51 +02:00
)