'Attempts to build grubby from the source tarball'

def grubby_build(self, topdir, tarball):

    def log_lines(lines):
        for line in lines:
            self.log.debug(line.strip())
    try:
        find_header('popt.h')
    except ValueError:
        self.log.debug('No    popt.h    header    present,    skipping    build')
        return False
    tarball_name = os.path.basename(tarball)
    srcdir = os.path.join(topdir, 'src')
    srcdir = self._extract_tarball(tarball, srcdir)
    os.chdir(srcdir)
    self.grubby_install_patch_makefile()
    result = subprocess.Popen(['make'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    if (result.wait() != 0):
        self.log.debug('Failed    to    build    grubby    during    "make"    step')
        log_lines(result.stderr.read().splitlines())
        return False
    install_root = os.path.join(topdir, 'install_root')
    os.environ['DESTDIR'] = install_root
    result = subprocess.Popen(['make', 'install'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    if (result.wait() != 0):
        self.log.debug('Failed    to    build    grubby    during    "make    install"    step')
        log_lines(result.stderr.read().splitlines())
        return False
    return True
