summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-10-26 05:38:32 +0000
committerCoprDistGit <infra@openeuler.org>2024-10-26 05:38:32 +0000
commit490d9f3217eb4c04a834d073e479765496ee90a9 (patch)
tree0b68b2139750553856dd9a42cd8a614b6d6ff493
parent14b6cc6f2f3174b885ea1a6f97c55dd0d0d86f79 (diff)
automatic import of perlopeneuler24.03_LTS
-rw-r--r--.gitignore1
-rw-r--r--backport-CVE-2023-47039.patch196
-rw-r--r--backport-CVE-2023-47100-CVE-2023-47038.patch123
-rw-r--r--backport-aarch64-ilp32-support.patch45
-rw-r--r--change-lib-to-lib64.patch60
-rw-r--r--disable-rpath-by-default.patch26
-rw-r--r--perl-5.16.3-create_libperl_soname.patch57
-rw-r--r--perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch61
-rw-r--r--perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch110
-rw-r--r--perl-5.34.0-Destroy-GDBM-NDBM-ODBM-SDBM-_File-objects-only-from-.patch234
-rw-r--r--perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM.patch92
-rw-r--r--perl.spec682
-rw-r--r--sources1
13 files changed, 1688 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..80a9225 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/perl-5.38.0.tar.xz
diff --git a/backport-CVE-2023-47039.patch b/backport-CVE-2023-47039.patch
new file mode 100644
index 0000000..66bf8b4
--- /dev/null
+++ b/backport-CVE-2023-47039.patch
@@ -0,0 +1,196 @@
+From 906e92715f4ee68ea95086867f4f97b1f4f10ac3 Mon Sep 17 00:00:00 2001
+From: Tony Cook <tony@develop-help.com>
+Date: Tue, 3 Oct 2023 09:40:07 +1100
+Subject: [PATCH] win32: default the shell to cmd.exe in the Windows system
+ directory
+
+This prevents picking up cmd.exe from the current directory, or
+even from the PATH.
+
+This protects against a privilege escalation attack where an attacker
+in a separate session creates a cmd.exe in a directory where the
+target account happens to have its current directory.
+---
+ t/win32/system.t | 30 ++++++++++++--------
+ win32/win32.c | 71 +++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 79 insertions(+), 22 deletions(-)
+
+diff --git a/t/win32/system.t b/t/win32/system.t
+index 939a02db55..c885059012 100644
+--- a/t/win32/system.t
++++ b/t/win32/system.t
+@@ -82,6 +82,7 @@ close $F;
+ chdir($testdir);
+ END {
+ chdir($cwd) && rmtree("$cwd/$testdir") if -d "$cwd/$testdir";
++ unlink "cmd.exe";
+ }
+ if (open(my $EIN, "$cwd/win32/${exename}_exe.uu")) {
+ note "Unpacking $exename.exe";
+@@ -104,21 +105,20 @@ else {
+ }
+ note "Compiling $exename.c";
+ note "$Config{cc} $Config{ccflags} $exename.c";
+- if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") != 0) {
++ if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") != 0 ||
++ !-f "$exename.exe") {
+ note "Could not compile $exename.c, status $?";
+- note "Where is your C compiler?";
+- skip_all "can't build test executable";
+- }
+- unless (-f "$exename.exe") {
+- if (open(LOG,'<log'))
+- {
+- while(<LOG>) {
+- note $_;
+- }
+- }
++ note "Where is your C compiler?";
++ if (open(LOG,'<log'))
++ {
++ while(<LOG>) {
++ note $_;
++ }
++ }
+ else {
+- warn "Cannot open log (in $testdir):$!";
++ warn "Cannot open log (in $testdir):$!";
+ }
++ skip_all "can't build test executable";
+ }
+ }
+ copy("$plxname.bat","$plxname.cmd");
+@@ -128,6 +128,12 @@ unless (-x "$testdir/$exename.exe") {
+ skip_all "can't build test executable";
+ }
+
++# test we only look for cmd.exe in the standard place
++delete $ENV{PERLSHELL};
++copy("$testdir/$exename.exe", "$testdir/cmd.exe") or die $!;
++copy("$testdir/$exename.exe", "cmd.exe") or die $!;
++$ENV{PATH} = qq("$testdir";$ENV{PATH});
++
+ open my $T, "$^X -I../lib -w win32/system_tests |"
+ or die "Can't spawn win32/system_tests: $!";
+ my $expect;
+diff --git a/win32/win32.c b/win32/win32.c
+index 94248ca168..5d54cf8d4a 100644
+--- a/win32/win32.c
++++ b/win32/win32.c
+@@ -117,7 +117,7 @@ static char* win32_get_xlib(const char *pl,
+
+ static BOOL has_shell_metachars(const char *ptr);
+ static long tokenize(const char *str, char **dest, char ***destv);
+-static void get_shell(void);
++static int get_shell(void);
+ static char* find_next_space(const char *s);
+ static int do_spawn2(pTHX_ const char *cmd, int exectype);
+ static int do_spawn2_handles(pTHX_ const char *cmd, int exectype,
+@@ -600,7 +600,13 @@ tokenize(const char *str, char **dest, char ***destv)
+ return items;
+ }
+
+-static void
++static const char
++cmd_opts[] = "/x/d/c";
++
++static const char
++shell_cmd[] = "cmd.exe";
++
++static int
+ get_shell(void)
+ {
+ dTHX;
+@@ -612,12 +618,53 @@ get_shell(void)
+ * interactive use (which is what most programs look in COMSPEC
+ * for).
+ */
+- const char* defaultshell = "cmd.exe /x/d/c";
+- const char *usershell = PerlEnv_getenv("PERL5SHELL");
+- w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
+- &w32_perlshell_tokens,
+- &w32_perlshell_vec);
++ const char *shell = PerlEnv_getenv("PERL5SHELL");
++ if (shell) {
++ w32_perlshell_items = tokenize(shell,
++ &w32_perlshell_tokens,
++ &w32_perlshell_vec);
++ }
++ else {
++ /* tokenize does some Unix-ish like things like
++ \\ escaping that don't work well here
++ */
++ char shellbuf[MAX_PATH];
++ UINT len = GetSystemDirectoryA(shellbuf, sizeof(shellbuf));
++ if (len == 0) {
++ translate_to_errno();
++ return -1;
++ }
++ else if (len >= MAX_PATH) {
++ /* buffer too small */
++ errno = E2BIG;
++ return -1;
++ }
++ if (shellbuf[len-1] != '\\') {
++ my_strlcat(shellbuf, "\\", sizeof(shellbuf));
++ ++len;
++ }
++ if (len + sizeof(shell_cmd) > sizeof(shellbuf)) {
++ errno = E2BIG;
++ return -1;
++ }
++ my_strlcat(shellbuf, shell_cmd, sizeof(shellbuf));
++ len += sizeof(shell_cmd)-1;
++
++ Newx(w32_perlshell_vec, 3, char *);
++ Newx(w32_perlshell_tokens, len + 1 + sizeof(cmd_opts), char);
++
++ my_strlcpy(w32_perlshell_tokens, shellbuf, len+1);
++ my_strlcpy(w32_perlshell_tokens + len +1, cmd_opts,
++ sizeof(cmd_opts));
++
++ w32_perlshell_vec[0] = w32_perlshell_tokens;
++ w32_perlshell_vec[1] = w32_perlshell_tokens + len + 1;
++ w32_perlshell_vec[2] = NULL;
++
++ w32_perlshell_items = 2;
++ }
+ }
++ return 0;
+ }
+
+ int
+@@ -635,7 +682,9 @@ Perl_do_aspawn(pTHX_ SV *really, SV **mark, SV **sp)
+ if (sp <= mark)
+ return -1;
+
+- get_shell();
++ if (get_shell() < 0)
++ return -1;
++
+ Newx(argv, (sp - mark) + w32_perlshell_items + 2, const char*);
+
+ if (SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
+@@ -765,7 +814,8 @@ do_spawn2_handles(pTHX_ const char *cmd, int exectype, const int *handles)
+ if (needToTry) {
+ char **argv;
+ int i = -1;
+- get_shell();
++ if (get_shell() < 0)
++ return -1;
+ Newx(argv, w32_perlshell_items + 2, char*);
+ while (++i < w32_perlshell_items)
+ argv[i] = w32_perlshell_vec[i];
+@@ -3482,7 +3532,8 @@ win32_pipe(int *pfd, unsigned int size, int mode)
+ DllExport PerlIO*
+ win32_popenlist(const char *mode, IV narg, SV **args)
+ {
+- get_shell();
++ if (get_shell() < 0)
++ return NULL;
+
+ return do_popen(mode, NULL, narg, args);
+ }
+--
+2.33.0
+
diff --git a/backport-CVE-2023-47100-CVE-2023-47038.patch b/backport-CVE-2023-47100-CVE-2023-47038.patch
new file mode 100644
index 0000000..662020e
--- /dev/null
+++ b/backport-CVE-2023-47100-CVE-2023-47038.patch
@@ -0,0 +1,123 @@
+From 92a9eb3d0d52ec7655c1beb29999a5a5219be664 Mon Sep 17 00:00:00 2001
+From: Karl Williamson <khw@cpan.org>
+Date: Sat, 9 Sep 2023 11:59:09 -0600
+Subject: [PATCH] Fix read/write past buffer end: perl-security#140
+
+A package name may be specified in a \p{...} regular expression
+construct. If unspecified, "utf8::" is assumed, which is the package
+all official Unicode properties are in. By specifying a different
+package, one can create a user-defined property with the same
+unqualified name as a Unicode one. Such a property is defined by a sub
+whose name begins with "Is" or "In", and if the sub wishes to refer to
+an official Unicode property, it must explicitly specify the "utf8::".
+S_parse_uniprop_string() is used to parse the interior of both \p{} and
+the user-defined sub lines.
+
+In S_parse_uniprop_string(), it parses the input "name" parameter,
+creating a modified copy, "lookup_name", malloc'ed with the same size as
+"name". The modifications are essentially to create a canonicalized
+version of the input, with such things as extraneous white-space
+stripped off. I found it convenient to strip off the package specifier
+"utf8::". To to so, the code simply pretends "lookup_name" begins just
+after the "utf8::", and adjusts various other values to compensate.
+However, it missed the adjustment of one required one.
+
+This is only a problem when the property name begins with "perl" and
+isn't "perlspace" nor "perlword". All such ones are undocumented
+internal properties.
+
+What happens in this case is that the input is reparsed with slightly
+different rules in effect as to what is legal versus illegal. The
+problem is that "lookup_name" no longer is pointing to its initial
+value, but "name" is. Thus the space allocated for filling "lookup_name"
+is now shorter than "name", and as this shortened "lookup_name" is
+filled by copying suitable portions of "name", the write can be to
+unallocated space.
+
+The solution is to skip the "utf8::" when reparsing "name". Then both
+"lookup_name" and "name" are effectively shortened by the same amount,
+and there is no going off the end.
+
+This commit also does white-space adjustment so that things align
+vertically for readability.
+
+This can be easily backported to earlier Perl releases.
+
+Reference:https://github.com/Perl/perl5/commit/92a9eb3d0d52ec7655c1beb29999a5a5219be664
+Conflict:NA
+
+---
+ regcomp.c | 17 +++++++++++------
+ t/re/pat_advanced.t | 8 ++++++++
+ 2 files changed, 19 insertions(+), 6 deletions(-)
+
+diff --git a/regcomp.c b/regcomp.c
+index d3c135f..67aa03e 100644
+--- a/regcomp.c
++++ b/regcomp.c
+@@ -14450,7 +14450,7 @@ S_parse_uniprop_string(pTHX_
+ * compile perl to know about them) */
+ bool is_nv_type = FALSE;
+
+- unsigned int i, j = 0;
++ unsigned int i = 0, i_zero = 0, j = 0;
+ int equals_pos = -1; /* Where the '=' is found, or negative if none */
+ int slash_pos = -1; /* Where the '/' is found, or negative if none */
+ int table_index = 0; /* The entry number for this property in the table
+@@ -14582,9 +14582,13 @@ S_parse_uniprop_string(pTHX_
+ * all of them are considered to be for that package. For the purposes of
+ * parsing the rest of the property, strip it off */
+ if (non_pkg_begin == STRLENs("utf8::") && memBEGINPs(name, name_len, "utf8::")) {
+- lookup_name += STRLENs("utf8::");
+- j -= STRLENs("utf8::");
+- equals_pos -= STRLENs("utf8::");
++ lookup_name += STRLENs("utf8::");
++ j -= STRLENs("utf8::");
++ equals_pos -= STRLENs("utf8::");
++ i_zero = STRLENs("utf8::"); /* When resetting 'i' to reparse
++ from the beginning, it has to be
++ set past what we're stripping
++ off */
+ stripped_utf8_pkg = TRUE;
+ }
+
+@@ -14998,7 +15002,8 @@ S_parse_uniprop_string(pTHX_
+
+ /* We set the inputs back to 0 and the code below will reparse,
+ * using strict */
+- i = j = 0;
++ i = i_zero;
++ j = 0;
+ }
+ }
+
+@@ -15019,7 +15024,7 @@ S_parse_uniprop_string(pTHX_
+ * separates two digits */
+ if (cur == '_') {
+ if ( stricter
+- && ( i == 0 || (int) i == equals_pos || i == name_len- 1
++ && ( i == i_zero || (int) i == equals_pos || i == name_len- 1
+ || ! isDIGIT_A(name[i-1]) || ! isDIGIT_A(name[i+1])))
+ {
+ lookup_name[j++] = '_';
+diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
+index d64bd1b..e0266c0 100644
+--- a/t/re/pat_advanced.t
++++ b/t/re/pat_advanced.t
+@@ -2695,6 +2695,14 @@ EOF_DEBUG_OUT
+ "Related to Github Issue #19350, forward \\g{x} pattern segv under use re Debug => 'PARSE'");
+ }
+
++ { # perl-security#140, read/write past buffer end
++ fresh_perl_like('qr/\p{utf8::perl x}/',
++ qr/Illegal user-defined property name "utf8::perl x" in regex/,
++ {}, "perl-security#140");
++ fresh_perl_is('qr/\p{utf8::_perl_surrogate}/', "",
++ {}, "perl-security#140");
++ }
++
+ { # GH 20009
+ my $x = "awesome quotes";
+ utf8::upgrade($x);
+--
+2.33.0
diff --git a/backport-aarch64-ilp32-support.patch b/backport-aarch64-ilp32-support.patch
new file mode 100644
index 0000000..4e14c91
--- /dev/null
+++ b/backport-aarch64-ilp32-support.patch
@@ -0,0 +1,45 @@
+From 55a0aab68d5ce90ce8bb7442ba61639c49e50c1d Mon Sep 17 00:00:00 2001
+From: root <root@localhost.localdomain>
+Date: Mon, 21 Sep 2020 09:45:33 +0800
+Subject: [PATCH] aarch64 ilp32 support
+
+Conflict:NA
+Reference:https://build.opensuse.org/package/view_file/devel:ARM:Factory:Contrib:ILP32/perl/aarch64-ilp32.patch?expand=1
+
+---
+ hints/linux.sh | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/hints/linux.sh b/hints/linux.sh
+index c749f0f..27322dc 100644
+--- a/hints/linux.sh
++++ b/hints/linux.sh
+@@ -311,6 +311,25 @@ sparc*)
+ ;;
+ esac
+
++case $archname in
++aarch64-linux)
++ cat >try.c <<'EOM'
++/* Test for ILP32 */
++#include <stdlib.h>
++main() {
++ int ilp32 = 0;
++ #ifdef __ILP32__
++ ilp32 = 1;
++ #endif
++ exit(!ilp32);
++}
++EOM
++ if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
++ archname=aarch64-ilp32-linux
++ fi
++ ;;
++esac
++
+ # SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than
+ # true libraries. The scripts cause binding against static
+ # version of -lgdbm which is a bad idea. So if we have 'nm'
+--
+2.27.0
+
diff --git a/change-lib-to-lib64.patch b/change-lib-to-lib64.patch
new file mode 100644
index 0000000..22f3851
--- /dev/null
+++ b/change-lib-to-lib64.patch
@@ -0,0 +1,60 @@
+From 49abb326542984cecc5e61b3b66822b52cdc34e7 Mon Sep 17 00:00:00 2001
+From: openEuler Buildteam <buildteam@openeuler.org>
+Date: Mon, 30 Dec 2019 14:49:06 +0800
+Subject: [PATCH] change lib to lib64
+
+---
+ Configure | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/Configure b/Configure
+index cc74bdc..0e7441d 100755
+--- a/Configure
++++ b/Configure
+@@ -7229,8 +7229,8 @@ esac'
+ : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
+ case "$installstyle" in
+ '') case "$prefix" in
+- *perl*) dflt='lib';;
+- *) dflt='lib/perl5' ;;
++ *perl*) dflt='lib64';;
++ *) dflt='lib64/perl5' ;;
+ esac
+ ;;
+ *) dflt="$installstyle" ;;
+@@ -7296,8 +7296,8 @@ esac
+ : /opt/perl/lib/perl5... would be redundant.
+ : The default "style" setting is made in installstyle.U
+ case "$installstyle" in
+-*lib/perl5*) set dflt privlib lib/$package/$version ;;
+-*) set dflt privlib lib/$version ;;
++*lib64/perl5*) set dflt privlib lib64/$package/$version ;;
++*) set dflt privlib lib64/$version ;;
+ esac
+ eval $prefixit
+ $cat <<EOM
+@@ -7544,8 +7544,8 @@ siteprefixexp="$ansexp"
+ prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+ case "$sitelib" in
+ '') case "$installstyle" in
+- *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
+- *) dflt=$siteprefix/lib/site_$prog/$version ;;
++ *lib64/perl5*) dflt=$siteprefix/lib64/$package/site_$prog/$version ;;
++ *) dflt=$siteprefix/lib64/site_$prog/$version ;;
+ esac
+ ;;
+ *) dflt="$sitelib"
+@@ -7963,8 +7963,8 @@ case "$vendorprefix" in
+ '')
+ prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+ case "$installstyle" in
+- *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
+- *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
++ *lib64/perl5*) dflt=$vendorprefix/lib64/$package/vendor_$prog/$version ;;
++ *) dflt=$vendorprefix/lib64/vendor_$prog/$version ;;
+ esac
+ ;;
+ *) dflt="$vendorlib"
+--
+2.27.0
+
diff --git a/disable-rpath-by-default.patch b/disable-rpath-by-default.patch
new file mode 100644
index 0000000..e606a9a
--- /dev/null
+++ b/disable-rpath-by-default.patch
@@ -0,0 +1,26 @@
+From 3a98cffd49b91e1b26846bb9a06446353a217b57 Mon Sep 17 00:00:00 2001
+From: openEuler Buildteam <buildteam@openeuler.org>
+Date: Mon, 30 Dec 2019 14:57:15 +0800
+Subject: [PATCH] disable rpath by default
+
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 977b50e..ac5cdb5 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -1077,9 +1077,6 @@ sub xs_make_dynamic_lib {
+ }
+
+ my $ld_run_path_shell = "";
+- if ($self->{LD_RUN_PATH} ne "") {
+- $ld_run_path_shell = 'LD_RUN_PATH="$(LD_RUN_PATH)" ';
+- }
+
+ push @m, sprintf <<'MAKE', $ld_run_path_shell, $ldrun, $dlsyms_arg, $ldfrom, $self->xs_obj_opt('$@'), $libs, $exportlist;
+ %s$(LD) %s $(LDDLFLAGS) %s %s $(OTHERLDFLAGS) %s $(MYEXTLIB) \
+--
+2.27.0
+
diff --git a/perl-5.16.3-create_libperl_soname.patch b/perl-5.16.3-create_libperl_soname.patch
new file mode 100644
index 0000000..b6e271b
--- /dev/null
+++ b/perl-5.16.3-create_libperl_soname.patch
@@ -0,0 +1,57 @@
+From fa2f0dd5a7767223df10149d3f16d7ed7013e16f Mon Sep 17 00:00:00 2001
+From: Torsten Veller <tove@gentoo.org>
+Date: Sat, 14 Apr 2012 13:49:18 +0200
+Subject: Set libperl soname
+
+Bug-Gentoo: https://bugs.gentoo.org/286840
+
+Patch-Name: gentoo/create_libperl_soname.diff
+---
+ Makefile.SH | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.SH b/Makefile.SH
+index d1da0a0..7733a32 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -64,11 +64,11 @@ true)
+ ${revision}.${patchlevel}.${subversion}"
+ case "$osvers" in
+ 1[5-9]*|[2-9]*)
+- shrpldflags="$shrpldflags -install_name `pwd`/\$@ -Xlinker -headerpad_max_install_names"
++ shrpldflags="$shrpldflags -install_name `pwd`/libperl.${revision}.${patchlevel}.dylib -Xlinker -headerpad_max_install_names"
+ exeldflags="-Xlinker -headerpad_max_install_names"
+ ;;
+ *)
+- shrpldflags="$shrpldflags -install_name \$(shrpdir)/\$@"
++ shrpldflags="$shrpldflags -install_name \$(shrpdir)/libperl.${revision}.${patchlevel}.dylib"
+ ;;
+ esac
+ ;;
+@@ -78,13 +78,15 @@ true)
+ ;;
+ sunos*)
+ linklibperl="-lperl"
++ shrpldflags="$shrpldflags -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
+ ;;
+ netbsd*|freebsd[234]*|openbsd*|dragonfly*|bitrig*)
+ linklibperl="-L. -lperl"
++ shrpldflags="$shrpldflags -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
+ ;;
+ interix*)
+ linklibperl="-L. -lperl"
+- shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
++ shrpldflags="$shrpldflags -Wl,--image-base,0x57000000 -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
+ ;;
+ aix*)
+ case "$cc" in
+@@ -127,6 +129,9 @@ true)
+ ;;
+ esac
+ ;;
++ linux*)
++ shrpldflags="$shrpldflags -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
++ ;;
+ esac
+ case "$ldlibpthname" in
+ '') ;;
diff --git a/perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch b/perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch
new file mode 100644
index 0000000..49de388
--- /dev/null
+++ b/perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch
@@ -0,0 +1,61 @@
+From 9644657c4 10326749fd321d9c24944ec25afad2f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Thu, 20 Jun 2013 15:22:53 +0200
+Subject: [PATCH] Install libperl.so to shrpdir on Linux
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Configure | 7 ++++---
+ Makefile.SH | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/Configure b/Configure
+index 2f30261..825496e 100755
+--- a/Configure
++++ b/Configure
+@@ -8762,7 +8762,9 @@ esac
+
+ # Detect old use of shrpdir via undocumented Configure -Dshrpdir
+ case "$shrpdir" in
+-'') ;;
++'')
++shrpdir=$archlibexp/CORE
++;;
+ *) $cat >&4 <<EOM
+ WARNING: Use of the shrpdir variable for the installation location of
+ the shared $libperl is not supported. It was never documented and
+@@ -8792,7 +8794,6 @@ esac
+ # Add $xxx to ccdlflags.
+ # If we can't figure out a command-line option, use $shrpenv to
+ # set env LD_RUN_PATH. The main perl makefile uses this.
+-shrpdir=$archlibexp/CORE
+ xxx=''
+ tmp_shrpenv=''
+ if "$useshrplib"; then
+@@ -8807,7 +8808,7 @@ if "$useshrplib"; then
+ xxx="-Wl,-R$shrpdir"
+ ;;
+ bsdos|linux|irix*|dec_osf|gnu*|haiku)
+- xxx="-Wl,-rpath,$shrpdir"
++ # We want standard path
+ ;;
+ hpux*)
+ # hpux doesn't like the default, either.
+diff --git a/Makefile.SH b/Makefile.SH
+index 7733a32..a481183 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -288,7 +288,7 @@ ranlib = $ranlib
+ # installman commandline.
+ bin = $installbin
+ scriptdir = $scriptdir
+-shrpdir = $archlibexp/CORE
++shrpdir = $shrpdir
+ privlib = $installprivlib
+ man1dir = $man1dir
+ man1ext = $man1ext
+--
+1.8.1.4
diff --git a/perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch b/perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
new file mode 100644
index 0000000..0bc383f
--- /dev/null
+++ b/perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
@@ -0,0 +1,110 @@
+From 9575301256f67116eccdbb99b38fc804ba3dcf53 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Mon, 18 Apr 2016 16:24:03 +0200
+Subject: [PATCH] Provide ExtUtils::MM methods as standalone
+ ExtUtils::MM::Utils
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If you cannot afford depending on ExtUtils::MakeMaker, you can
+depend on ExtUtils::MM::Utils instead.
+
+<https://bugzilla.redhat.com/show_bug.cgi?id=1129443>
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ MANIFEST | 1 +
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm | 68 ++++++++++++++++++++++++
+ 2 files changed, 69 insertions(+)
+ create mode 100644 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
+
+diff --git a/MANIFEST b/MANIFEST
+index 6af238c..d4f0c56 100644
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -1037,6 +1037,7 @@ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS390.pm
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS390.pm MakeMaker methods for OS 390
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm MakeMaker methods for QNX
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm MakeMaker methods for Unix
++cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm Independed MM methods
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm MakeMaker methods for U/WIN
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm MakeMaker methods for VMS
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm MakeMaker methods for VOS
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
+new file mode 100644
+index 0000000..6bbc0d8
+--- /dev/null
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
+@@ -0,0 +1,68 @@
++package ExtUtils::MM::Utils;
++
++require 5.006;
++
++use strict;
++use vars qw($VERSION);
++$VERSION = '7.11_06';
++$VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval]
++
++=head1 NAME
++
++ExtUtils::MM::Utils - ExtUtils::MM methods without dependency on ExtUtils::MakeMaker
++
++=head1 SYNOPSIS
++
++ require ExtUtils::MM::Utils;
++ MM->maybe_command($file);
++
++=head1 DESCRIPTION
++
++This is a collection of L<ExtUtils::MM> subroutines that are used by many
++other modules but that do not need full-featured L<ExtUtils::MakeMaker>. The
++issue with L<ExtUtils::MakeMaker> is it pulls in Perl header files and that is
++an overkill for small subroutines.
++
++An example is the L<IPC::Cmd> that caused installing GCC just because of
++three-line I<maybe_command()> from L<ExtUtils::MM_Unix>.
++
++The intentions is to use L<ExtUtils::MM::Utils> instead of
++L<ExtUtils::MakeMaker> for these trivial methods. You can still call them via
++L<MM> class name.
++
++=head1 METHODS
++
++=over 4
++
++=item maybe_command
++
++Returns true, if the argument is likely to be a command.
++
++=cut
++
++if (!exists $INC{'ExtUtils/MM.pm'}) {
++ *MM::maybe_command = *ExtUtils::MM::maybe_command = \&maybe_command;
++}
++
++sub maybe_command {
++ my($self,$file) = @_;
++ return $file if -x $file && ! -d $file;
++ return;
++}
++
++1;
++
++=back
++
++=head1 BUGS
++
++These methods are copied from L<ExtUtils::MM_Unix>. Other operating systems
++are not supported yet. The reason is this
++L<a hack for Linux
++distributions|https://bugzilla.redhat.com/show_bug.cgi?id=1129443>.
++
++=head1 SEE ALSO
++
++L<ExtUtils::MakeMaker>, L<ExtUtils::MM>
++
++=cut
+--
+2.5.5
+
diff --git a/perl-5.34.0-Destroy-GDBM-NDBM-ODBM-SDBM-_File-objects-only-from-.patch b/perl-5.34.0-Destroy-GDBM-NDBM-ODBM-SDBM-_File-objects-only-from-.patch
new file mode 100644
index 0000000..c98a94c
--- /dev/null
+++ b/perl-5.34.0-Destroy-GDBM-NDBM-ODBM-SDBM-_File-objects-only-from-.patch
@@ -0,0 +1,234 @@
+From 8067179e65a28d91f00df7d36778229a07514471 Mon Sep 17 00:00:00 2001
+From: Jitka Plesnikova <jplesnik@redhat.com>
+Date: Thu, 29 Apr 2021 12:21:18 +0200
+Subject: [PATCH] Destroy {GDBM,NDBM,ODBM,SDBM}_File objects only from original
+
+This patch fixes a crash when destroing a hash tied to a *_File
+database after spawning a thread:
+
+use Fcntl;
+use SDBM_File;
+use threads;
+tie(my %dbtest, 'SDBM_File', "test.db", O_RDWR|O_CREAT, 0666);
+threads->new(sub {})->join;
+
+This crashed or paniced depending on how perl was configured.
+
+Closes RT#61912.
+
+Updated original ppisar's patch for perl 5.18.2
+---
+ ext/GDBM_File/GDBM_File.xs | 20 ++++++++++++--------
+ ext/NDBM_File/NDBM_File.xs | 16 ++++++++++------
+ ext/ODBM_File/ODBM_File.xs | 18 +++++++++++-------
+ ext/SDBM_File/SDBM_File.xs | 4 +++-
+ t/lib/dbmt_common.pl | 35 +++++++++++++++++++++++++++++++++++
+ 5 files changed, 71 insertions(+), 22 deletions(-)
+
+diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs
+index cd0bb6f..0c395ac 100644
+--- a/ext/GDBM_File/GDBM_File.xs
++++ b/ext/GDBM_File/GDBM_File.xs
+@@ -13,6 +13,7 @@
+ #define store_value 3
+
+ typedef struct {
++ tTHX owner;
+ GDBM_FILE dbp ;
+ SV * filter[4];
+ int filtering ;
+@@ -276,6 +277,7 @@ gdbm_TIEHASH(dbtype, name, read_write, mode)
+ }
+ if (dbp) {
+ RETVAL = (GDBM_File)safecalloc(1, sizeof(GDBM_File_type));
++ RETVAL->owner = aTHX;
+ RETVAL->dbp = dbp;
+ } else {
+ RETVAL = NULL;
+@@ -289,15 +291,17 @@ gdbm_DESTROY(db)
+ PREINIT:
+ int i = store_value;
+ CODE:
+- if (gdbm_file_close(db)) {
+- croak("gdbm_close: %s; %s", gdbm_strerror(gdbm_errno),
+- strerror(errno));
++ if (db && db->owner == aTHX) {
++ if (gdbm_file_close(db)) {
++ croak("gdbm_close: %s; %s", gdbm_strerror(gdbm_errno),
++ strerror(errno));
++ }
++ do {
++ if (db->filter[i])
++ SvREFCNT_dec(db->filter[i]);
++ } while (i-- > 0);
++ safefree(db);
+ }
+- do {
+- if (db->filter[i])
+- SvREFCNT_dec(db->filter[i]);
+- } while (i-- > 0);
+- safefree(db);
+
+ void
+ gdbm_UNTIE(db, count)
+diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs
+index eed671a..651fe0f 100644
+--- a/ext/NDBM_File/NDBM_File.xs
++++ b/ext/NDBM_File/NDBM_File.xs
+@@ -33,6 +33,7 @@ END_EXTERN_C
+ #define store_value 3
+
+ typedef struct {
++ tTHX owner;
+ DBM * dbp ;
+ SV * filter[4];
+ int filtering ;
+@@ -71,6 +72,7 @@ ndbm_TIEHASH(dbtype, filename, flags, mode)
+ RETVAL = NULL ;
+ if ((dbp = dbm_open(filename, flags, mode))) {
+ RETVAL = (NDBM_File)safecalloc(1, sizeof(NDBM_File_type));
++ RETVAL->owner = aTHX;
+ RETVAL->dbp = dbp ;
+ }
+
+@@ -84,12 +86,14 @@ ndbm_DESTROY(db)
+ PREINIT:
+ int i = store_value;
+ CODE:
+- dbm_close(db->dbp);
+- do {
+- if (db->filter[i])
+- SvREFCNT_dec(db->filter[i]);
+- } while (i-- > 0);
+- safefree(db);
++ if (db && db->owner == aTHX) {
++ dbm_close(db->dbp);
++ do {
++ if (db->filter[i])
++ SvREFCNT_dec(db->filter[i]);
++ } while (i-- > 0);
++ safefree(db);
++ }
+
+ #define ndbm_FETCH(db,key) dbm_fetch(db->dbp,key)
+ datum_value
+diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
+index 38e6dbf..4b15a42 100644
+--- a/ext/ODBM_File/ODBM_File.xs
++++ b/ext/ODBM_File/ODBM_File.xs
+@@ -49,6 +49,7 @@ datum nextkey(datum key);
+ #define store_value 3
+
+ typedef struct {
++ tTHX owner;
+ void * dbp ;
+ SV * filter[4];
+ int filtering ;
+@@ -137,6 +138,7 @@ odbm_TIEHASH(dbtype, filename, flags, mode)
+ }
+ dbp = (void*)(dbminit(filename) >= 0 ? &dbmrefcnt : 0);
+ RETVAL = (ODBM_File)safecalloc(1, sizeof(ODBM_File_type));
++ RETVAL->owner = aTHX;
+ RETVAL->dbp = dbp ;
+ }
+ OUTPUT:
+@@ -149,13 +151,15 @@ DESTROY(db)
+ dMY_CXT;
+ int i = store_value;
+ CODE:
+- dbmrefcnt--;
+- dbmclose();
+- do {
+- if (db->filter[i])
+- SvREFCNT_dec(db->filter[i]);
+- } while (i-- > 0);
+- safefree(db);
++ if (db && db->owner == aTHX) {
++ dbmrefcnt--;
++ dbmclose();
++ do {
++ if (db->filter[i])
++ SvREFCNT_dec(db->filter[i]);
++ } while (i-- > 0);
++ safefree(db);
++ }
+
+ datum_value
+ odbm_FETCH(db, key)
+diff --git a/ext/SDBM_File/SDBM_File.xs b/ext/SDBM_File/SDBM_File.xs
+index 0df2855..0e2bd58 100644
+--- a/ext/SDBM_File/SDBM_File.xs
++++ b/ext/SDBM_File/SDBM_File.xs
+@@ -10,6 +10,7 @@
+ #define store_value 3
+
+ typedef struct {
++ tTHX owner;
+ DBM * dbp ;
+ SV * filter[4];
+ int filtering ;
+@@ -51,6 +52,7 @@ sdbm_TIEHASH(dbtype, filename, flags, mode, pagname=NULL)
+ }
+ if (dbp) {
+ RETVAL = (SDBM_File)safecalloc(1, sizeof(SDBM_File_type));
++ RETVAL->owner = aTHX;
+ RETVAL->dbp = dbp ;
+ }
+
+@@ -62,7 +64,7 @@ void
+ sdbm_DESTROY(db)
+ SDBM_File db
+ CODE:
+- if (db) {
++ if (db && db->owner == aTHX) {
+ int i = store_value;
+ sdbm_close(db->dbp);
+ do {
+diff --git a/t/lib/dbmt_common.pl b/t/lib/dbmt_common.pl
+index 60c66ae..a7f81fe 100644
+--- a/t/lib/dbmt_common.pl
++++ b/t/lib/dbmt_common.pl
+@@ -510,5 +510,40 @@ unlink <Op_dbmx*>, $Dfile;
+ unlink <Op1_dbmx*>;
+ }
+
++{
++ # Check DBM back-ends do not destroy objects from then-spawned threads.
++ # RT#61912.
++ SKIP: {
++ my $threads_count = 2;
++ skip 'Threads are disabled', 3 + 2 * $threads_count
++ unless $Config{usethreads};
++ use_ok('threads');
++
++ my %h;
++ unlink <Op1_dbmx*>;
++
++ my $db = tie %h, $DBM_Class, 'Op1_dbmx', $create, 0640;
++ isa_ok($db, $DBM_Class);
++
++ for (1 .. 2) {
++ ok(threads->create(
++ sub {
++ $SIG{'__WARN__'} = sub { fail(shift) }; # debugging perl panics
++ # report it by spurious TAP line
++ 1;
++ }), "Thread $_ created");
++ }
++ for (threads->list) {
++ is($_->join, 1, "A thread exited successfully");
++ }
++
++ pass("Tied object survived exiting threads");
++
++ undef $db;
++ untie %h;
++ unlink <Op1_dbmx*>;
++ }
++}
++
+ done_testing();
+ 1;
+--
+2.26.3
+
diff --git a/perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM.patch b/perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM.patch
new file mode 100644
index 0000000..cdc6011
--- /dev/null
+++ b/perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM.patch
@@ -0,0 +1,92 @@
+From fbdb9a76798ae34a7b53f664e77aaaf1f4040f2f Mon Sep 17 00:00:00 2001
+From: zhangzikang <zhangzikang@kylinos.cn>
+Date: Wed, 20 Mar 2024 17:44:51 +0800
+Subject: [PATCH] perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM-on-Linux
+
+---
+ MANIFEST | 1 +
+ .../lib/ExtUtils/MM_Unix.pm | 8 +++++-
+ .../lib/ExtUtils/CBuilder/Platform/linux.pm | 26 +++++++++++++++++++
+ 3 files changed, 34 insertions(+), 1 deletion(-)
+ create mode 100644 dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
+
+diff --git a/MANIFEST b/MANIFEST
+index 6bc115b..0775b2f 100644
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -3855,6 +3855,7 @@ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm CBuilder method
+ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin
+ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin
+ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm CBuilder methods for OSF
++dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm CBuilder methods for Linux
+ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm CBuilder methods for OS/2
+ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm CBuilder methods for Unix
+ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm CBuilder methods for VMS
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 1761380..4e82dda 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -32,6 +32,7 @@ BEGIN {
+ $Is{IRIX} = $^O eq 'irix';
+ $Is{NetBSD} = $^O eq 'netbsd';
+ $Is{Interix} = $^O eq 'interix';
++ $Is{Linux} = $^O eq 'linux';
+ $Is{SunOS4} = $^O eq 'sunos';
+ $Is{Solaris} = $^O eq 'solaris';
+ $Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
+@@ -1074,7 +1075,7 @@ sub xs_make_dynamic_lib {
+ push(@m," \$(RM_F) \$\@\n");
+
+ my $libs = '$(LDLOADLIBS)';
+- if (($Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
++ if (($Is{Linux} || $Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
+ # Use nothing on static perl platforms, and to the flags needed
+ # to link against the shared libperl library on shared perl
+ # platforms. We peek at lddlflags to see if we need -Wl,-R
+@@ -1087,6 +1088,11 @@ sub xs_make_dynamic_lib {
+ # The Android linker will not recognize symbols from
+ # libperl unless the module explicitly depends on it.
+ $libs .= ' "-L$(PERL_INC)" -lperl';
++ } else {
++ if ($ENV{PERL_CORE}) {
++ $libs .= ' "-L$(PERL_INC)"';
++ }
++ $libs .= ' -lperl';
+ }
+ }
+
+diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
+new file mode 100644
+index 0000000..582339b
+--- /dev/null
++++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
+@@ -0,0 +1,26 @@
++package ExtUtils::CBuilder::Platform::linux;
++
++use strict;
++use ExtUtils::CBuilder::Platform::Unix;
++use File::Spec;
++
++use vars qw($VERSION @ISA);
++$VERSION = '0.280230';
++our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
++
++sub link {
++ my ($self, %args) = @_;
++ my $cf = $self->{config};
++
++ # Link XS modules to libperl.so explicitly because multiple
++ # dlopen(, RTLD_LOCAL) hides libperl symbols from XS module.
++ local $cf->{lddlflags} = $cf->{lddlflags};
++ if ($ENV{PERL_CORE}) {
++ $cf->{lddlflags} .= ' -L' . $self->perl_inc();
++ }
++ $cf->{lddlflags} .= ' -lperl';
++
++ return $self->SUPER::link(%args);
++}
++
++1;
+--
+2.33.0
+
diff --git a/perl.spec b/perl.spec
new file mode 100644
index 0000000..fc0066f
--- /dev/null
+++ b/perl.spec
@@ -0,0 +1,682 @@
+%global perl_libdir %{_libdir}/perl5
+%global perl_datadir %{_datadir}/perl5
+%global perl_vendor_libdir %{perl_libdir}/vendor_perl
+%global perl_vendor_datadir %{perl_datadir}/vendor_perl
+%global perl_new LD_PRELOAD="%{buildroot}%{perl_libdir}/CORE/libperl.so" \
+ LD_LIBRARY_PATH="%{buildroot}%{perl_libdir}/CORE" \
+ PERL5LIB="%{buildroot}%{perl_libdir}:%{buildroot}%{perl_datadir}" \
+ %{buildroot}%{_bindir}/%{name}
+
+#remove autofind requires and provides of {_libexecdir}/perl5-tests/
+%global __provides_exclude_from ^%{_libexecdir}/perl5-tests/.*$
+%global __requires_exclude_from ^%{_libexecdir}/perl5-tests/.*$
+
+#provides module without verion, no need to provide
+%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\((charnames|DynaLoader|DB)\\)$
+
+%global perl_version 5.38.0
+
+%global perl_compat perl(:MODULE_COMPAT_5.38.0)
+
+%bcond_without systemtap
+
+Name: perl
+License: (GPL-1.0-or-later or Artistic-1.0-perl) and (GPL-2.0-or-later or Artistic-1.0-perl) and MIT and UCD and Public Domain and BSD
+Epoch: 4
+Version: %{perl_version}
+Release: 9
+Summary: A highly capable, feature-rich programming language
+Url: https://www.perl.org/
+Source0: https://www.cpan.org/src/5.0/%{name}-%{version}.tar.xz
+
+Patch1: perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
+Patch2: perl-5.16.3-create_libperl_soname.patch
+Patch3: perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch
+Patch4: perl-5.34.0-Destroy-GDBM-NDBM-ODBM-SDBM-_File-objects-only-from-.patch
+Patch5: change-lib-to-lib64.patch
+Patch6: disable-rpath-by-default.patch
+Patch7: backport-CVE-2023-47100-CVE-2023-47038.patch
+Patch8: backport-CVE-2023-47039.patch
+Patch9: perl-5.38.0-Link-XS-modules-to-libperl.so-with-EU-MM.patch
+
+Patch6000: backport-aarch64-ilp32-support.patch
+
+BuildRequires: gcc bash findutils coreutils make tar procps bzip2-devel gdbm-devel perl-File-Compare perl-File-Find
+BuildRequires: zlib-devel perl-interpreter perl-generators
+%if %{with systemtap}
+BuildRequires: systemtap-sdt-devel
+%endif
+
+Requires: perl-libs = %{epoch}:%{version}-%{release}
+Requires: perl-version perl-threads perl-threads-shared perl-parent
+Requires: system-rpm-config
+Requires: perl-Unicode-Collate perl-Unicode-Normalize perl-Time-Local perl-Time-HiRes
+Requires: perl-Thread-Queue perl-Text-Tabs+Wrap perl-Test-Simple perl-Test-Harness
+Requires: perl-Text-Balanced perl-Text-ParseWords perl-Term-ANSIColor perl-Term-Cap
+Requires: perl-Socket perl-podlators perl-Scalar-List-Utils perl-perlfaq perl-constant
+Requires: perl-Digest-SHA perl-Digest perl-Digest-MD5 perl-Devel-PPPort perl-Carp perl-Env
+Requires: perl-CPAN-Meta-Requirements perl-CPAN-Meta perl-CPAN-Meta-YAML perl-ExtUtils-Command
+Requires: perl-ExtUtils-Install perl-ExtUtils-Manifest perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS
+Requires: perl-File-Fetch perl-File-Path perl-File-Temp perl-Filter-Simple perl-Filter perl-Encode
+Requires: perl-IO-Compress perl-IO-Socket-IP perl-autodie perl-bignum perl-B-Debug perl-encoding
+Requires: perl-Exporter perl-experimental perl-Compress-Raw-Bzip2 perl-Compress-Raw-Zlib perl-HTTP-Tiny
+Requires: perl-Locale-Codes perl-Locale-Maketext perl-Math-BigInt perl-Math-BigInt-FastCalc perl-Math-BigRat
+Requires: perl-Archive-Tar perl-Config-Perl-V perl-Data-Dumper perl-Getopt-Long perl-libnet
+Requires: perl-IPC-Cmd perl-IPC-SysV perl-JSON-PP perl-MIME-Base64 perl-Params-Check perl-Storable
+Requires: perl-Pod-Checker perl-Pod-Escapes perl-Pod-Parser perl-Pod-Perldoc perl-Pod-Simple perl-Pod-Usage
+Requires: perl-Module-CoreList perl-Module-CoreList-tools perl-Module-Load perl-Module-Load-Conditional
+Requires: perl-Module-Metadata perl-Sys-Syslog perl-PerlIO-via-QuotedPrint perl-Perl-OSType
+
+Provides: perl-Attribute-Handlers perl-interpreter perl(bytes_heavy.pl) perl(dumpvar.pl) perl(perl5db.pl)
+Provides: perl-ExtUtils-Embed perl-ExtUtils-Miniperl perl-IO perl-IO-Zlib perl-Locale-Maketext-Simple perl-Math-Complex
+Provides: perl-Module-Loaded perl-Net-Ping perl-Pod-Html perl-SelfLoader perl-Test perl-Time-Piece perl-libnetcfg perl-open perl-utils
+Provides: perl-Errno perl-Memoize perl-File-Compare perl-File-Find
+
+Obsoletes: perl-Attribute-Handlers perl-interpreter perl-Errno perl-ExtUtils-Embed perl-Net-Ping
+Obsoletes: perl-ExtUtils-Miniperl perl-IO perl-IO-Zlib perl-Locale-Maketext-Simple perl-Math-Complex perl-Memoize perl-Module-Loaded
+Obsoletes: perl-Pod-Html perl-SelfLoader perl-Test perl-Time-Piece perl-libnetcfg perl-open perl-utils perl-File-Compare perl-File-Find
+
+
+%description
+Perl 5 is a highly capable, feature-rich programming language with over 30 years of development.
+Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid
+prototyping and large scale development projects.
+
+%package libs
+Summary: The libraries for the perl
+License: (GPL-1.0-or-later or Artistic-1.0-perl) and MIT and UCD
+Provides: %perl_compat
+Provides: perl(:VERSION) = %{perl_version}
+Provides: perl(:WITH_64BIT) perl(:WITH_ITHREADS) perl(:WITH_THREADS)
+Provides: perl(:WITH_LARGEFILES) perl(:WITH_PERLIO) perl(unicore::Name)
+Provides: perl(utf8_heavy.pl)
+Requires: perl(Carp) perl(Exporter) perl(XSLoader)
+
+%description libs
+This package is the shared library for perl.
+
+%package devel
+Summary: Development files for %{name}
+License: (GPL-1.0-or-later or Artistic-1.0-perl) and UCD
+
+Requires: perl = %{epoch}:%{version}-%{release} system-rpm-config
+%if %{with systemtap}
+Requires: systemtap-sdt-devel
+%endif
+Requires: perl(ExtUtils::ParseXS) perl(Devel::PPPort)
+Requires: %perl_compat
+
+Provides: perl-Devel-Peek perl-Devel-SelfStubber perl-tests
+
+Obsoletes: perl-Devel-Peek perl-Devel-SelfStubber perl-tests
+
+%description devel
+This package contains the development files and test files for %{name}.
+
+%package_help
+
+%prep
+%autosetup -n %{name}-%{perl_version} -p1
+%global perl_abi %(echo '%{perl_version}' | sed 's/^\\([^.]*\\.[^.]*\\).*/\\1/')
+echo %{perl_abi}
+
+# Configure Compress::Zlib to use system zlib
+sed -i 's|BUILD_ZLIB = True|BUILD_ZLIB = False|
+ s|INCLUDE = ./zlib-src|INCLUDE = %{_includedir}|
+ s|LIB = ./zlib-src|LIB = %{_libdir}|' \
+ cpan/Compress-Raw-Zlib/config.in
+
+rm -rf cpan/Compress-Raw-Zlib/zlib-src
+rm -rf cpan/Compress-Raw-Bzip2/bzip2-src
+sed -i '/\(bzip2\|zlib\)-src/d' MANIFEST
+
+%build
+/bin/sh Configure -des -Doptimize="none" -Dccflags="$RPM_OPT_FLAGS" \
+ -Dldflags="$RPM_LD_FLAGS" -Dccdlflags="-Wl,--enable-new-dtags $RPM_LD_FLAGS" \
+ -Dlddlflags="-shared $RPM_LD_FLAGS" -Dshrpdir="%{_libdir}" \
+ -DDEBUGGING=-g -Dversion=%{version} -Dmyhostname=localhost \
+ -Dperladmin=root@localhost -Dcc='%{__cc}' -Dprefix=%{_prefix} \
+ -Dvendorprefix=%{_prefix} -Dsiteprefix=%{_prefix}/local \
+ -Dsitelib="%{_prefix}/local/share/perl5" -Dprivlib="%{perl_datadir}" \
+ -Dsitearch="%{_prefix}/local/%{_lib}/perl5" \
+ -Dvendorlib="%{perl_vendor_datadir}" -Darchlib="%{perl_libdir}" \
+ -Dvendorarch="%{perl_vendor_libdir}" -Darchname="%{_arch}-%{_os}-thread-multi" \
+ -Dlibpth="/usr/local/lib64 /lib64 %{_prefix}/lib64" \
+ -Duseshrplib -Dusethreads -Duseithreads -Ui_ndbm -Di_gdbm \
+%if %{with systemtap}
+ -Dusedtrace='/usr/bin/dtrace' \
+%endif
+ -Ubincompat5005 -Dusesitecustomize \
+ -Duselargefiles -Dd_semctl_semun -Di_db -Duse64bitint \
+ -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dscriptdir='%{_bindir}' \
+ -Dinstallusrbinperl=n -Uversiononly -Dpager='/usr/bin/less -isr' \
+ -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto \
+ -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto \
+ -Ud_endservent_r_proto -Ud_setservent_r_proto \
+
+BUILD_BZIP2=0
+BZIP2_LIB=%{_libdir}
+export BUILD_BZIP2 BZIP2_LIB
+
+# for new perl can be executed from make.
+%global soname libperl.so.%{perl_abi}
+test -L %{soname} || ln -s libperl.so %{soname}
+
+make %{?_smp_mflags}
+
+%install
+%make_install
+# move libperl to standard path.
+mv "%{buildroot}%{perl_libdir}/CORE/libperl.so" "%{buildroot}%{_libdir}/libperl.so.%{version}"
+ln -s "libperl.so.%{version}" "%{buildroot}%{_libdir}/%{soname}"
+ln -s "libperl.so.%{version}" "%{buildroot}%{_libdir}/libperl.so"
+# Keep symlink from original location
+ln -s "../../libperl.so.%{version}" "%{buildroot}%{perl_libdir}/CORE/libperl.so"
+
+rm -f "%{buildroot}%{perl_libdir}/CORE/%{soname}"
+
+install -p -m 755 utils/pl2pm %{buildroot}%{_bindir}/pl2pm
+
+for h_file in sys/ioctl.h sys/syscall.h syscall.h
+do
+ %{perl_new} %{buildroot}%{_bindir}/h2ph -a -d %{buildroot}%{perl_libdir} $h_file || true
+done
+
+mkdir -p %{buildroot}%{perl_vendor_libdir}/auto
+mkdir -p %{buildroot}%{perl_vendor_datadir}
+
+# This is a work-around for rpmbuild bug #878863.
+find %{buildroot} -type f -name '*.bs' -empty -delete
+chmod -R u+w %{buildroot}/*
+
+rm %{buildroot}%{perl_datadir}/ExtUtils/xsubpp
+ln -s ../../../bin/xsubpp %{buildroot}%{perl_datadir}/ExtUtils/
+
+rm %{buildroot}%{perl_libdir}/.packlist
+
+rm %{buildroot}/%{perl_libdir}/File/Spec/VMS.pm
+rm %{buildroot}%{_mandir}/man3/File::Spec::VMS.3*
+
+# tests
+mkdir -p %{buildroot}%{_libexecdir}/perl5-tests/perl-tests
+tar -cf - t/ | ( cd %{buildroot}%{_libexecdir}/perl5-tests/perl-tests && tar -xf - )
+for dir in `find ext/ -type d -name t -maxdepth 2` ; do
+ tar -cf - $dir | ( cd %{buildroot}%{_libexecdir}/perl5-tests/perl-tests/t && tar -xf - )
+done
+
+# fix shell bangs in tests.
+%{perl_new} -MConfig -i -pn \
+ -e 's"\A#!(?:perl|\./perl|/perl|/usr/bin/perl|/usr/bin/env perl)\b"$Config{startperl}"' \
+ $(find %{buildroot}%{_libexecdir}/perl5-tests/perl-tests -type f)
+
+%check
+%{perl_new} -I/lib regen/lib_cleanup.pl
+cd t
+%{perl_new} -I../lib porting/customized.t --regen
+cd -
+TEST_JOBS=$(echo %{?_smp_mflags} | sed 's/.*-j\([0-9][0-9]*\).*/\1/') \
+make test_harness
+
+%ldconfig_scriptlets
+
+%files
+# there are many files do not need to be packaged
+# in this main package
+%exclude %{_bindir}/{h2xs,perlivp,corelist,prove,cpan,enc2xs,streamzip}
+%exclude %{_bindir}/{ptar,ptargrep,ptardiff,shasum,json_pp}
+%exclude %{_bindir}/{encguess,piconv,instmodsh,xsubpp,pod2text}
+%exclude %{_bindir}/{podchecker,podselect,perldoc,pod2usage,pod2man}
+%exclude %dir %{perl_datadir}/Archive
+%exclude %{perl_libdir}/CORE/*.h
+%exclude %{perl_datadir}/Archive/{Tar,Tar.pm}
+%exclude %{perl_datadir}/autodie/
+%exclude %{perl_datadir}/{autodie.pm,Fatal.pm}
+%exclude %{perl_datadir}/B/Debug.pm
+%exclude %{perl_datadir}/{Carp,Carp.*}
+%exclude %{perl_datadir}/Config/Perl
+%exclude %{perl_datadir}/constant.pm
+%exclude %dir %{perl_datadir}/App
+%exclude %{perl_datadir}/App/Cpan.pm
+%exclude %{perl_datadir}/{CPAN,CPAN.pm}
+%exclude %dir %{perl_datadir}/{CPAN,CPAN/Meta,CPAN/Meta/History,Parse,Parse/CPAN}
+%exclude %{perl_datadir}/CPAN/Meta.pm
+%exclude %{perl_datadir}/CPAN/Meta/{Converter.pm,Feature.pm,History.pm}
+%exclude %{perl_datadir}/CPAN/Meta/{Merge.pm,Prereqs.pm,Spec.pm,Validator.pm}
+%exclude %{perl_datadir}/Parse/CPAN/Meta.pm
+%exclude %{perl_datadir}/CPAN/Meta/Requirements.pm
+%exclude %{perl_datadir}/CPAN/Meta/YAML.pm
+%exclude %dir %{perl_libdir}/{Compress,Compress/Raw}
+%exclude %dir %{perl_libdir}/{auto/Compress,auto/Compress/Raw}
+%exclude %{perl_libdir}/Compress/Raw/Bzip2.pm
+%exclude %{perl_libdir}/auto/Compress/Raw/Bzip2
+%exclude %{perl_libdir}/Compress/Raw/Zlib.pm
+%exclude %{perl_libdir}/auto/Compress/Raw/Zlib
+%exclude %dir %{perl_libdir}/auto/Data
+%exclude %dir %{perl_libdir}/auto/Data/Dumper
+%exclude %{perl_libdir}/auto/Data/Dumper/Dumper.so
+%exclude %dir %{perl_libdir}/Data
+%exclude %{perl_libdir}/Data/Dumper.pm
+%exclude %{perl_libdir}/DB_File.pm
+%exclude %dir %{perl_libdir}/auto/DB_File
+%exclude %{perl_libdir}/auto/DB_File/DB_File.so
+%dir %exclude %{perl_libdir}/Devel
+%exclude %{perl_libdir}/Devel/Peek.pm
+%dir %exclude %{perl_libdir}/auto/Devel
+%exclude %{perl_libdir}/auto/Devel/Peek
+%exclude %{perl_libdir}/Devel/PPPort.pm
+%exclude %dir %{perl_datadir}/Devel
+%exclude %{perl_datadir}/Devel/SelfStubber.pm
+%exclude %{perl_datadir}/Digest.pm
+%exclude %dir %{perl_datadir}/Digest
+%exclude %{perl_datadir}/Digest/{base.pm,file.pm}
+%exclude %dir %{perl_libdir}/Digest
+%exclude %{perl_libdir}/Digest/MD5.pm
+%exclude %dir %{perl_libdir}/auto/Digest
+%exclude %{perl_libdir}/auto/Digest/MD5
+%exclude %{perl_libdir}/Digest/SHA.pm
+%exclude %{perl_libdir}/auto/Digest/SHA
+%exclude %{perl_libdir}/Encode*
+%exclude %{perl_libdir}/auto/Encode*
+%exclude %{perl_datadir}/Encode
+%exclude %{perl_libdir}/encoding.pm
+%exclude %dir %{perl_datadir}/Encode
+%exclude %{perl_datadir}/Encode/{*.e2x,encode.h}
+%exclude %{perl_datadir}/Env.pm
+%exclude %{perl_datadir}/Exporter*
+%exclude %{perl_datadir}/experimental*
+%exclude %{perl_datadir}/ExtUtils/{CBuilder,CBuilder.pm}
+%exclude %{perl_datadir}/ExtUtils/Command.pm
+%exclude %{perl_datadir}/ExtUtils/{Install.pm,Installed.pm,Packlist.pm}
+%exclude %{perl_datadir}/ExtUtils/{Manifest.pm,MANIFEST.SKIP}
+%exclude %{perl_datadir}/ExtUtils/{Command,Liblist,Liblist.pm,MM.pm}
+%exclude %{perl_datadir}/ExtUtils/{MakeMaker,MakeMaker.pm,MM_*.pm,MY.pm}
+%exclude %{perl_datadir}/ExtUtils/{Mkbootstrap.pm,Mksymlists.pm,testlib.pm}
+%exclude %dir %{perl_datadir}/ExtUtils/MM
+%exclude %{perl_datadir}/ExtUtils/MM/Utils.pm
+%exclude %dir %{perl_datadir}/ExtUtils/ParseXS
+%exclude %{perl_datadir}/ExtUtils/{ParseXS.pm,ParseXS.pod}
+%exclude %{perl_datadir}/ExtUtils/ParseXS/{Constants.pm,CountLines.pm}
+%exclude %{perl_datadir}/ExtUtils/ParseXS/{Utilities.pm,Eval.pm}
+%exclude %dir %{perl_datadir}/ExtUtils/Typemaps
+%exclude %{perl_datadir}/ExtUtils/{Typemaps.pm,xsubpp}
+%exclude %{perl_datadir}/ExtUtils/Typemaps/{Cmd.pm,InputMap.pm}
+%exclude %{perl_datadir}/ExtUtils/Typemaps/{OutputMap.pm,Type.pm}
+%exclude %{perl_datadir}/File/{Fetch.pm,Path.pm,Temp.pm}
+%exclude %dir %{perl_libdir}/auto/Filter
+%exclude %{perl_libdir}/auto/Filter/Util
+%exclude %dir %{perl_libdir}/Filter
+%exclude %{perl_libdir}/Filter/Util
+%exclude %{perl_datadir}/pod/perlfilter.pod
+%exclude %dir %{perl_datadir}/Filter
+%exclude %{perl_datadir}/Filter/Simple.pm
+%exclude %{_bindir}/zipdetails
+%exclude %dir %{perl_datadir}/IO/Compress
+%exclude %{perl_datadir}/IO/Compress/FAQ.pod
+%exclude %{perl_datadir}/Getopt/Long.pm
+%exclude %dir %{perl_datadir}/Compress
+%exclude %{perl_datadir}/Compress/Zlib.pm
+%exclude %{perl_datadir}/File/GlobMapper.pm
+%exclude %{perl_datadir}/IO/Compress/{Base,Base.pm}
+%exclude %dir %{perl_datadir}/IO/Uncompress
+%exclude %{perl_datadir}/IO/Uncompress/{AnyUncompress.pm,Base.pm}
+%exclude %{perl_datadir}/IO/Compress/{Adapter,Gzip,Zip,Zlib}
+%exclude %{perl_datadir}/IO/Compress/{Deflate.pm,Gzip.pm,Zip.pm}
+%exclude %{perl_datadir}/IO/Compress/{RawDeflate.pm,Bzip2.pm}
+%exclude %{perl_datadir}/IO/Uncompress/{Adapter,AnyInflate.pm}
+%exclude %{perl_datadir}/IO/Uncompress/{Bunzip2.pm,Gunzip.pm,Unzip.pm}
+%exclude %{perl_datadir}/IO/Uncompress/{Inflate.pm,RawInflate.pm}
+%exclude %dir %{perl_datadir}/IO/Socket
+%exclude %{perl_datadir}/IO/Socket/IP.pm
+%exclude %dir %{perl_datadir}/HTTP
+%exclude %{perl_datadir}/HTTP/Tiny.pm
+%exclude %{perl_libdir}/Time/HiRes.pm
+%exclude %{perl_libdir}/auto/Time/HiRes
+%exclude %{perl_datadir}/Time/Local.pm
+%exclude %{perl_datadir}/Thread/Queue.pm
+%exclude %{perl_libdir}/List/
+%exclude %{perl_libdir}/Scalar/
+%exclude %{perl_libdir}/Sub/
+%exclude %{perl_libdir}/auto/List/
+%exclude %{perl_libdir}/Storable.pm
+%exclude %{perl_libdir}/Sys/Syslog.pm
+%exclude %{perl_datadir}/Term/ANSIColor.pm
+%exclude %{perl_datadir}/Term/Cap.pm
+%exclude %{perl_libdir}/auto/Sys/Syslog/
+%exclude %{perl_libdir}/auto/Storable/
+%exclude %{perl_datadir}/IPC/Cmd.pm
+%exclude %{perl_libdir}/auto/IPC
+%exclude %{perl_libdir}/IPC/{Msg.pm,Semaphore.pm,SysV.pm,SharedMem.pm}
+%exclude %dir %{perl_datadir}/JSON
+%exclude %{perl_datadir}/JSON/{PP,PP.pm}
+%exclude %{perl_datadir}/Net/{Cmd.pm,Time.pm,SMTP.pm,POP3.pm,Netrc.pm,FTP}
+%exclude %{perl_datadir}/Net/{Config.pm,NNTP.pm,libnetFAQ.pod,FTP.pm,Domain.pm}
+%exclude %{perl_datadir}/Locale/{Codes,Codes.*,Script.*,Maketext.*}
+%exclude %{perl_datadir}/Locale/{Country.*,Currency.*,Language.*}
+%exclude %{perl_datadir}/Locale/Maketext/{Cookbook.*,Guts.*}
+%exclude %{perl_datadir}/Locale/Maketext/{GutsLoader.*,TPJ13.*}
+%exclude %{perl_datadir}/big*.pm
+%exclude %{perl_datadir}/Math/BigFloat
+%exclude %{perl_datadir}/Math/{BigFloat.pm,BigInt.pm,BigRat.pm}
+%exclude %dir %{perl_datadir}/Math/BigInt
+%exclude %{perl_datadir}/Math/BigInt/{Calc.pm,CalcEmu.pm,Lib.pm,Trace.pm}
+%exclude %{perl_libdir}/Math
+%exclude %{perl_libdir}/auto/Math
+%exclude %{perl_libdir}/auto/MIME
+%exclude %{perl_libdir}/MIME
+%exclude %{perl_datadir}/Module/{CoreList,Load,CoreList.pm,CoreList.pod,Load.pm,Metadata.pm}
+%exclude %{perl_libdir}/Cwd.pm
+%exclude %{perl_libdir}/File/Spec*
+%exclude %{perl_libdir}/auto/Cwd/
+%exclude %{perl_datadir}/Params/
+%exclude %{perl_datadir}/perlfaq.pm
+%exclude %{perl_datadir}/pod/{perlfaq*,perlglossary.pod}
+%exclude %{perl_datadir}/PerlIO
+%exclude %dir %{perl_datadir}/Perl
+%exclude %{perl_datadir}/Perl/OSType.pm
+%exclude %{perl_datadir}/parent.pm
+%exclude %{perl_datadir}/pod/{perldoc.pod,perlpodstyle.pod}
+%exclude %{perl_datadir}/Pod/{Checker.pm,Escapes.pm,Find.pm,Select.pm}
+%exclude %{perl_datadir}/Pod/{InputObjects.pm,ParseUtils.pm,Parser.pm,PlainText.pm}
+%exclude %{perl_datadir}/Pod/{Perldoc.pm,Usage.pm,Man.pm}
+%exclude %{perl_datadir}/Pod/Perldoc/
+%exclude %{perl_datadir}/Pod/Simple/
+%exclude %{perl_datadir}/Pod/{ParseLink.pm,Text,Text.pm,Simple.pm,Simple.pod}
+%exclude %dir %{perl_datadir}/App
+%exclude %{perl_datadir}/App/Prove*
+%exclude %dir %{perl_libdir}/auto/{Socket,threads}
+%exclude %{perl_libdir}/auto/Socket/Socket.*
+%exclude %{perl_libdir}/auto/threads/{threads*,shared*}
+%exclude %{perl_libdir}/{threads.pm,Socket.pm}
+%exclude %dir %{perl_libdir}/threads
+%exclude %{perl_libdir}/threads/shared*
+%dir %exclude %{perl_libdir}/auto/Unicode
+%exclude %{perl_libdir}/auto/Unicode/{Collate,Normalize}
+%dir %exclude %{perl_libdir}/Unicode
+%exclude %{perl_libdir}/Unicode/Collate
+%exclude %{perl_libdir}/Unicode/{Collate.pm,Normalize.pm}
+%exclude %{perl_datadir}/Unicode/Collate
+%exclude %{perl_datadir}/{TAP*,ok*,Test2*}
+%exclude %dir %{perl_datadir}/Test
+%exclude %{perl_datadir}/Test/{Harness*,More*,Builder*,use}
+%exclude %{perl_datadir}/Test/{Tester*,Simple*,Tutorial*}
+%exclude %{perl_datadir}/Text/{Balanced.pm,ParseWords.pm}
+%exclude %{perl_datadir}/Text/{Tabs.pm,Wrap.pm}
+%exclude %{perl_datadir}/{version.pm,version.pod}
+%exclude %{perl_datadir}/version/
+
+#libs
+%exclude %dir %{perl_libdir}
+%exclude %dir %{perl_libdir}/auto
+%exclude %{perl_libdir}/auto/re
+%exclude %dir %{perl_libdir}/CORE
+%exclude %{perl_libdir}/CORE/libperl.so
+%exclude %{perl_libdir}/re.pm
+%exclude %{_libdir}/libperl.so.*
+%exclude %dir %{perl_vendor_libdir}
+%exclude %dir %{perl_vendor_libdir}/auto
+%exclude %dir %{perl_datadir}
+%exclude %{perl_datadir}/{integer.pm,strict.pm,unicore,utf8.pm}
+%exclude %{perl_datadir}/{utf8_heavy.pl,warnings.pm,XSLoader.pm}
+%exclude %dir %{perl_vendor_datadir}
+%dir %{perl_datadir}/File
+%{perl_datadir}/File/Compare.pm
+%{perl_datadir}/File/Find.pm
+
+%license Artistic Copying
+%doc AUTHORS
+%{_bindir}/*
+%dir %{perl_libdir}
+%{perl_libdir}/*
+%dir %{perl_datadir}
+%{perl_datadir}/*
+
+%files libs
+%license Artistic Copying
+%doc AUTHORS README Changes
+%dir %{perl_libdir}
+%dir %{perl_libdir}/auto
+%{perl_libdir}/auto/re
+%dir %{perl_libdir}/CORE
+%{perl_libdir}/CORE/libperl.so
+%{perl_libdir}/re.pm
+%{_libdir}/libperl.so.*
+%dir %{perl_vendor_libdir}
+%dir %{perl_vendor_libdir}/auto
+%dir %{perl_datadir}
+%{perl_datadir}/{integer.pm,strict.pm,unicore,utf8.pm}
+%{perl_datadir}/{utf8_heavy.pl,warnings.pm,XSLoader.pm}
+%dir %{perl_vendor_datadir}
+
+%files devel
+%{_bindir}/{h2xs,perlivp}
+%{perl_libdir}/CORE/*.h
+%{_libdir}/libperl.so
+%dir %{perl_libdir}/Devel
+%{perl_libdir}/Devel/Peek.pm
+%dir %{perl_libdir}/auto/Devel
+%{perl_libdir}/auto/Devel/Peek
+%dir %{perl_datadir}/Devel
+%{perl_datadir}/Devel/SelfStubber.pm
+%{_libexecdir}/perl5-tests/
+
+%files help
+# there are many man docs don not need to be packaged
+%exclude %{_mandir}/man1/{ptar.1*,ptardiff.1*,ptargrep.1*,cpan.1*,shasum.1*,perlfilter.*}
+%exclude %{_mandir}/man1/{encguess.1*,piconv.1*,enc2xs.1*,instmodsh.1*,xsubpp*,podchecker.*}
+%exclude %{_mandir}/man1/{zipdetails.*,json_pp.1*,corelist*,perlfaq*,perlglossary.*,streamzip.*}
+%exclude %{_mandir}/man1/{podselect.1*,perldoc.1*,pod2usage.*,pod2man.1*,pod2text.1*}
+%exclude %{_mandir}/man1/{perlpodstyle.1*,prove.1*}
+%exclude %{_mandir}/man3/{Archive::Tar*,autodie*,Fatal.3*,B::Debug.3*,Pod::Find.*}
+%exclude %{_mandir}/man3/{big*.*,Carp.*,Config::Perl::V.*,constant.3*,Pod::InputObjects.*}
+%exclude %{_mandir}/man3/{App::Cpan.*,*CPAN*,Compress::Raw::*,Data::Dumper.3*,Pod::ParseUtils.*}
+%exclude %{_mandir}/man3/{Digest*,DB_File*,Encode*.3*,encoding.3*,Env.3*,Exporter*,Pod::Parser.*}
+%exclude %{_mandir}/man3/{experimental*,ExtUtils::CBuilder*,ExtUtils::Command.*,ExtUtils::Install.3*}
+%exclude %{_mandir}/man3/{ExtUtils::Installed.3*,ExtUtils::Packlist.3*,ExtUtils::Manifest.3*}
+%exclude %{_mandir}/man3/{ExtUtils::Command::MM*,ExtUtils::Liblist.3*,ExtUtils::MM.3*,ExtUtils::MM_*}
+%exclude %{_mandir}/man3/{ExtUtils::MY.3*,ExtUtils::MakeMaker*,ExtUtils::Mkbootstrap.3*,IPC::Semaphore.*}
+%exclude %{_mandir}/man3/{ExtUtils::Mksymlists.3*,ExtUtils::testlib.3*,ExtUtils::MM::Utils.*,IPC::SharedMem.*}
+%exclude %{_mandir}/man3/{ExtUtils::ParseXS*,ExtUtils::Typemaps*,File::Fetch.3*,File::Path.3*,IPC::SysV.*}
+%exclude %{_mandir}/man3/{File::Temp.3*,Filter::Util::*,Filter::Simple.3*,Getopt::Long.3*,IPC::Msg.*}
+%exclude %{_mandir}/man3/{IO::Compress::*,Compress::Zlib*,File::GlobMapper.*,IO::Uncompress::*}
+%exclude %{_mandir}/man3/{IO::Socket::IP.*,HTTP::Tiny*,IPC::Cmd.3*,JSON::PP*,Net::Cmd.*,Net::Config.*}
+%exclude %{_mandir}/man3/{Net::Domain.*,Net::FTP.*,Net::libnetFAQ.*,Net::NNTP.*,Net::Netrc.*,Net::POP3.*}
+%exclude %{_mandir}/man3/{Net::SMTP.*,Net::Time.*,Locale::Codes::*,Locale::Codes.*,Locale::Country.*}
+%exclude %{_mandir}/man3/{Locale::Currency.*,Locale::Language.*,Locale::Script.*,Locale::Maketext.*}
+%exclude %{_mandir}/man3/{Locale::Maketext::Cookbook.*,Locale::Maketext::Guts.*,Locale::Maketext::GutsLoader.*}
+%exclude %{_mandir}/man3/{Locale::Maketext::TPJ13.*,Math::BigFloat.*,Math::BigInt*,Math::BigRat.*,MIME::*,Cwd*}
+%exclude %{_mandir}/man3/{Module::CoreList*,Module::Load.*,Module::Load::Conditional*,Module::Metadata.3pm*}
+%exclude %{_mandir}/man3/{File::Spec*,Params::Check*,PerlIO::via::QuotedPrint.*,Perl::OSType.3pm*,parent.3*}
+%exclude %{_mandir}/man3/{Pod::Checker.*,Pod::Escapes.*,Pod::PlainText.*,Pod::Select.*,Pod::Perldoc*,Pod::Usage.*}
+%exclude %{_mandir}/man3/{Pod::Man*,Pod::ParseLink*,Pod::Text*,Pod::Simple*,List::Util*,Scalar::Util*,Sub::Util*}
+%exclude %{_mandir}/man3/{Storable.*,Sys::Syslog.*,Term::ANSIColor*,Term::Cap.*,App::Prove*,TAP*,Test::Harness*}
+%exclude %{_mandir}/man3/{ok*,Test::More*,Test::Builder*,Test::Tester*,Test::Simple*,Test::Tutorial*,Test::use::*}
+%exclude %{_mandir}/man3/{Test2*,Text::Balanced.*,Text::ParseWords.*,Text::Tabs.*,Text::Wrap.*,Thread::Queue.*}
+%exclude %{_mandir}/man3/{Time::HiRes.*,Time::Local.*,Socket.3*,threads.3*,threads::shared*,Unicode::Collate.*}
+%exclude %{_mandir}/man3/{Unicode::Collate::*,Unicode::Normalize.*,version.3*,version::Internals.3*,Devel::PPPort*}
+
+%doc README Changes
+%{_mandir}/man1/*
+%{_mandir}/man3/*
+
+%changelog
+* Tue Sep 3 2024 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0-9
+- Delete the man of File::Compare and File::Find from the main package.
+
+* Wed Aug 14 2024 gengqihu <gengqihu2@h-partners.com> - 4:5.38.0-8
+- License info rectification
+
+* Wed Jul 31 2024 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0-7
+- sync patch from upstream
+ backport-aarch64-ilp32-support.patch
+
+* Wed Mar 20 2024 zhangzikang <zhangzikang@kylinos.cn> - 4:5.38.0-6
+- Fix perl re.so undefined symbol error
+
+* Mon Dec 11 2023 huyubiao <huyubiao@huawei.com> - 4:5.38.0.5
+- Fix CVE-2023-47100
+
+* Fri Dec 8 2023 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0.4
+- Fix CVE-2023-48039
+
+* Mon Nov 27 2023 hongjinghao <hongjinghao@huawei.com> - 4:5.38.0.3
+- Fix CVE-2023-47038
+
+* Fri Aug 25 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.38.0-2
+- delete unused files and provides
+
+* Mon Jul 31 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.38.0-1
+- update version to 5.38.0
+
+* Thu Jul 27 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.34.0-7
+- add Perl_my_strlcpy-and-Perl_my_strlcat to fix build failed
+
+* Mon Jun 26 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.34.0-6
+- fix CVE-2023-31486
+
+* Mon May 15 2023 dongyuzhen <dongyuzhen@h-partners.com> 4:5.34.0-5
+- fix CVE-2023-31484
+
+* Tue Jan 18 2023 <yangmingtai@huawei.com> 4:5.34.0-4
+- fix compile failed caused by zlib update
+
+* Fri Jul 01 2022 dongyuzhen <dongyuzhen@h-partners.com> 4:5.34.0-3
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:Add patches that are deleted during the upgrade
+
+* Tue Mar 29 2022 zhouwenpei<zhouwenpei1@h-partners.com> 4:5.34.0-2
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:add build conditions to control installing systemtap
+
+* Fri Mar 18 2022 tianwei<tianwei12@h-partners.com> 4:5.34.0-1
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:upgrade version to 5.34.0
+
+* Thu Feb 24 2022 yuanxin<yuanxin24@h-partners.com> 4:5.32.0-9
+- Type:CVE
+- ID:CVE-2021-36770
+- SUG:NA
+- DESC:fix CVE-2021-36770
+
+* Thu Aug 5 2021 yuanxin<yuanxin24@huawei.com> 4:5.32.0-8
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:remove perl-devel from perl
+
+* Wed Aug 4 2021 yuanxin<yuanxin24@huawei.com> 4:5.32.0-7
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:remove other release-related information
+
+* Thu Jul 22 2021 liudabo<liudabo1@huawei.com> 4:5.32.0-6
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:deleting gdb build dependency
+
+* Tue Jun 29 2021 yuanxin<yuanxin24@huawei.com> - 4:5.32.0-5
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:remove perl-DB_File
+
+* Tue Mar 30 2021 shenyangyang<shenyangyang4@huawei.com> - 4:5.32.0-4
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:Rebuild for openEuler-rpm-config moving /usr/lib/rpm/openEuler/xxxx
+ to /usr/lib/xxxx
+
+* Wed Mar 03 2021 wuchaochao<wuchaochao4@huawei.com> - 4:5.32.0-3
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:fix backport-perl-5.22.0-Install-libperl.so-to-shrpdir-on-Linux.patch
+
+* Mon Aug 17 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.32.0-2
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:delete the temporary unneeded behavior for upgrade of perl
+
+* Thu Aug 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.32.0-1
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:bump version to 5.32.0
+
+* Sat Mar 21 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-434
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:add build requires of gdb
+
+* Tue Feb 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-433
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:add subpackage perl-libs
+
+* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-432
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:delete unneeded source in perl
+
+* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-431
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:add macros that used for perl
+
+* Thu Jan 2 2020 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-430
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:delete unneeded patch
+
+* Mon Dec 23 2019 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-429
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:change info in comments and changelog
+
+* Tue Oct 29 2019 shenyangyang<shenyangyang4@huawei.com> - 4:5.28.0-428
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:add build requires of bzip2-devel and gdbm-devel to solve build problem
+
+* Wed Sep 18 2019 shenyangyang<shenyangyang4@huawei.com> - 4:5.28.0-427
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:revise spec
+
+* Tue Aug 20 2019 wangchong<wangchong56@huawei.com> - 4:5.28.0-426
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC: rename patches
+
+* Thu Apr 11 2019 zhangzhihui<zhangzhihui23@huawei.com> - 4:5.28.0-425
+- Type:cves
+- ID: fix CVE-2018-18312
+- SUG:restart
+- DESC:fix cves
+
+* Tue Mar 5 2019 wangjia <wangjia55@huawei.com> - 4:5.28.0-424
+- Type:enhancement
+- ID:NA
+- SUG:restart
+- DESC:disable perl-ExtUtils-CBuilder and perl-CPAN require
+
+* Mon Sep 24 2018 openEuler Buildteam <buildteam@openeuler.org> - 4:5.28.0-423
+- Package Init
diff --git a/sources b/sources
new file mode 100644
index 0000000..d0ef8e3
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+e1c8aaec897dd386c741f97eef9f2e87 perl-5.38.0.tar.xz