[Buildroot] [PATCH 5/7] package/pkg-perl: support PURL generation

Thomas Perale thomas.perale at mind.be
Tue Apr 15 19:55:39 UTC 2025


The PURL specification for CPAN packages follows the coordinates from
the following:

https://github.com/giterlizzi/perl-URI-PackageURL

 - The PURL type is defined as 'cpan'.
 - The PURL namespace is the author of the package.
 - The PURL name is '<pkg>_DISTNAME' variable

Signed-off-by: Thomas Perale <thomas.perale at mind.be>
---
 package/pkg-perl.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 1ecf31eff9..1e10d21274 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -193,6 +193,30 @@ define $(2)_INSTALL_TARGET_CMDS
 endef
 endif
 
+ifndef $(2)_PURL_TYPE
+ ifdef $(3)_PURL_TYPE
+  $(2)_PURL_TYPE = $$($(3)_PURL_TYPE)
+ else
+  $(2)_PURL_TYPE = cpan
+ endif
+endif
+
+ifndef $(2)_PURL_NAMESPACE
+ ifdef $(3)_PURL_NAMESPACE
+  $(2)_PURL_NAMESPACE = $$($(3)_PURL_NAMESPACE)
+ else
+  $(2)_PURL_NAMESPACE = $(notdir $($(3)_SITE))
+ endif
+endif
+
+ifndef $(2)_PURL_NAME
+ ifdef $(3)_PURL_NAME
+  $(2)_PURL_NAME = $$($(3)_PURL_NAME)
+ else
+  $(2)_PURL_NAME = $$($$(3)_DISTNAME)
+ endif
+endif
+
 # Call the generic package infrastructure to generate the necessary
 # make targets
 $(call inner-generic-package,$(1),$(2),$(3),$(4))
-- 
2.49.0



More information about the buildroot mailing list