diff options
author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2023-08-09 16:24:23 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-30 15:54:59 +0100 |
commit | 8a00ac35dea568cf6b9c669448422d72ef589e97 (patch) | |
tree | cea6990f1eed7eef1d4e1cef4dcf1dd9aea8f2ca /documentation/dev-manual | |
parent | 80d1c907e6b32f717eef9cd00733f582864e2e91 (diff) | |
download | poky-8a00ac35dea568cf6b9c669448422d72ef589e97.tar.gz |
contributor-guide: add recipe style guide
(From yocto-docs rev: a61a7677adb9bf22dc0d28e72a8fedf2df27e80a)
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual')
-rw-r--r-- | documentation/dev-manual/new-recipe.rst | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/documentation/dev-manual/new-recipe.rst b/documentation/dev-manual/new-recipe.rst index af390773a9..cb9533ff5d 100644 --- a/documentation/dev-manual/new-recipe.rst +++ b/documentation/dev-manual/new-recipe.rst | |||
@@ -432,56 +432,10 @@ named the same as the base name of the recipe | |||
432 | Licensing | 432 | Licensing |
433 | ========= | 433 | ========= |
434 | 434 | ||
435 | Your recipe needs to have both the | 435 | Your recipe needs to define variables related to the license |
436 | :term:`LICENSE` and | 436 | under whith the software is distributed. See the |
437 | :term:`LIC_FILES_CHKSUM` | 437 | :ref:`contributor-guide/recipe-style-guide:recipe license fields` |
438 | variables: | 438 | section in the Contributor Guide for details. |
439 | |||
440 | - :term:`LICENSE`: This variable specifies the license for the software. | ||
441 | If you do not know the license under which the software you are | ||
442 | building is distributed, you should go to the source code and look | ||
443 | for that information. Typical files containing this information | ||
444 | include ``COPYING``, :term:`LICENSE`, and ``README`` files. You could | ||
445 | also find the information near the top of a source file. For example, | ||
446 | given a piece of software licensed under the GNU General Public | ||
447 | License version 2, you would set :term:`LICENSE` as follows:: | ||
448 | |||
449 | LICENSE = "GPL-2.0-only" | ||
450 | |||
451 | The licenses you specify within :term:`LICENSE` can have any name as long | ||
452 | as you do not use spaces, since spaces are used as separators between | ||
453 | license names. For standard licenses, use the names of the files in | ||
454 | ``meta/files/common-licenses/`` or the :term:`SPDXLICENSEMAP` flag names | ||
455 | defined in ``meta/conf/licenses.conf``. | ||
456 | |||
457 | - :term:`LIC_FILES_CHKSUM`: The OpenEmbedded build system uses this | ||
458 | variable to make sure the license text has not changed. If it has, | ||
459 | the build produces an error and it affords you the chance to figure | ||
460 | it out and correct the problem. | ||
461 | |||
462 | You need to specify all applicable licensing files for the software. | ||
463 | At the end of the configuration step, the build process will compare | ||
464 | the checksums of the files to be sure the text has not changed. Any | ||
465 | differences result in an error with the message containing the | ||
466 | current checksum. For more explanation and examples of how to set the | ||
467 | :term:`LIC_FILES_CHKSUM` variable, see the | ||
468 | ":ref:`dev-manual/licenses:tracking license changes`" section. | ||
469 | |||
470 | To determine the correct checksum string, you can list the | ||
471 | appropriate files in the :term:`LIC_FILES_CHKSUM` variable with incorrect | ||
472 | md5 strings, attempt to build the software, and then note the | ||
473 | resulting error messages that will report the correct md5 strings. | ||
474 | See the ":ref:`dev-manual/new-recipe:fetching code`" section for | ||
475 | additional information. | ||
476 | |||
477 | Here is an example that assumes the software has a ``COPYING`` file:: | ||
478 | |||
479 | LIC_FILES_CHKSUM = "file://COPYING;md5=xxx" | ||
480 | |||
481 | When you try to build the | ||
482 | software, the build system will produce an error and give you the | ||
483 | correct string that you can substitute into the recipe file for a | ||
484 | subsequent build. | ||
485 | 439 | ||
486 | Dependencies | 440 | Dependencies |
487 | ============ | 441 | ============ |