# Path: pisi/actionsapi/get.py
# class BinutilsError(pisi.actionsapi.Error):
#     def __init__(self, value=''):
# def curDIR():
# def curKERNEL():
# def curPYTHON():
# def curPERL():
# def ENV(environ):
# def pkgDIR():
# def workDIR():
# def installDIR():
# def lsbINFO():
# def srcNAME():
# def srcVERSION():
# def srcRELEASE():
# def srcTAG():
# def srcDIR():
# def ARCH():
# def HOST():
# def CHOST():
# def CFLAGS():
# def CXXFLAGS():
# def LDFLAGS():
# def makeJOBS():
# def buildTYPE():
# def docDIR():
# def sbinDIR():
# def infoDIR():
# def manDIR():
# def dataDIR():
# def confDIR():
# def localstateDIR():
# def libexecDIR():
# def defaultprefixDIR():
# def kdeDIR():
# def qtDIR():
# def AR():
# def AS():
# def CC():
# def CXX():
# def LD():
# def NM():
# def RANLIB():
# def F77():
# def GCJ():
# 
# Path: pisi/actionsapi/shelltools.py
# def system(command):
#     command = string.join(string.split(command))
#     retValue = run_logged(command)
# 
#     #if return value is different than 0, it means error, raise exception
#     if retValue != 0:
#         error(_("Command \"%s\" failed, return value was %d.") % (command, retValue))
# 
#     return retValue
# 
# def export(key, value):
#     '''export environ variable'''
#     os.environ[key] = value


import os
import gettext
import pisi.util as util
import pisi.context as ctx
import pisi.actionsapi
from glob import glob
from shutil import copy, copytree
from pisi.actionsapi import get
from pisi.actionsapi.shelltools import system, export

######################
# Javadoc generation #
######################


def dojavadoc(*source_files, **kw):
    '''generate & copy javadoc files to /usr/share/doc/src_name recursively'''

    build_tool = kw.get('build_tool', 'ant')
    parameters = kw.get('parameters', '')
    argument = kw.get('argument', 'javadoc')

    try:
        run(argument, parameters, build_tool)
        _dodoc(*source_files, **kw)
    except (RunTimeError, DoJavadocError):
        raise DoJavadocError(_('Javadoc generation failed.'))


#####################
# Generic execution #
#####################


def run(argument='', parameters='', build_tool='ant'):
    '''run build tool with given parameters'''

    export('JAVA_HOME', '/opt/sun-jre')
    # Otherwise, javadoc might be completed with errors

# Path: pisi/actionsapi/get.py
# class BinutilsError(pisi.actionsapi.Error):
#     def __init__(self, value=''):
# def curDIR():
# def curKERNEL():
# def curPYTHON():
# def curPERL():
# def ENV(environ):
# def pkgDIR():
# def workDIR():
# def installDIR():
# def lsbINFO():
# def srcNAME():
# def srcVERSION():
# def srcRELEASE():
# def srcTAG():
# def srcDIR():
# def ARCH():
# def HOST():
# def CHOST():
# def CFLAGS():
# def CXXFLAGS():
# def LDFLAGS():
# def makeJOBS():
# def buildTYPE():
# def docDIR():
# def sbinDIR():
# def infoDIR():
# def manDIR():
# def dataDIR():
# def confDIR():
# def localstateDIR():
# def libexecDIR():
# def defaultprefixDIR():
# def kdeDIR():
# def qtDIR():
# def AR():
# def AS():
# def CC():
# def CXX():
# def LD():
# def NM():
# def RANLIB():
# def F77():
# def GCJ():
# 
# Path: pisi/actionsapi/shelltools.py
# def system(command):
#     command = string.join(string.split(command))
#     retValue = run_logged(command)
# 
#     #if return value is different than 0, it means error, raise exception
#     if retValue != 0:
#         error(_("Command \"%s\" failed, return value was %d.") % (command, retValue))
# 
#     return retValue
# 
# def export(key, value):
#     '''export environ variable'''
#     os.environ[key] = value


# Path: pisi/actionsapi/javamodules.py
import os
import gettext
import pisi.util as util
import pisi.context as ctx
import pisi.actionsapi
from glob import glob
from shutil import copy, copytree
from pisi.actionsapi import get
from pisi.actionsapi.shelltools import system, export


######################
# Javadoc generation #
######################


def dojavadoc(*source_files, **kw):
    '''generate & copy javadoc files to /usr/share/doc/src_name recursively'''

    build_tool = kw.get('build_tool', 'ant')
    parameters = kw.get('parameters', '')
    argument = kw.get('argument', 'javadoc')

    try:
        run(argument, parameters, build_tool)
        _dodoc(*source_files, **kw)
    except (RunTimeError, DoJavadocError):
        raise DoJavadocError(_('Javadoc generation failed.'))


#####################
# Generic execution #
#####################


def run(argument='', parameters='', build_tool='ant'):
    '''run build tool with given parameters'''

    export('JAVA_HOME', '/opt/sun-jre')
    # Otherwise, javadoc might be completed with errors

    export('LC_ALL', 'en_US.UTF-8')