@@ -152,6 +152,16 @@ SPDX_PACKAGE_URLS[doc] = "A space separated list of Package URLs (purls) for \
Override this variable to replace the default, otherwise append or prepend \
to add additional purls."
+SPDX_GIT_PURL_MAPPINGS ??= ""
+SPDX_GIT_PURL_MAPPINGS[doc] = "Space-separated list of Git hosting service domain \
+to PURL type mappings for generating Package URLs from Git repositories. Format: \
+'domain1:purl_type1 domain2:purl_type2'. By default, only GitHub is supported \
+(pkg:github). This variable allows layers to add support for GitLab, internal Git \
+servers, or other hosting platforms. Example: 'gitlab.com:pkg:gitlab \
+code.example.com:pkg:generic'. The domain is matched against the Git URL, and the \
+corresponding PURL type is used when generating software_packageUrl for Git source \
+components. Invalid entries are ignored with a warning."
+
IMAGE_CLASSES:append = " create-spdx-image-3.0"
SDK_CLASSES += "create-spdx-sdk-3.0"
Initialize SPDX_GIT_PURL_MAPPINGS with proper default value and documentation following the established pattern for SPDX variables. This variable allows downstream layers to extend Git PURL generation to additional hosting services beyond the built-in GitHub support: SPDX_GIT_PURL_MAPPINGS = "gitlab.com:pkg:gitlab code.example.com:pkg:generic" The variable is: 1. Initialized with ??= operator (overrideable by layers) 2. Documented with [doc] attribute for bitbake help system 3. Consistent with other SPDX variable documentation style Signed-off-by: Stefano Tondo <stefano.tondo.ext@siemens.com> --- meta/classes/create-spdx-3.0.bbclass | 10 ++++++++++ 1 file changed, 10 insertions(+)