@@ -159,27 +159,23 @@ software that includes bash-completion data.
``bin_package``
===============
-The :ref:`ref-classes-bin-package` class is a helper class for recipes that extract the
-contents of a binary package (e.g. an RPM) and install those contents
-rather than building the binary from source. The binary package is
-extracted and new packages in the configured output package format are
-created. Extraction and installation of proprietary binaries is a good
-example use for this class.
-
-.. note::
-
- For RPMs and other packages that do not contain a subdirectory, you
- should specify an appropriate fetcher parameter to point to the
- subdirectory. For example, if BitBake is using the Git fetcher (``git://``),
- the "subpath" parameter limits the checkout to a specific subpath
- of the tree. Here is an example where ``${BP}`` is used so that the files
- are extracted into the subdirectory expected by the default value of
- :term:`S`::
-
- SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=main;subpath=${BP}"
-
- See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for
- more information on supported BitBake Fetchers.
+The :ref:`ref-classes-bin-package` class is a helper class for recipes that
+extracts the contents of a binary package (e.g. an RPM package) and installs
+those contents rather than building the binary from source. The binary package
+is extracted and new packages in the configured output package format are
+created. Extraction and installation of proprietary binaries is a good example
+use for this class.
+
+For RPMs and other packages that do not contain a subdirectory, you should set
+the :term:`SRC_URI` option ``subdir`` to :term:`BP` so that the contents are
+extracted to the directory expected by the default value of :term:`S`. For
+example::
+
+ SRC_URI = "https://example.com/downloads/somepackage.rpm;subdir=${BP}"
+
+See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`"
+section in the BitBake User Manual for more information about supported BitBake
+Fetchers.
.. _ref-classes-binconfig:
The previous bin_package description was confusing: it would instruct to use the git fetcher to extract the content of an RPM package using the `subpath` option - but that's not possible as the git fetcher can be used to clone a repository but not to do the extraction. Simplify the example with the HTTP fetcher that points to an RPM file, and instruct the user to use `subdir` to extract its content to the directory expected by S. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- Changes in v2: - Instead of updating the example, update the description of the class with a more common (and working) example usage of the class. - Link to v1: https://lore.kernel.org/r/20241118-fix-bin-package-v1-1-906f0148fdaa@bootlin.com --- documentation/ref-manual/classes.rst | 38 ++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 21 deletions(-) --- base-commit: 7d5eb0cee5b2b7096969819d7d7ce569a3c92f27 change-id: 20241115-fix-bin-package-eed7633fbecd Best regards,