import CS perl-CPAN-2.18-399.el8

This commit is contained in:
eabdullin 2024-03-27 20:15:37 +00:00
parent 4124961e02
commit dbb6f68f0f
2 changed files with 93 additions and 6 deletions

View File

@ -0,0 +1,11 @@
diff -up CPAN-2.16/lib/CPAN/HTTP/Client.pm.orig CPAN-2.16/lib/CPAN/HTTP/Client.pm
--- CPAN-2.16/lib/CPAN/HTTP/Client.pm.orig 2024-01-17 13:58:05.321031493 +0100
+++ CPAN-2.16/lib/CPAN/HTTP/Client.pm 2024-01-17 14:07:36.657874287 +0100
@@ -32,6 +32,7 @@ sub mirror {
my $want_proxy = $self->_want_proxy($uri);
my $http = HTTP::Tiny->new(
+ verify_SSL => 1,
$want_proxy ? (proxy => $self->{proxy}) : ()
);

View File

@ -12,7 +12,7 @@
Name: perl-CPAN
Version: 2.18
Release: 397%{?dist}
Release: 399%{?dist}
Summary: Query, download and build perl modules from CPAN sites
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/CPAN/
@ -27,6 +27,8 @@ Patch2: CPAN-2.18-Replace-configuration-directory-string-with-a-marke.pa
# Do not search cpan -j file in @INC, CPAN RT#116507, proposed in
# <https://github.com/andk/cpanpm/pull/105>
Patch3: CPAN-2.18-For-cpan-j-make-the-file-an-absolute-path.patch
# CVE-2023-31484 - Add verify_SSL => 1
Patch4: CPAN-2.35-Add-verify-SSL.patch
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: findutils
@ -110,6 +112,7 @@ BuildRequires: perl(Module::Build)
%endif
# Tests:
BuildRequires: perl(blib)
# CPAN::Checksums not used
BuildRequires: perl(FindBin)
BuildRequires: perl(Pod::Usage)
@ -148,6 +151,14 @@ BuildRequires: perl(YAML) >= 0.60
Requires: make
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# Some subpackages modules are not dual-lived. E.g. "open". If a distribution
# on CPAN declares a dependency on such a module, CPAN client will fail
# because the only provider is perl distribution.
# Another issue is with dual-lived modules whose distribution actually does
# not declare all needed core dependencies and the installation would also
# fail.
# As a result, any CPAN client must run-require the complete perl.
Requires: perl
Requires: perl(Archive::Tar) >= 1.50
Requires: perl(CPAN::Meta::Requirements) >= 2.121
Requires: perl(Data::Dumper)
@ -204,7 +215,10 @@ Provides: cpan = %{version}
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Mac::BuildTools\\)
# Filter under-specified dependencies
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(CPAN::Meta::Requirements\\)
# Filter modules bundled for tests
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%global __requires_exclude %{__requires_exclude}|^perl\\(CPAN::MyConfig\\)
%global __requires_exclude %{__requires_exclude}|^perl\\(local_utils\\)
%description
The CPAN module automates or at least simplifies the make and install of
@ -212,18 +226,35 @@ perl modules and extensions. It includes some primitive searching
capabilities and knows how to use LWP, HTTP::Tiny, Net::FTP and certain
external download clients to fetch distributions from the net.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
Requires: tar
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n CPAN-%{cpan_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
# Change configuration name
find -type f -exec sed -i -e 's/XCPANCONFIGNAMEX/cpan/g' {} \;
# Remove bundled modules
rm -r ./inc/*
sed -i -e '/inc\//d' MANIFEST
# Help generators to recognize Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
@ -233,7 +264,42 @@ make pure_install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -delete
%{_fixperms} $RPM_BUILD_ROOT/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t distroprefs %{buildroot}%{_libexecdir}/%{name}
# Does not work with system module
rm %{buildroot}%{_libexecdir}/%{name}/t/5*pod*.t
# Remove the tests which need ./lib and ./blib
rm %{buildroot}%{_libexecdir}/%{name}/t/03pkgs.t
rm %{buildroot}%{_libexecdir}/%{name}/t/04clean_load.t
# Needed internet connection
rm %{buildroot}%{_libexecdir}/%{name}/t/31sessions.t
# Use system modules for tests
perl -i -ple 's{-Mblib}{}' %{buildroot}%{_libexecdir}/%{name}/t/97-return_values.t
mkdir -p %{buildroot}%{_libexecdir}/%{name}/blib/script
ln -s %{_bindir}/cpan %{buildroot}%{_libexecdir}/%{name}/blib/script
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
set -e
unset AUTHOR_TEST CPAN_EXPECT_TIMEOUT CPAN_RUN_SHELL_TEST_WITHOUT_EXPECT \
ftp_proxy http_proxy no_proxy \
PERL5_CPAN_IS_RUNNING PERL5_CPAN_IS_RUNNING_IN_RECURSION PERL_CORE VERBOSE
# Some tests write into temporary files/directories. The easiest solution
# is to copy the tests into a writable directory and execute them from there.
DIR=$(mktemp -d)
pushd "$DIR"
cp -a %{_libexecdir}/%{name}/* ./
cp t/CPAN/TestConfig.pm t/CPAN/MyConfig.pm
prove -I .
popd
rm -rf "$DIR"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
unset AUTHOR_TEST CPAN_EXPECT_TIMEOUT CPAN_RUN_SHELL_TEST_WITHOUT_EXPECT \
ftp_proxy http_proxy no_proxy \
PERL5_CPAN_IS_RUNNING PERL5_CPAN_IS_RUNNING_IN_RECURSION PERL_CORE VERBOSE
make test
%files
@ -243,7 +309,17 @@ make test
%{_mandir}/man1/*
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Mon Feb 05 2024 Jitka Plesnikova <jplesnik@redhat.com> - 2.18-399
- Fix tests to run in correct order
* Thu Jan 18 2024 Jitka Plesnikova <jplesnik@redhat.com> - 2.18-398
- Fix CVE-2023-31484
- Package tests
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.18-397
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild