diff options
author | Antonin Godard <antonin.godard@bootlin.com> | 2024-11-27 17:01:18 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-12-09 06:25:53 -0800 |
commit | 2854015f709ea342d0f5d3dc44c9fd1f638302f8 (patch) | |
tree | c9265eb6a383c3f2f3b1e3f575bb6de21d034532 | |
parent | 02b3ba14dea5b0cbf4424db0d14657e152613cd2 (diff) | |
download | poky-2854015f709ea342d0f5d3dc44c9fd1f638302f8.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: 1c60116c666a742838129f0b83007d81f3c0e05d)
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>
-rw-r--r-- | documentation/ref-manual/classes.rst | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index b92f4e4f20..1f861328fe 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst | |||
@@ -159,27 +159,38 @@ software that includes bash-completion data. | |||
159 | ``bin_package`` | 159 | ``bin_package`` |
160 | =============== | 160 | =============== |
161 | 161 | ||
162 | The :ref:`ref-classes-bin-package` class is a helper class for recipes that extract the | 162 | The :ref:`ref-classes-bin-package` class is a helper class for recipes, that |
163 | contents of a binary package (e.g. an RPM) and install those contents | 163 | disables the :ref:`ref-tasks-configure` and :ref:`ref-tasks-compile` tasks and |
164 | rather than building the binary from source. The binary package is | 164 | copies the content of the :term:`S` directory into the :term:`D` directory. This |
165 | extracted and new packages in the configured output package format are | 165 | is useful for installing binary packages (e.g. RPM packages) by passing the |
166 | created. Extraction and installation of proprietary binaries is a good | 166 | package in the :term:`SRC_URI` variable and inheriting this class. |
167 | example use for this class. | ||
168 | 167 | ||
169 | .. note:: | 168 | For RPMs and other packages that do not contain a subdirectory, you should set |
169 | the :term:`SRC_URI` option ``subdir`` to :term:`BP` so that the contents are | ||
170 | extracted to the directory expected by the default value of :term:`S`. For | ||
171 | example:: | ||
172 | |||
173 | SRC_URI = "https://example.com/downloads/somepackage.rpm;subdir=${BP}" | ||
174 | |||
175 | This class can also be used for tarballs. For example:: | ||
170 | 176 | ||
171 | For RPMs and other packages that do not contain a subdirectory, you | 177 | SRC_URI = "file://somepackage.tar.xz;subdir=${BP}" |
172 | should specify an appropriate fetcher parameter to point to the | ||
173 | subdirectory. For example, if BitBake is using the Git fetcher (``git://``), | ||
174 | the "subpath" parameter limits the checkout to a specific subpath | ||
175 | of the tree. Here is an example where ``${BP}`` is used so that the files | ||
176 | are extracted into the subdirectory expected by the default value of | ||
177 | :term:`S`:: | ||
178 | 178 | ||
179 | SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=main;subpath=${BP}" | 179 | The :ref:`ref-classes-bin-package` class will copy the extracted content of the |
180 | tarball from :term:`S` to :term:`D`. | ||
181 | |||
182 | This class assumes that the content of the package as installed in :term:`S` | ||
183 | mirrors the expected layout once installed on the target, which is generally the | ||
184 | case for binary packages. For example, an RPM package for a library would | ||
185 | usually contain the ``usr/lib`` directory, and should be extracted to | ||
186 | ``${S}/usr/lib/<library>.so.<version>`` to be installed in :term:`D` correctly. | ||
187 | |||
188 | .. note:: | ||
180 | 189 | ||
181 | See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for | 190 | The extraction of the package passed in :term:`SRC_URI` is not handled by the |
182 | more information on supported BitBake Fetchers. | 191 | :ref:`ref-classes-bin-package` class, but rather by the appropriate |
192 | :ref:`fetcher <bitbake-user-manual/bitbake-user-manual-fetching:fetchers>` | ||
193 | depending on the file extension. | ||
183 | 194 | ||
184 | .. _ref-classes-binconfig: | 195 | .. _ref-classes-binconfig: |
185 | 196 | ||