def install(parameters = '', argument = 'install'): '''install source into install directory with given parameters''' args = 'make prefix=%(prefix)s/%(defaultprefix)s \ datadir=%(prefix)s/%(data)s \ infodir=%(prefix)s/%(info)s \ localstatedir=%(prefix)s/%(localstate)s \ mandir=%(prefix)s/%(man)s \ sysconfdir=%(prefix)s/%(conf)s \ %(parameters)s \ %(argument)s' % { 'prefix': get.installDIR(), 'defaultprefix': get.defaultprefixDIR(), 'man': get.manDIR(), 'info': get.infoDIR(), 'localstate': get.localstateDIR(), 'conf': get.confDIR(), 'data': get.dataDIR(), 'parameters': parameters, 'argument':argument, } if system(args): raise InstallError(_('Install failed.')) else: fixInfoDir() if get.buildTYPE() == "emul32": fixpc() if isDirectory("%s/emul32" % get.installDIR()): removeDir("/emul32")
def configure(parameters = ''): '''configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"''' if can_access_file('configure'): gnuconfig_update() prefix = get.emul32prefixDIR() if get.buildTYPE() == "emul32" else get.defaultprefixDIR() args = './configure \ --prefix=/%s \ --build=%s \ --mandir=/%s \ --infodir=/%s \ --datadir=/%s \ --sysconfdir=/%s \ --localstatedir=/%s \ --libexecdir=/%s \ %s%s' % (prefix, \ get.HOST(), get.manDIR(), \ get.infoDIR(), get.dataDIR(), \ get.confDIR(), get.localstateDIR(), get.libexecDIR(), "--libdir=/usr/lib32 " if get.buildTYPE() == "emul32" else "", parameters) if system(args): raise ConfigureError(_('Configure failed.')) else: raise ConfigureError(_('No configure script found.'))
def doman(*sourceFiles): '''inserts the man pages in the list of files into /usr/share/man/''' '''example call: pisilinuxtools.doman("man.1", "pardus.*")''' manDIR = join_path(get.installDIR(), get.manDIR()) if not can_access_directory(manDIR): makedirs(manDIR) for sourceFile in sourceFiles: sourceFileGlob = glob.glob(sourceFile) if len(sourceFileGlob) == 0: raise FileError(_("No file matched pattern \"%s\"") % sourceFile) for source in sourceFileGlob: compressed = source.endswith("gz") and source if compressed: source = source[:-3] try: pageName, pageDirectory = source[:source.rindex('.')], \ source[source.rindex('.')+1:] except ValueError: error(_('ActionsAPI [doman]: Wrong man page file: %s') % (source)) manPDIR = join_path(manDIR, '/man%s' % pageDirectory) makedirs(manPDIR) if not compressed: system('install -m0644 %s %s' % (source, manPDIR)) else: uncompress(compressed, targetDir=manPDIR)