@ -8,38 +8,41 @@
%bcond_with perl_CPAN_enables_optional_test
%endif
%global cpan_version 2.16
Name: perl-CPAN
Version: 2.29
Release: 3%{?dist}
Version: 2.18
Release: 397 %{?dist}
Summary: Query, download and build perl modules from CPAN sites
License: GPL+ or Artistic
URL: https://metacpan.org/release/CPAN
Source0: https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-%{version}.tar.gz
URL: http://search.cpan.org/dist/CPAN/
Source0: http://www.cpan.org/authors/id/A/AN/ANDK/CPAN-%{cpan_version}.tar.gz
# Upgrade to CPAN-2.18 as provided in perl-5.25.12 to properly dual-live after
# upgrading perl to 5.26
Patch0: CPAN-2.16-Rebase-to-2.18-from-perl-5.25.12.patch
# Create site paths for the first time, bug #1158873, CPAN RT#99905
Patch0: CPAN-2.18-Attemp-to-create-site-library-directories-on-first-t.patch
Patch1 : CPAN-2.18-Attemp-to-create-site-library-directories-on-first-t.patch
# Change configuration directory name
Patch1: CPAN-2.18-Replace-configuration-directory-string-with-a-marke.patch
# Some syntax fixes
Patch2: CPAN-2.32-s-gpg-gpg-in-system-add-quotes-where-needed.patch
Patch3: CPAN-2.32-s-dev-null-devnull.patch
# CVE-2023-31484 - Add verify_SSL => 1
Patch4: CPAN-2.35-Add-verify-SSL.patch
Patch2: CPAN-2.18-Replace-configuration-directory-string-with-a-marke.patch
# 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
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl-generators
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Path)
# Module::Signature not used
BuildRequires: perl(strict)
BuildRequires: perl(vars)
BuildRequires: sed
# Optional:
BuildRequires: perl(File::Spec)
# YAML::Syck is not used because @ST_PREFS is empty in Makefile.PL
# YAML::Syck is not not used because @ST_PREFS is empty in Makefile.PL
# Run-time:
# Prefer Archive::Tar and Compress::Zlib over tar and gzip
@ -59,7 +62,6 @@ BuildRequires: perl(Data::Dumper)
# Devel::Size not used at tests
BuildRequires: perl(DirHandle)
BuildRequires: perl(Dumpvalue)
BuildRequires: perl(Errno)
BuildRequires: perl(Exporter)
# ExtUtils::Manifest not used at tests
BuildRequires: perl(Fcntl)
@ -74,9 +76,6 @@ BuildRequires: perl(Getopt::Std)
# HTTP::Request is optional
BuildRequires: perl(HTTP::Tiny) >= 0.005
BuildRequires: perl(if)
# IO::Socket::SSL 1.56 is optional
# YAML::XS or YAML::Syck or JSON::PP, we already use YAML::Syck at a different
# place, keep JSON::PP optional
BuildRequires: perl(lib)
# local::lib is optional
# LWP is optional, prefer HTTP::Tiny and Net::FTP
@ -86,11 +85,8 @@ BuildRequires: perl(lib)
# Module::Signature is optional
# Net::Config not used at tests
# Net::FTP not used at tests
# Net::Ping is required but >= 2.13 version is a soft dependency
# Net::SSLeay 1.49 is optional
BuildRequires: perl(Net::Ping)
BuildRequires: perl(overload)
# Pod::Perldoc is optional
BuildRequires: perl(POSIX)
BuildRequires: perl(Safe)
BuildRequires: perl(Sys::Hostname)
@ -104,32 +100,25 @@ BuildRequires: perl(Text::Wrap)
# User::pwent not used at tests
BuildRequires: perl(warnings)
# Optional:
#%%if !%%{defined perl_bootstrap}
# CPAN::DistnameInfo not used at tests
#%%endif
BuildRequires: perl(CPAN::Meta) >= 2.110350
# Crypt::OpenPGP not used at tests
# Digest::MD5 not used at tests
BuildRequires: perl(Digest::SHA)
# Keep Log::Log4perl optional
# Keep MIME::Base64 optional
%if !%{defined perl_bootstrap}
BuildRequires: perl(Module::Build)
%endif
# Tests:
BuildRequires: perl(blib)
# CPAN::Checksums not used
BuildRequires: perl(FindBin)
BuildRequires: perl(Pod::Usage)
BuildRequires: perl(Test::More)
BuildRequires: perl(version)
%if %{with perl_CPAN_enables_optional_test}
# Optional tests:
%if %{with perl_CPAN_enables_gnupg_test}
BuildRequires: %{_bindir}/gpg
# CPAN::Perl::Releases is helpfull only on RC or TRIAL Perl interpreters
# Digest::SHA1 not needed if Digest::SHA is available
# Digest::SHA::PurePerl not needed if Digest::SHA is available
%endif
@ -144,7 +133,6 @@ BuildRequires: perl(Module::Signature) >= 0.66
%endif
BuildRequires: perl(Perl::Version)
%endif
BuildRequires: perl(Pod::Perldoc::ToMan)
%if %{with perl_CPAN_enables_gnupg_test}
BuildRequires: perl(Socket)
%endif
@ -160,18 +148,7 @@ 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
%if !%{defined perl_bootstrap}
Recommends: perl(CPAN::DistnameInfo)
%endif
Requires: perl(CPAN::Meta::Requirements) >= 2.121
Requires: perl(Data::Dumper)
%if !%{defined perl_bootstrap}
@ -182,12 +159,7 @@ Requires: perl(ExtUtils::Manifest)
Requires: perl(File::HomeDir) >= 0.65
%endif
Requires: perl(File::Temp) >= 0.16
# YAML::XS or YAML::Syck or JSON::PP, we already use YAML::Syck at a different
# place, keep JSON::PP optional
Requires: perl(lib)
%if !%{defined perl_bootstrap}
Suggests: perl(Log::Log4perl)
%endif
Requires: perl(Net::Config)
Requires: perl(Net::FTP)
Requires: perl(POSIX)
@ -212,26 +184,18 @@ Requires: perl(Digest::SHA)
Requires: perl(Dumpvalue)
Requires: perl(ExtUtils::CBuilder)
%if ! %{defined perl_bootstrap}
Requires: perl(IO::Socket::SSL) >= 1.56
Requires: perl(Net::SSLeay) >= 1.49
Requires: perl(Module::Signature)
%endif
%if ! %{defined perl_bootstrap}
# Avoid circular deps local::lib -> Module::Install -> CPAN when bootstraping
# local::lib recommended by CPAN::FirstTime default choice, bug #1122498
Requires: perl(local::lib)
%endif
%if ! %{defined perl_bootstrap}
Requires: perl(Module::Build)
%endif
Recommends: perl(Pod::Perldoc)
%if ! %{defined perl_bootstrap}
Recommends: perl(Term::ReadKey)
Requires: perl(Text::Glob)
# Text::Levenshtein::XS or Text::Levenshtein::Damerau::XS or Text::Levenshtein
# or Text::Levenshtein::Damerau::PP
Suggests: perl(Text::Levenshtein::Damerau::XS)
# YAML::Syck or YAML or Data::Dumper or overload
# YAML::Syck or YAML or Data::Dumper
Suggests: perl(YAML::Syck)
%endif
Provides: cpan = %{version}
@ -240,10 +204,7 @@ 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
@ -251,78 +212,28 @@ 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
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n CPAN-%{version}
%setup -q -n CPAN-%{cpan_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
# Change configuration name
find -type f -exec perl -i -p e 's/XCPANCONFIGNAMEX/cpan/g' {} \;
find -type f -exec sed -i -e 's/XCPANCONFIGNAMEX/cpan/g' {} \;
# Remove bundled modules
rm -r ./inc/*
perl -i -ne 'print $_ unless m{^inc/}' 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
sed -i -e '/inc\//d' MANIFEST
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build }
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
%install
%{make_install}
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/51pod.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-run.t
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}/* ./
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
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
@ -332,87 +243,7 @@ make test
%{_mandir}/man1/*
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Aug 01 2023 Michal Josef Špaček <mspacek@redhat.com> - 2.29-3
- Resolves: rhbz#2218907 - Fix CVE-2023-31484
* Wed Feb 16 2022 Jitka Plesnikova <jplesnik@redhat.com> - 2.29-2
- Resolves: rhbz#2037211 - Enable gating
* Mon Feb 07 2022 Jitka Plesnikova <jplesnik@redhat.com> - 2.29-1
- 2.29 bump; Package tests
- Resolves: rhbz#2037211
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.28-8
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.28-7
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Sep 23 2020 Petr Pisar <ppisar@redhat.com> - 2.28-5
- Run-require complete perl
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jun 26 2020 Jitka Plesnikova <jplesnik@redhat.com> - 2.28-3
- Perl 5.32 re-rebuild of bootstrapped packages
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 2.28-2
- Perl 5.32 rebuild
* Mon Jun 15 2020 Petr Pisar <ppisar@redhat.com> - 2.28-1
- 2.28 bump
* Fri Jan 31 2020 Petr Pisar <ppisar@redhat.com> - 2.27-4
- Enable loading objects from session YAML files (CPAN RT#131615)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.27-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.27-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jul 04 2019 Petr Pisar <ppisar@redhat.com> - 2.27-1
- 2.27 bump
* Sun Jun 02 2019 Jitka Plesnikova <jplesnik@redhat.com> - 2.26-3
- Perl 5.30 re-rebuild of bootstrapped packages
* Thu May 30 2019 Jitka Plesnikova <jplesnik@redhat.com> - 2.26-2
- Perl 5.30 rebuild
* Tue Mar 19 2019 Petr Pisar <ppisar@redhat.com> - 2.26-1
- 2.26 bump
* Mon Mar 04 2019 Petr Pisar <ppisar@redhat.com> - 2.25-1
- 2.25 bump
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.22-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 02 2019 Petr Pisar <ppisar@redhat.com> - 2.22-1
- 2.22 bump
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.20-418
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sun Jul 01 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.20-417
- Perl 5.28 re-rebuild of bootstrapped packages
* Tue Jun 26 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.20-416
- Increase release to favour standalone package
* Wed May 23 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.20-1
- Upgrade to 2.20 as provided in perl-5.28.0
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.18-397
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild