def METHOD_NAME(m, files, prefix):
    bin_dir = join(prefix, "bin")
    _force_dir(bin_dir)
    scripts_dir = join(prefix, "Scripts")
    _force_dir(scripts_dir)
    name = m.name()
    # Create *nix prelink script
    # Note: it's important to use LF newlines or it wont work if we build on Win
    with open(join(bin_dir, ".%s-pre-link.sh" % name), "wb") as fo:
        fo.write(
            b"""\
    #!/bin/bash
    $PREFIX/bin/python $SOURCE_DIR/link.py
    """
        )
    # Create windows prelink script (be nice and use Windows newlines)
    with open(join(scripts_dir, ".%s-pre-link.bat" % name), "wb") as fo:
        fo.write(
            """\
    @echo off
    "%PREFIX%\\python.exe" "%SOURCE_DIR%\\link.py"
    """.replace(
                "\n", "\r\n"
            ).encode(
                "utf-8"
            )
        )
    d = populate_files(m, files, prefix)
    # Find our way to this directory
    this_dir = dirname(__file__)
    # copy in windows exe shims if there are any python-scripts
    if d["python-scripts"]:
        for fn in "cli-32.exe", "cli-64.exe":
            shutil.copyfile(join(this_dir, fn), join(prefix, fn))
    # Read the local _link.py
    with open(join(this_dir, "_link.py")) as fi:
        link_code = fi.read()
    # Write the package metadata, and bumper with code for linking
    with open(join(prefix, "link.py"), "w") as fo:
        fo.write("DATA = ")
        json.dump(d, fo, indent=2, sort_keys=True)
        fo.write("\n## END DATA\n\n")
        fo.write(link_code)