Пример #1
0
def make(parameters = ''):
    '''make source with given parameters.'''
    if can_access_file('Makefile'):
        if system('make %s' % parameters):
            raise MakeError(_('Make failed.'))
    else:
        if system('perl Build %s' % parameters):
            raise MakeError(_('perl build failed.'))
Пример #2
0
def configure(parameters = ''):
    '''configure source with given parameters.'''
    export('PERL_MM_USE_DEFAULT', '1')
    if can_access_file('Build.PL'):
        if system('perl Build.PL installdirs=vendor destdir=%s' % get.installDIR()):
            raise ConfigureError(_('Configure failed.'))
    else:
        if system('perl Makefile.PL %s PREFIX=/usr INSTALLDIRS=vendor DESTDIR=%s' % (parameters, get.installDIR())):
            raise ConfigureError(_('Configure failed.'))
Пример #3
0
def install(parameters = 'install'):
    '''install source with given parameters.'''
    if can_access_file('Makefile'):
        if system('make %s' % parameters):
            raise InstallError(_('Make failed.'))
    else:
        if system('perl Build install'):
            raise MakeError(_('perl install failed.'))

    removePacklist()
    removePodfiles()
Пример #4
0
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.'))
Пример #5
0
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")
Пример #6
0
def install(parameters = 'install'):
    if can_access_file('Makefile'):
        args = 'make DESTDIR=%s destdir=%s %s' % (get.installDIR(), get.installDIR(), parameters)

        if system(args):
            raise InstallError(_('Install failed.'))
    else:
        raise InstallError(_('No Makefile found.'))
Пример #7
0
def rawConfigure(parameters = ''):
    '''configure source with given parameters = "--prefix=/usr --libdir=/usr/lib --with-nls"'''
    if can_access_file('configure'):
        gnuconfig_update()

        if system('./configure %s' % parameters):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(_('No configure script found.'))
Пример #8
0
def rawInstall(parameters = '', argument = 'install'):
    '''install source into install directory with given parameters = PREFIX=%s % get.installDIR()'''
    if system('make %s %s' % (parameters, argument)):
        raise InstallError(_('Install failed.'))
    else:
        fixInfoDir()

    if get.buildTYPE() == "emul32":
        fixpc()
        if isDirectory("%s/emul32" % get.installDIR()): removeDir("/emul32")
Пример #9
0
def install(parameters = '', pyVer = ''):
    '''does python setup.py install'''
    if system('python%s setup.py install --root=%s --no-compile -O0 %s' % (pyVer, get.installDIR(), parameters)):
        raise InstallError(_('Install failed.'))

    docFiles = ('AUTHORS', 'CHANGELOG', 'CONTRIBUTORS', 'COPYING*', 'COPYRIGHT',
                'Change*', 'KNOWN_BUGS', 'LICENSE', 'MAINTAINERS', 'NEWS',
                'README*', 'PKG-INFO')

    for docGlob in docFiles:
        for doc in glob.glob(docGlob):
            if not isEmpty(doc):
                dodoc(doc)
Пример #10
0
def configure(parameters = ''):
    ''' parameters = '--with-nls --with-libusb --with-something-usefull '''
    if can_access_file('configure'):
        args = './configure \
                --prefix=%s \
                --build=%s \
                --with-x \
                --enable-mitshm \
                --with-xinerama \
                --with-qt-dir=%s \
                --enable-mt \
                --with-qt-libraries=%s/lib \
                --disable-dependency-tracking \
                --disable-debug \
                %s' % (get.kdeDIR(), get.HOST(), get.qtDIR(), get.qtDIR(), parameters)

        if system(args):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(_('No configure script found.'))
Пример #11
0
def rake_install(parameters=''):
    '''execute rake script for installation'''
    if system('rake -t -l %s %s' % (os.path.join('/', get.defaultprefixDIR(), 'lib'), parameters)):
        raise InstallError(_('Install failed.'))

    auto_dodoc()
Пример #12
0
def install(parameters=''):
    '''does ruby setup.rb install'''
    if system('ruby -w setup.rb --prefix=/%s --destdir=%s %s' % (get.defaultprefixDIR(), get.installDIR(), parameters)):
        raise InstallError(_('Install failed.'))

    auto_dodoc()
Пример #13
0
def run(parameters=''):
    '''executes parameters with ruby'''
    export('DESTDIR', get.installDIR())

    if system('ruby %s' % parameters):
        raise RuntimeError(_("Running 'ruby %s' failed.") % parameters)
Пример #14
0
def compile(parameters = ''):
    system('%s %s %s' % (get.CC(), get.CFLAGS(), parameters))
Пример #15
0
def installHeaders(extraHeaders=None):
    """ Install the files needed to build out-of-tree kernel modules. """

    extras = ["drivers/media/dvb-core",
              "drivers/media/dvb-frontends",
              "drivers/media/tuners",
              "drivers/media/platform"]

    if extraHeaders:
        extras.extend(extraHeaders)

    pruned = ["include", "scripts", "Documentation"]
    wanted = ["Makefile*", "Kconfig*", "Kbuild*", "*.sh", "*.pl", "*.lds"]

    suffix = __getSuffix()
    headersDirectoryName = "usr/src/linux-headers-%s" % suffix

    # Get the destination directory for header installation
    destination = os.path.join(get.installDIR(), headersDirectoryName)
    shelltools.makedirs(destination)

    # First create the skel
    find_cmd = "find . -path %s -prune -o -type f \( -name %s \) -print" % \
                (
                    " -prune -o -path ".join(["'./%s/*'" % l for l in pruned]),
                    " -o -name ".join(["'%s'" % k for k in wanted])
                ) + " | cpio -pVd --preserve-modification-time %s" % destination

    shelltools.system(find_cmd)

    # Install additional headers
    for headers in extras:
        shelltools.system("cp -a %s/*.h %s/%s" % (headers, destination, headers))

    # Install remaining headers
    shelltools.system("cp -a %s %s" % (" ".join(pruned), destination))

    # Cleanup directories
    shelltools.system("rm -rf %s/scripts/*.o" % destination)
    shelltools.system("rm -rf %s/scripts/*/*.o" % destination)
    shelltools.system("rm -rf %s/Documentation/DocBook" % destination)

    # Finally copy the include directories found in arch/
    shelltools.system("(find arch -name include -type d -print | \
                        xargs -n1 -i: find : -type f) | \
                        cpio -pd --preserve-modification-time %s" % destination)

    # Copy Modules.symvers and System.map
    shutil.copy("Module.symvers", "%s/" % destination)
    shutil.copy("System.map", "%s/" % destination)

    # Copy .config file which will be needed by some external modules
    shutil.copy(".config", "%s/" % destination)

    # Settle the correct build symlink to this headers
    pisilinuxtools.dosym("/%s" % headersDirectoryName, "/lib/modules/%s/build" % suffix)
    pisilinuxtools.dosym("build", "/lib/modules/%s/source" % suffix)
Пример #16
0
def autoheader(parameters = ''):
    '''generates templates for configure'''
    if system('autoheader %s' % parameters):
        raise RunTimeError(_('Running autoheader failed.'))
Пример #17
0
def automake(parameters = ''):
    '''generates a makefile'''
    if system('automake %s' % parameters):
        raise RunTimeError(_('Running automake failed.'))
Пример #18
0
def installLibcHeaders(excludes=None):
    headers_tmp = os.path.join(get.installDIR(), 'tmp-headers')
    headers_dir = os.path.join(get.installDIR(), 'usr/include')

    make_cmd = "O=%s INSTALL_HDR_PATH=%s/install" % (headers_tmp, headers_tmp)

    # Cleanup temporary header directory
    shelltools.system("rm -rf %s" % headers_tmp)

    # Create directories
    shelltools.makedirs(headers_tmp)
    shelltools.makedirs(headers_dir)
    
    ###################Workaround begins here ...
    #Workaround information -- http://patches.openembedded.org/patch/33433/
    cpy_src="%s/linux-*/arch/x86/include/generated" % (get.workDIR())
    cpy_tgt="%s/arch/x86/include" % (headers_tmp)
    shelltools.makedirs(cpy_tgt)
    
    copy_cmd ="cp -Rv %s %s " % (cpy_src, cpy_tgt)
    
    shelltools.system(copy_cmd)
    #######################Workaround ends here ...
    
    # make defconfig and install the headers
    autotools.make("%s defconfig" % make_cmd)
    autotools.rawInstall(make_cmd, "headers_install")

    oldwd = os.getcwd()

    shelltools.cd(os.path.join(headers_tmp, "install", "include"))
    shelltools.system("find . -name '.' -o -name '.*' -prune -o -print | \
                       cpio -pVd --preserve-modification-time %s" % headers_dir)

    # Remove sound/ directory which is installed by alsa-headers
    shelltools.system("rm -rf %s/sound" % headers_dir)

    # Remove possible excludes given by actions.py
    if excludes:
        shelltools.system("rm -rf %s" % " ".join(["%s/%s" % (headers_dir, exc.strip("/")) for exc in excludes]))

    shelltools.cd(oldwd)

    # Remove tmp directory
    shelltools.system("rm -rf %s" % headers_tmp)
Пример #19
0
def configure(parameters = '', pyVer = ''):
    '''does python setup.py configure'''
    if system('python%s setup.py configure %s' % (pyVer, parameters)):
        raise ConfigureError(_('Configuration failed.'))
Пример #20
0
def make(parameters = ''):
    if system('scons %s %s' % (get.makeJOBS(), parameters)):
        raise MakeError(_('Make failed.'))
Пример #21
0
def make(parameters = ''):
    '''make source with given parameters = "all" || "doc" etc.'''
    if system('make %s %s' % (get.makeJOBS(), parameters)):
        raise MakeError(_('Make failed.'))
Пример #22
0
def install(parameters = 'install', prefix = get.installDIR(), argument='prefix'):
    if system('scons %s=%s %s' % (argument, prefix, parameters)):
        raise InstallError(_('Install failed.'))
Пример #23
0
def compile(parameters = '', pyVer = ''):
    '''compile source with given parameters.'''
    if system('python%s setup.py build %s' % (pyVer, parameters)):
        raise CompileError(_('Make failed.'))
Пример #24
0
def aclocal(parameters = ''):
    '''generates an aclocal.m4 based on the contents of configure.in.'''
    if system('aclocal %s' % parameters):
        raise RunTimeError(_('Running aclocal failed.'))
Пример #25
0
def run(parameters = '', pyVer = ''):
    '''executes parameters with python'''
    if system('python%s %s' % (pyVer, parameters)):
        raise RunTimeError(_('Running %s failed.') % parameters)
Пример #26
0
def autoreconf(parameters = ''):
    '''re-generates a configure script'''
    if system('autoreconf %s' % parameters):
        raise RunTimeError(_('Running autoreconf failed.'))