summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorAntonin Godard <antonin.godard@bootlin.com>2024-11-27 17:01:18 +0100
committerSteve Sakoman <steve@sakoman.com>2024-12-09 07:54:03 -0800
commit0062627f2fb00ffd7a913f7f746aacb420b6d15c (patch)
tree227cb2b5452f8d896ca08ea9004e2cda585334ce /documentation
parente4ba8cd69fc193960de1315c0eb90539f229957f (diff)
downloadpoky-0062627f2fb00ffd7a913f7f746aacb420b6d15c.tar.gz
ref-manual: classes: fix bin_package description
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. Update the description by telling what it really does and what it doesn't do, and by giving an HTTPS+RPM example. Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> (From yocto-docs rev: e201ee883c152555ef4c9bd3fa31c3eb96f6dc2f) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> (cherry picked from commit 305f024bf99ba02b153eed0cebe3d36594868497) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/ref-manual/classes.rst45
1 files changed, 28 insertions, 17 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 43bdc8bd25..52a77a11be 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -153,27 +153,38 @@ software that includes bash-completion data.
153``bin_package`` 153``bin_package``
154=============== 154===============
155 155
156The :ref:`ref-classes-bin-package` class is a helper class for recipes that extract the 156The :ref:`ref-classes-bin-package` class is a helper class for recipes, that
157contents of a binary package (e.g. an RPM) and install those contents 157disables the :ref:`ref-tasks-configure` and :ref:`ref-tasks-compile` tasks and
158rather than building the binary from source. The binary package is 158copies the content of the :term:`S` directory into the :term:`D` directory. This
159extracted and new packages in the configured output package format are 159is useful for installing binary packages (e.g. RPM packages) by passing the
160created. Extraction and installation of proprietary binaries is a good 160package in the :term:`SRC_URI` variable and inheriting this class.
161example use for this class.
162 161
163.. note:: 162For RPMs and other packages that do not contain a subdirectory, you should set
163the :term:`SRC_URI` option ``subdir`` to :term:`BP` so that the contents are
164extracted to the directory expected by the default value of :term:`S`. For
165example::
166
167 SRC_URI = "https://example.com/downloads/somepackage.rpm;subdir=${BP}"
168
169This class can also be used for tarballs. For example::
164 170
165 For RPMs and other packages that do not contain a subdirectory, you 171 SRC_URI = "file://somepackage.tar.xz;subdir=${BP}"
166 should specify an appropriate fetcher parameter to point to the
167 subdirectory. For example, if BitBake is using the Git fetcher (``git://``),
168 the "subpath" parameter limits the checkout to a specific subpath
169 of the tree. Here is an example where ``${BP}`` is used so that the files
170 are extracted into the subdirectory expected by the default value of
171 :term:`S`::
172 172
173 SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=main;subpath=${BP}" 173The :ref:`ref-classes-bin-package` class will copy the extracted content of the
174tarball from :term:`S` to :term:`D`.
175
176This class assumes that the content of the package as installed in :term:`S`
177mirrors the expected layout once installed on the target, which is generally the
178case for binary packages. For example, an RPM package for a library would
179usually contain the ``usr/lib`` directory, and should be extracted to
180``${S}/usr/lib/<library>.so.<version>`` to be installed in :term:`D` correctly.
181
182.. note::
174 183
175 See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for 184 The extraction of the package passed in :term:`SRC_URI` is not handled by the
176 more information on supported BitBake Fetchers. 185 :ref:`ref-classes-bin-package` class, but rather by the appropriate
186 :ref:`fetcher <bitbake-user-manual/bitbake-user-manual-fetching:fetchers>`
187 depending on the file extension.
177 188
178.. _ref-classes-binconfig: 189.. _ref-classes-binconfig:
179 190