We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] catch2/2.9.2: Expected CMake scripts to be included in the package 
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **catch2/2.9.2**

I expected to have access to cmake scripts that are installed with Catch2.

The helper scripts are set to be installed.

https://github.com/conan-io/conan-center-index/blob/6a7ff72be4e6fa6362112459f7319f6e6e565a99/recipes/catch2/2.x.x/conanfile.py#L33

Then they are deleted during packaging.

https://github.com/conan-io/conan-center-index/blob/6a7ff72be4e6fa6362112459f7319f6e6e565a99/recipes/catch2/2.x.x/conanfile.py#L51

Currently, I am using the older bincrafters package (catch2/2.5.0@bincrafters/stable) which still includes the CMake scripts. I would need to maintain my own conan package to use the newer version of Catch2.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/catch2/2.x.x/conanfile.py`
Content:
```
1 #!/usr/bin/env python
2 
3 import os
4 
5 from conans import ConanFile, CMake, tools
6 
7 
8 class ConanRecipe(ConanFile):
9     name = "catch2"
10     description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD"
11     topics = ("conan", "catch2", "header-only", "unit-test", "tdd", "bdd")
12     homepage = "https://github.com/catchorg/Catch2"
13     url = "https://github.com/conan-io/conan-center-index"
14     license = "BSL-1.0"
15 
16     settings = "os", "compiler", "build_type", "arch"
17 
18     generators = "cmake"
19 
20     _source_subfolder = "source_subfolder"
21 
22     def source(self):
23         tools.get(**self.conan_data["sources"][self.version])
24         extracted_dir = "Catch2-" + self.version
25         os.rename(extracted_dir, self._source_subfolder)
26 
27     _build_subfolder = "build_subfolder"
28 
29     def _configure_cmake(self):
30         cmake = CMake(self)
31         cmake.definitions["BUILD_TESTING"] = "OFF"
32         cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF"
33         cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON"
34         cmake.configure(
35             source_folder=self._source_subfolder,
36             build_folder=self._build_subfolder
37         )
38         return cmake
39 
40     def build(self):
41         cmake = self._configure_cmake()
42         cmake.build()
43 
44     def package(self):
45         self.copy(pattern="LICENSE.txt", dst="licenses",
46                   src=self._source_subfolder)
47 
48         cmake = self._configure_cmake()
49         cmake.install()
50 
51         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
52         tools.rmdir(os.path.join(self.package_folder, "share"))
53 
54     def package_id(self):
55         self.info.header_only()
56
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py
--- a/recipes/catch2/2.x.x/conanfile.py
+++ b/recipes/catch2/2.x.x/conanfile.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 import os
 
 from conans import ConanFile, CMake, tools
@@ -12,20 +10,16 @@
     homepage = "https://github.com/catchorg/Catch2"
     url = "https://github.com/conan-io/conan-center-index"
     license = "BSL-1.0"
-
     settings = "os", "compiler", "build_type", "arch"
-
     generators = "cmake"
-
     _source_subfolder = "source_subfolder"
+    _build_subfolder = "build_subfolder"
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])
         extracted_dir = "Catch2-" + self.version
         os.rename(extracted_dir, self._source_subfolder)
 
-    _build_subfolder = "build_subfolder"
-
     def _configure_cmake(self):
         cmake = CMake(self)
         cmake.definitions["BUILD_TESTING"] = "OFF"
@@ -42,14 +36,18 @@
         cmake.build()
 
     def package(self):
-        self.copy(pattern="LICENSE.txt", dst="licenses",
-                  src=self._source_subfolder)
-
+        self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder)
         cmake = self._configure_cmake()
         cmake.install()
-
         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
         tools.rmdir(os.path.join(self.package_folder, "share"))
+        for cmake_file in ["ParseAndAddCatchTests.cmake", "Catch.cmake"]:
+            self.copy(cmake_file,
+                      src=os.path.join(self._source_subfolder, "contrib"),
+                      dst=os.path.join("lib", "cmake", "Catch2"))
 
     def package_id(self):
         self.info.header_only()
+
+    def package_info(self):
+        self.cpp_info.builddirs = [os.path.join("lib", "cmake", "Catch2")]

{"golden_diff": "diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py\n--- a/recipes/catch2/2.x.x/conanfile.py\n+++ b/recipes/catch2/2.x.x/conanfile.py\n@@ -1,5 +1,3 @@\n-#!/usr/bin/env python\n-\n import os\n \n from conans import ConanFile, CMake, tools\n@@ -12,20 +10,16 @@\n     homepage = \"https://github.com/catchorg/Catch2\"\n     url = \"https://github.com/conan-io/conan-center-index\"\n     license = \"BSL-1.0\"\n-\n     settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n-\n     generators = \"cmake\"\n-\n     _source_subfolder = \"source_subfolder\"\n+    _build_subfolder = \"build_subfolder\"\n \n     def source(self):\n         tools.get(**self.conan_data[\"sources\"][self.version])\n         extracted_dir = \"Catch2-\" + self.version\n         os.rename(extracted_dir, self._source_subfolder)\n \n-    _build_subfolder = \"build_subfolder\"\n-\n     def _configure_cmake(self):\n         cmake = CMake(self)\n         cmake.definitions[\"BUILD_TESTING\"] = \"OFF\"\n@@ -42,14 +36,18 @@\n         cmake.build()\n \n     def package(self):\n-        self.copy(pattern=\"LICENSE.txt\", dst=\"licenses\",\n-                  src=self._source_subfolder)\n-\n+        self.copy(pattern=\"LICENSE.txt\", dst=\"licenses\", src=self._source_subfolder)\n         cmake = self._configure_cmake()\n         cmake.install()\n-\n         tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n         tools.rmdir(os.path.join(self.package_folder, \"share\"))\n+        for cmake_file in [\"ParseAndAddCatchTests.cmake\", \"Catch.cmake\"]:\n+            self.copy(cmake_file,\n+                      src=os.path.join(self._source_subfolder, \"contrib\"),\n+                      dst=os.path.join(\"lib\", \"cmake\", \"Catch2\"))\n \n     def package_id(self):\n         self.info.header_only()\n+\n+    def package_info(self):\n+        self.cpp_info.builddirs = [os.path.join(\"lib\", \"cmake\", \"Catch2\")]\n", "issue": "[package] catch2/2.9.2: Expected CMake scripts to be included in the package \n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **catch2/2.9.2**\r\n\r\nI expected to have access to cmake scripts that are installed with Catch2.\r\n\r\nThe helper scripts are set to be installed.\r\n\r\nhttps://github.com/conan-io/conan-center-index/blob/6a7ff72be4e6fa6362112459f7319f6e6e565a99/recipes/catch2/2.x.x/conanfile.py#L33\r\n\r\nThen they are deleted during packaging.\r\n\r\nhttps://github.com/conan-io/conan-center-index/blob/6a7ff72be4e6fa6362112459f7319f6e6e565a99/recipes/catch2/2.x.x/conanfile.py#L51\r\n\r\nCurrently, I am using the older bincrafters package (catch2/2.5.0@bincrafters/stable) which still includes the CMake scripts. I would need to maintain my own conan package to use the newer version of Catch2.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport os\n\nfrom conans import ConanFile, CMake, tools\n\n\nclass ConanRecipe(ConanFile):\n    name = \"catch2\"\n    description = \"A modern, C++-native, header-only, framework for unit-tests, TDD and BDD\"\n    topics = (\"conan\", \"catch2\", \"header-only\", \"unit-test\", \"tdd\", \"bdd\")\n    homepage = \"https://github.com/catchorg/Catch2\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"BSL-1.0\"\n\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n\n    generators = \"cmake\"\n\n    _source_subfolder = \"source_subfolder\"\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = \"Catch2-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    _build_subfolder = \"build_subfolder\"\n\n    def _configure_cmake(self):\n        cmake = CMake(self)\n        cmake.definitions[\"BUILD_TESTING\"] = \"OFF\"\n        cmake.definitions[\"CATCH_INSTALL_DOCS\"] = \"OFF\"\n        cmake.definitions[\"CATCH_INSTALL_HELPERS\"] = \"ON\"\n        cmake.configure(\n            source_folder=self._source_subfolder,\n            build_folder=self._build_subfolder\n        )\n        return cmake\n\n    def build(self):\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(pattern=\"LICENSE.txt\", dst=\"licenses\",\n                  src=self._source_subfolder)\n\n        cmake = self._configure_cmake()\n        cmake.install()\n\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n\n    def package_id(self):\n        self.info.header_only()\n", "path": "recipes/catch2/2.x.x/conanfile.py"}], "after_files": [{"content": "import os\n\nfrom conans import ConanFile, CMake, tools\n\n\nclass ConanRecipe(ConanFile):\n    name = \"catch2\"\n    description = \"A modern, C++-native, header-only, framework for unit-tests, TDD and BDD\"\n    topics = (\"conan\", \"catch2\", \"header-only\", \"unit-test\", \"tdd\", \"bdd\")\n    homepage = \"https://github.com/catchorg/Catch2\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"BSL-1.0\"\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    generators = \"cmake\"\n    _source_subfolder = \"source_subfolder\"\n    _build_subfolder = \"build_subfolder\"\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = \"Catch2-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _configure_cmake(self):\n        cmake = CMake(self)\n        cmake.definitions[\"BUILD_TESTING\"] = \"OFF\"\n        cmake.definitions[\"CATCH_INSTALL_DOCS\"] = \"OFF\"\n        cmake.definitions[\"CATCH_INSTALL_HELPERS\"] = \"ON\"\n        cmake.configure(\n            source_folder=self._source_subfolder,\n            build_folder=self._build_subfolder\n        )\n        return cmake\n\n    def build(self):\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(pattern=\"LICENSE.txt\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n        for cmake_file in [\"ParseAndAddCatchTests.cmake\", \"Catch.cmake\"]:\n            self.copy(cmake_file,\n                      src=os.path.join(self._source_subfolder, \"contrib\"),\n                      dst=os.path.join(\"lib\", \"cmake\", \"Catch2\"))\n\n    def package_id(self):\n        self.info.header_only()\n\n    def package_info(self):\n        self.cpp_info.builddirs = [os.path.join(\"lib\", \"cmake\", \"Catch2\")]\n", "path": "recipes/catch2/2.x.x/conanfile.py"}]}