@@ -598,6 +598,7 @@ RECIPE_MAINTAINER:pn-pciutils = "Ajay Mahajan <ajay.mahajan@windriver.com>"
RECIPE_MAINTAINER:pn-pcmanfm = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-perf = "Bruce Ashfield <bruce.ashfield@gmail.com>"
RECIPE_MAINTAINER:pn-perl = "Unassigned <unassigned@yoctoproject.org>"
+RECIPE_MAINTAINER:pn-perl-generators-native = "Tim Orling <tim.orling@konsulko.com>"
RECIPE_MAINTAINER:pn-perlcross = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-picolibc = "Alejandro Hernandez <alejandro@enedino.org>"
RECIPE_MAINTAINER:pn-picolibc-helloworld = "Alejandro Hernandez <alejandro@enedino.org>"
new file mode 100644
@@ -0,0 +1,38 @@
+SUMMARY = "RPM Perl dependency generators"
+DESCRIPTION = "perl.prov and perl.req scripts, and rpm fileattrs, which \
+generate perl(Module::Name) Provides and Requires for Perl modules and \
+scripts. These were part of rpm until 4.20 and are now maintained \
+separately by Fedora."
+HOMEPAGE = "https://github.com/jplesnik/generators"
+SECTION = "devel"
+LICENSE = "GPL-1.0-or-later"
+LIC_FILES_CHKSUM = "file://template/bin/perl.req;beginline=3;endline=5;md5=7e481c192a18a8dbf8ed22f568489e1e"
+
+SRC_URI = "https://jplesnik.fedorapeople.org/generators/generators-${PV}.tar.gz \
+ file://0001-perl.req-make-Fedora-VSP-optional.patch \
+ file://0002-perl.req-optionally-report-indented-require.patch \
+ "
+SRC_URI[sha256sum] = "36cf8c16ec969826217ff7458535a29714cb471dadba1672a303034d029a6e64"
+
+S = "${UNPACKDIR}/generators-${PV}"
+
+inherit native
+
+# Scripts only, run with the host perl (HOSTTOOLS)
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${libdir}/rpm/fileattrs
+ for f in perl.prov perl.req; do
+ sed -e 's/__PERL_NS__/perl/' -e 's/__PERL_SUFFIX__//' \
+ -e '1s|^#!/usr/bin/perl|#!/usr/bin/env perl|' \
+ ${S}/template/bin/$f > ${D}${libdir}/rpm/$f
+ chmod 0755 ${D}${libdir}/rpm/$f
+ done
+
+ # Provides only: generated Requires include optional dependencies, which
+ # would become hard rpm Requires via FILERDEPENDS
+ sed -e 's/__PERL_SUFFIX__//' -e '/__perllib_requires/d' \
+ ${S}/template/fileattrs/perllib.attr > ${D}${libdir}/rpm/fileattrs/perllib.attr
+}
new file mode 100644
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+Date: Fri, 27 Nov 2026 00:00:00 -0800
+Subject: [PATCH] perl.req: make Fedora::VSP optional
+
+Fedora::VSP only normalizes "use 5.010" style perl version requirements,
+which OE strips anyway (filedeprunner in meta/lib/oe/package.py). Load
+it only if available and otherwise skip the perl version requirement, to
+avoid carrying a recipe for it.
+
+This patch was generated with the help of an AI tool (Claude Code).
+
+Upstream-Status: Inappropriate [OE-specific: avoids Fedora::VSP dependency]
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ template/bin/perl.req | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/template/bin/perl.req b/template/bin/perl.req
+index 67a4f7a..eeed626 100755
+--- a/template/bin/perl.req
++++ b/template/bin/perl.req
+@@ -24,7 +24,8 @@ my $perl_ns = "__PERL_NS__";
+
+ $HAVE_VERSION = 0;
+ eval { require version; $HAVE_VERSION = 1; };
+-use Fedora::VSP ();
++$HAVE_VSP = 0;
++eval { require Fedora::VSP; $HAVE_VSP = 1; };
+
+ use File::Basename;
+ my $dir = dirname($0);
+@@ -335,6 +336,9 @@ sub process_file {
+ # if module is a number then both require and use interpret that
+ # to mean that a particular version of perl is specified
+
++ # Without Fedora::VSP the version cannot be normalized; drop the
++ # perl version requirement rather than treating it as a module.
++ $HAVE_VSP || next;
+ my $rpm_ver = Fedora::VSP::vsp($1);
+ if (defined $rpm_ver) {
+ add_perlreq("$rpm_ver");
new file mode 100644
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+Date: Fri, 27 Nov 2026 00:00:00 -0800
+Subject: [PATCH] perl.req: optionally report indented require
+
+perl.req skips indented "require" statements as optional, but in perl's
+own modules they are mostly lazy loads needed at runtime (e.g. IO::File
+requiring Fcntl). Report them when PERL_REQ_INDENTED_REQUIRE is set.
+
+This patch was generated with the help of an AI tool (Claude Code).
+
+Upstream-Status: Inappropriate [OE-specific: used to generate perl-rdepends.txt]
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ template/bin/perl.req | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/template/bin/perl.req b/template/bin/perl.req
+index eeed626..20f8c19 100755
+--- a/template/bin/perl.req
++++ b/template/bin/perl.req
+@@ -280,9 +280,10 @@ sub process_file {
+ # we only consider require statements that are flushed against
+ # the left edge. any other require statements give too many
+ # false positives, as they are usually inside of an if statement
+- # as a fallback module or a rarely used option
++ # as a fallback module or a rarely used option. Setting
++ # PERL_REQ_INDENTED_REQUIRE reports them anyway (for lazy loads).
+
+- ($whitespace ne "" && $statement eq "require") && next;
++ ($whitespace ne "" && $statement eq "require" && !$ENV{PERL_REQ_INDENTED_REQUIRE}) && next;
+
+ # if there is some interpolation of variables just skip this
+ # dependency, we do not want
rpm 4.20 dropped its perl.prov/perl.req generators, so pkgdata lost the perl(Module::Name) FILERPROVIDES mapping Perl modules to packages. Add Fedora's generators, which now maintain those scripts, to restore them. Only provides are enabled, as before rpm 4.20: generated requires include optional dependencies which package_rpm would turn into hard Requires. perl.req is still installed for later dependency checking, patched to work without Fedora::VSP and to optionally report indented "require" statements (PERL_REQ_INDENTED_REQUIRE), which in perl itself are mostly lazy loads. The scripts run with the host perl. AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- meta/conf/distro/include/maintainers.inc | 1 + .../rpm/perl-generators-native_1.16.bb | 38 +++++++++++++++++ ...01-perl.req-make-Fedora-VSP-optional.patch | 42 +++++++++++++++++++ ...q-optionally-report-indented-require.patch | 34 +++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 meta/recipes-devtools/rpm/perl-generators-native_1.16.bb create mode 100644 meta/recipes-devtools/rpm/perl-generators/0001-perl.req-make-Fedora-VSP-optional.patch create mode 100644 meta/recipes-devtools/rpm/perl-generators/0002-perl.req-optionally-report-indented-require.patch