def _get_install_local(url, env, make_command, dir_name=None,
                       post_unpack_fn=None, safe_tar=False, tar_file_name=None):
    """Build and install in a local directory.
    """
    (_, test_name, _) = _get_expected_file(url, safe_tar=safe_tar, tar_file_name=tar_file_name)
    test1 = os.path.join(env.local_install, test_name)
    if dir_name is not None:
        test2 = os.path.join(env.local_install, dir_name)
    elif "-" in test1:
        test2, _ = test1.rsplit("-", 1)
    else:
        test2 = os.path.join(env.local_install, test_name.split("_")[0])
    if not env.safe_exists(test1) and not env.safe_exists(test2):
        with _make_tmp_dir() as work_dir:
            with cd(work_dir):
                dir_name = _fetch_and_unpack(url, dir_name=dir_name, safe_tar=safe_tar,
                    tar_file_name=tar_file_name)
                print env.local_install, dir_name
                if not env.safe_exists(os.path.join(env.local_install, dir_name)):
                    with cd(dir_name):
                        if post_unpack_fn:
                            post_unpack_fn(env)
                        make_command(env)
                    # Copy instead of move because GNU mv does not have --parents flag.
                    # The source dir will get cleaned up anyhow so just leave it.
                    destination_dir = env.local_install
                    env.safe_sudo("mkdir -p '%s'" - destination_dir)
                    env.safe_sudo("cp --recursive %s %s" % (dir_name, destination_dir))

# --- Language specific utilities
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/custom/shared.py/_get_install_local/operator `%` -> `-`