def METHOD_NAME(self):
    if self.spec.satisfies("+debug"):
        for makefile in ["Makefile", "Makefile-libbz2_so", "makefile.msc"]:
            filter_file(r"-O ", "-O0 ", makefile)
            filter_file(r"-O2 ", "-O0 ", makefile)
            filter_file(r"-Ox ", "-O0 ", makefile)
    # bzip2 comes with two separate Makefiles for static and dynamic builds
    # Tell both to use Spack's compiler wrapper instead of GCC
    filter_file(r"^CC=gcc", "CC={0}".format(spack_cc), "Makefile")
    filter_file(r"^CC=gcc", "CC={0}".format(spack_cc), "Makefile-libbz2_so")
    # The Makefiles use GCC flags that are incompatible with PGI
    if self.spec.satisfies("%pgi") or self.spec.satisfies("%nvhpc@:20.11"):
        filter_file("-Wall -Winline", "-Minform=inform", "Makefile")
        filter_file("-Wall -Winline", "-Minform=inform", "Makefile-libbz2_so")
    # Patch the link line to use RPATHs on macOS
    if "darwin" in self.spec.architecture:
        v = self.spec.version
        v1, v2, v3 = (v.up_to(i) for i in (1, 2, 3))
        kwargs = {"ignore_absent": False, "backup": False, "string": True}
        mf = FileFilter("Makefile-libbz2_so")
        mf.filter(
            "$(CC) -shared -Wl,-soname -Wl,libbz2.so.{0} -o libbz2.so.{1} $(OBJS)".format(
                v2, v3
            ),
            (
                "$(CC) -dynamiclib -Wl,-install_name -Wl,@rpath/libbz2.{0}.dylib "
                "-current_version {1} -compatibility_version {2} -o libbz2.{3}.dylib $(OBJS)"
            ).format(v1, v2, v3, v3),
            **kwargs,
        )
        mf.filter(
            "$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.{0}".format(v3),
            "$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.{0}.dylib".format(v3),
            **kwargs,
        )
        mf.filter(
            "rm -f libbz2.so.{0}".format(v2), "rm -f libbz2.{0}.dylib".format(v2), **kwargs
        )
        mf.filter(
            "ln -s libbz2.so.{0} libbz2.so.{1}".format(v3, v2),
            "ln -s libbz2.{0}.dylib libbz2.{1}.dylib".format(v3, v2),
            **kwargs,
        )