예제 #1
0
    def cmmi(self, dest):
        """Do the 'configure; make; make install' command sequence.

        When this is called, the current working directory is the
        source directory.  The 'dest' parameter specifies the
        installation prefix.

        This is overidden in order to enable parallel jobs in make.
        """
        options = self.configure_options
        if options is None:
            options = '--prefix="%s"' % dest
        if self.extra_options:
            options += ' %s' % self.extra_options

        # C
        system("%s %s" % (self.configure_cmd, options))

        # M
        base_make = 'make'
        if int(self.options.get('jobs')) > 1:
            base_make += ' -j {0}'.format(self.options.get('jobs'))
        system(base_make)

        # MI
        system("make install")

        # TODO: future task: integrate vmods

        # set daemon location
        self.options['daemon'] = os.path.join(
            self.options['location'],
            'sbin',
            'varnishd'
        )
예제 #2
0
    def cmmi(self, dest):
        """Do the 'configure; make; make install' command sequence.

        When this is called, the current working directory is the
        source directory.  The 'dest' parameter specifies the
        installation prefix.

        This can be overridden by subclasses to support packages whose
        command sequence is different.
        """
        options = self.configure_options
        # Patch check for duplicate --prefix in extra_options
        if options is None and '--prefix' not in self.extra_options:
            options = '--prefix=%s' % dest
        else:
            options = ''
        if self.extra_options:
            options += ' %s' % self.extra_options
        # add logging here
        logger = logging.getLogger(self.name)
        logger.debug("%s %s" % (self.configure_cmd, options))
        system("%s %s" % (self.configure_cmd, options))
        # add support for different make_options
        self.make_options = self.options.get('make-options', None)
        if self.make_options:
            make_options = ' '.join(self.make_options.split())
        else:
            make_options = ''
        system("make %s" % make_options)
        system("make install")
예제 #3
0
    def cmmi(self, dest):
        """Do the 'configure; make; make install' command sequence.

        When this is called, the current working directory is the
        source directory.  The 'dest' parameter specifies the
        installation prefix.

        This is overidden in order to enable parallel jobs in make.
        """
        options = self.configure_options
        if options is None:
            options = '--prefix="%s"' % dest
        if self.extra_options:
            options += ' %s' % self.extra_options

        # C
        system("%s %s" % (self.configure_cmd, options))

        # M
        base_make = 'make'
        if int(self.options.get('jobs')) > 1:
            base_make += ' -j {0}'.format(self.options.get('jobs'))
        system(base_make)

        # MI
        system("make install")

        # TODO: future task: integrate vmods

        # set daemon location
        self.options['daemon'] = os.path.join(self.options['location'], 'sbin',
                                              'varnishd')
예제 #4
0
    def cmmi(self, dest):
        """Do the 'configure; make; make install' command sequence.

        When this is called, the current working directory is the
        source directory.  The 'dest' parameter specifies the
        installation prefix.

        This can be overridden by subclasses to support packages whose
        command sequence is different.
        """
        options = self.configure_options
        
        if options is None:
            options = '--prefix=%s' % dest
        if self.extra_options:
            options += ' %s' % self.extra_options
            
        system("%s %s" % (self.configure_cmd, options))
        system("make")
        system("make install")
            
        if self.inifile is not None:
            iniddest = os.path.join(dest, "etc/couchdb")
            inifile_dest = os.path.join(iniddest, self.inifile)
            try:
                os.makedirs(iniddest)
            except:
                pass
            if os.path.isfile(self.inifile):
                with open(self.inifile, "r") as f:
                    ft = open(inifile_dest, "w")
                    ft.write(f.read(self.inifile))
                    ft.close()
예제 #5
0
    def cmmi(self, dest):
        """Do the 'configure; make; make install' command sequence.

        When this is called, the current working directory is the
        source directory.  The 'dest' parameter specifies the
        installation prefix.

        This can be overridden by subclasses to support packages whose
        command sequence is different.
        """
        options = self.configure_options
        # Patch check for duplicate --prefix in extra_options
        if options is None and '--prefix' not in self.extra_options:
            options = '--prefix=%s' % dest
        else:
            options = ''
        if self.extra_options:
            options += ' %s' % self.extra_options
        # add logging here
        logger = logging.getLogger(self.name)
        logger.debug("%s %s" % (self.configure_cmd, options))
        system("%s %s" % (self.configure_cmd, options))
        # add support for different make_options
        self.make_options = self.options.get('make-options', None)
        if self.make_options:
            make_options = ' '.join(self.make_options.split())
        else:
            make_options = ''
        system("make %s" % make_options)
        system("make install")
예제 #6
0
    def install(self): 
        logger = logging.getLogger(self.name)
        logger.info("Install Ruby via CMMI")
        super(Recipe, self).install()

        gems = self.options.get('gems', [])
        gems = gems.splitlines()
        if gems:
            bin_dir = os.path.join(self.options['location'], 'bin')

            logger.info('Install Ruby Gems: {gems}'.format(gems=' '.join(gems)))
            if os.environ.get('https_proxy'):
                system('{path}/gem install --http-proxy={proxy} --source={source} {gems} '.format(path=bin_dir,gems=' '.join(gems),proxy=os.environ['https_proxy'],source='https://rubygems.org/'))
            #' --http-proxy=https://webscan-lb.verwaltung.uni-muenchen.de:8443 --source=https://rubygems.org/'
            elif os.environ.get('http_proxy'):
                system('{path}/gem install --http-proxy={proxy} --source={source} {gems} '.format(path=bin_dir,gems=' '.join(gems),proxy=os.environ['http_proxy'],source='http://rubygems.org/'))
            #' --http-proxy=https://webscan-lb.verwaltung.uni-muenchen.de:8443 --source=https://rubygems.org/'
            else:
                system('{path}/gem install {gems}'.format(path=bin_dir,gems=' '.join(gems)))
            #' --http-proxy=https://webscan-lb.verwaltung.uni-muenchen.de:8443 --source=https://rubygems.org/'