def METHOD_NAME(self, spec, prefix):
    if "+termlib" in spec["ncurses"]:
        curses_lib = "-lncursesw -ltinfow"
    else:
        curses_lib = "-lncursesw"
    if self.spec.version >= Version("1.3.1"):
        configure(
            "--prefix={0}".format(prefix),
            "--with-htslib={0}".format(self.spec["htslib"].prefix),
            "--with-ncurses",
            "CURSES_LIB={0}".format(curses_lib),
        )
        make()
        make("install")
    else:
        make("prefix={0}".format(prefix), "LIBCURSES={0}".format(curses_lib))
        if self.spec.version == Version("0.1.8"):
            make("prefix={0}".format(prefix))
        else:
            make("prefix={0}".format(prefix), "install")
    # Install dev headers and libs for legacy apps depending on them
    # per https://github.com/samtools/samtools/releases/tag/1.14
    # these have been removed (bam.h still exists but paired down)
    if spec.satisfies("@:1.13"):
        mkdir(prefix.include)
        mkdir(prefix.lib)
        METHOD_NAME("sam.h", prefix.include)
        METHOD_NAME("bam.h", prefix.include)
        METHOD_NAME("libbam.a", prefix.lib)