5abc74
# Don not run gnupg1 tests by default, they need network access
5abc74
# (Socket::inet_aton('pool.sks-keyservers.net')).
5abc74
%bcond_with perl_CPAN_enables_gnupg_test
5abc74
# Run optional test
5abc74
%if ! (0%{?rhel})
5abc74
%bcond_without perl_CPAN_enables_optional_test
5abc74
%else
5abc74
%bcond_with perl_CPAN_enables_optional_test
5abc74
%endif
5abc74
5abc74
Name:           perl-CPAN
5abc74
Version:        2.28
5abc74
Release:        8%{?dist}
5abc74
Summary:        Query, download and build perl modules from CPAN sites
5abc74
License:        GPL+ or Artistic
5abc74
URL:            https://metacpan.org/release/CPAN
5abc74
Source0:        https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-%{version}.tar.gz
5abc74
# Create site paths for the first time, bug #1158873, CPAN RT#99905
5abc74
Patch0:         CPAN-2.18-Attemp-to-create-site-library-directories-on-first-t.patch
5abc74
# Change configuration directory name
5abc74
Patch1:         CPAN-2.18-Replace-configuration-directory-string-with-a-marke.patch
5abc74
BuildArch:      noarch
5abc74
BuildRequires:  coreutils
5abc74
BuildRequires:  findutils
5abc74
BuildRequires:  make
5abc74
BuildRequires:  perl-generators
5abc74
BuildRequires:  perl-interpreter
5abc74
BuildRequires:  perl(Config)
5abc74
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
5abc74
BuildRequires:  perl(File::Basename)
5abc74
BuildRequires:  perl(File::Path)
5abc74
# Module::Signature not used
5abc74
BuildRequires:  perl(strict)
5abc74
BuildRequires:  perl(vars)
5abc74
# Optional:
5abc74
BuildRequires:  perl(File::Spec)
5abc74
# YAML::Syck is not used because @ST_PREFS is empty in Makefile.PL
5abc74
5abc74
# Run-time:
5abc74
# Prefer Archive::Tar and Compress::Zlib over tar and gzip
5abc74
BuildRequires:  perl(Archive::Tar) >= 1.50
5abc74
%if !%{defined perl_bootstrap}
5abc74
# Prefer Archive::Zip over unzip
5abc74
BuildRequires:  perl(Archive::Zip)
5abc74
%endif
5abc74
BuildRequires:  perl(autouse)
5abc74
BuildRequires:  perl(base)
5abc74
BuildRequires:  perl(Carp)
5abc74
BuildRequires:  perl(constant)
5abc74
BuildRequires:  perl(Compress::Zlib)
5abc74
BuildRequires:  perl(CPAN::Meta::Requirements) >= 2.121
5abc74
BuildRequires:  perl(Cwd)
5abc74
BuildRequires:  perl(Data::Dumper)
5abc74
# Devel::Size not used at tests
5abc74
BuildRequires:  perl(DirHandle)
5abc74
BuildRequires:  perl(Dumpvalue)
5abc74
BuildRequires:  perl(Errno)
5abc74
BuildRequires:  perl(Exporter)
5abc74
# ExtUtils::Manifest not used at tests
5abc74
BuildRequires:  perl(Fcntl)
5abc74
BuildRequires:  perl(File::Copy)
5abc74
BuildRequires:  perl(File::Find)
5abc74
# File::HomeDir 0.65 not used at tests
5abc74
BuildRequires:  perl(File::Spec::Functions)
5abc74
BuildRequires:  perl(File::Temp) >= 0.16
5abc74
BuildRequires:  perl(FileHandle)
5abc74
BuildRequires:  perl(Getopt::Std)
5abc74
# HTTP::Date is optional, prefer in-core Time::Local
5abc74
# HTTP::Request is optional
5abc74
BuildRequires:  perl(HTTP::Tiny) >= 0.005
5abc74
BuildRequires:  perl(if)
5abc74
# YAML::XS or YAML::Syck or JSON::PP, we already use YAML::Syck at a different
5abc74
# place, keep JSON::PP optional
5abc74
BuildRequires:  perl(lib)
5abc74
# local::lib is optional
5abc74
# LWP is optional, prefer HTTP::Tiny and Net::FTP
5abc74
# LWP::UserAgent is optional
5abc74
# Mac::BuildTools not needed
5abc74
# Mac::Files not needed
5abc74
# Module::Signature is optional
5abc74
# Net::Config not used at tests
5abc74
# Net::FTP not used at tests
5abc74
# Net::Ping is required but >= 2.13 version is a soft dependency
5abc74
BuildRequires:  perl(Net::Ping)
5abc74
BuildRequires:  perl(overload)
5abc74
# Pod::Perldoc is optional
5abc74
BuildRequires:  perl(POSIX)
5abc74
BuildRequires:  perl(Safe)
5abc74
BuildRequires:  perl(Sys::Hostname)
5abc74
BuildRequires:  perl(Term::ReadLine)
5abc74
BuildRequires:  perl(Text::ParseWords)
5abc74
BuildRequires:  perl(Text::Wrap)
5abc74
# Time::Local not used at tests
5abc74
# URI not used at tests
5abc74
# URI::Escape not used at tests
5abc74
# URI::URL 0.08 is optional 
5abc74
# User::pwent not used at tests
5abc74
BuildRequires:  perl(warnings)
5abc74
# Optional:
5abc74
#%%if !%%{defined perl_bootstrap}
5abc74
# CPAN::DistnameInfo not used at tests
5abc74
#%%endif
5abc74
BuildRequires:  perl(CPAN::Meta) >= 2.110350
5abc74
# Crypt::OpenPGP not used at tests
5abc74
# Digest::MD5 not used at tests
5abc74
BuildRequires:  perl(Digest::SHA)
5abc74
# Keep Log::Log4perl optional
5abc74
# Keep MIME::Base64 optional
5abc74
%if !%{defined perl_bootstrap}
5abc74
BuildRequires:  perl(Module::Build)
5abc74
%endif
5abc74
5abc74
# Tests:
5abc74
BuildRequires:  perl(blib)
5abc74
# CPAN::Checksums not used
5abc74
BuildRequires:  perl(FindBin)
5abc74
BuildRequires:  perl(Pod::Usage)
5abc74
BuildRequires:  perl(Test::More)
5abc74
BuildRequires:  perl(version)
5abc74
5abc74
%if %{with perl_CPAN_enables_optional_test}
5abc74
# Optional tests:
5abc74
%if %{with perl_CPAN_enables_gnupg_test}
5abc74
BuildRequires:  %{_bindir}/gpg
5abc74
# CPAN::Perl::Releases is helpfull only on RC or TRIAL Perl interpreters
5abc74
# Digest::SHA1 not needed if Digest::SHA is available
5abc74
# Digest::SHA::PurePerl not needed if Digest::SHA is available
5abc74
%endif
5abc74
%if !%{defined perl_bootstrap}
5abc74
BuildRequires:  perl(Expect)
5abc74
%endif
5abc74
BuildRequires:  perl(Hash::Util)
5abc74
%if !%{defined perl_bootstrap}
5abc74
# Kwalify not yet packaged
5abc74
%if %{with perl_CPAN_enables_gnupg_test}
5abc74
BuildRequires:  perl(Module::Signature) >= 0.66
5abc74
%endif
5abc74
BuildRequires:  perl(Perl::Version)
5abc74
%endif
5abc74
BuildRequires:  perl(Pod::Perldoc::ToMan)
5abc74
%if %{with perl_CPAN_enables_gnupg_test}
5abc74
BuildRequires:  perl(Socket)
5abc74
%endif
5abc74
%if !%{defined perl_bootstrap}
5abc74
BuildRequires:  perl(Sort::Versions)
5abc74
# Test::MinimumVersion not used
5abc74
# Test::Perl::Critic not used
5abc74
BuildRequires:  perl(Test::Pod) >= 1.00
5abc74
BuildRequires:  perl(Test::Pod::Coverage) >= 0.18
5abc74
BuildRequires:  perl(YAML) >= 0.60
5abc74
%endif
5abc74
%endif
5abc74
5abc74
Requires:       make
5abc74
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
5abc74
# Some subpackages modules are not dual-lived. E.g. "open". If a distribution
5abc74
# on CPAN declares a dependency on such a module, CPAN client will fail
5abc74
# because the only provider is perl distribution.
5abc74
# Another issue is with dual-lived modules whose distribution actually does
5abc74
# not declare all needed core dependencies and the installation would also
5abc74
# fail.
5abc74
# As a result, any CPAN client must run-require the complete perl.
5abc74
Requires:       perl
5abc74
Requires:       perl(Archive::Tar) >= 1.50
5abc74
%if !%{defined perl_bootstrap}
5abc74
Recommends:     perl(CPAN::DistnameInfo)
5abc74
%endif
5abc74
Requires:       perl(CPAN::Meta::Requirements) >= 2.121
5abc74
Requires:       perl(Data::Dumper)
5abc74
%if !%{defined perl_bootstrap}
5abc74
Requires:       perl(Devel::Size)
5abc74
%endif
5abc74
Requires:       perl(ExtUtils::Manifest)
5abc74
%if !%{defined perl_bootstrap}
5abc74
Requires:       perl(File::HomeDir) >= 0.65
5abc74
%endif
5abc74
Requires:       perl(File::Temp) >= 0.16
5abc74
# YAML::XS or YAML::Syck or JSON::PP, we already use YAML::Syck at a different
5abc74
# place, keep JSON::PP optional
5abc74
Requires:       perl(lib)
5abc74
%if !%{defined perl_bootstrap}
5abc74
Suggests:       perl(Log::Log4perl)
5abc74
%endif
5abc74
Requires:       perl(Net::Config)
5abc74
Requires:       perl(Net::FTP)
5abc74
Requires:       perl(POSIX)
5abc74
Requires:       perl(Term::ReadLine)
5abc74
Requires:       perl(Time::Local)
5abc74
%if !%{defined perl_bootstrap}
5abc74
Requires:       perl(URI)
5abc74
Requires:       perl(URI::Escape)
5abc74
%endif
5abc74
Requires:       perl(User::pwent)
5abc74
# Optional but highly recommended:
5abc74
%if !%{defined perl_bootstrap}
5abc74
# Prefer Archive::Zip over unzip
5abc74
Requires:       perl(Archive::Zip)
5abc74
Requires:       perl(Compress::Bzip2)
5abc74
Requires:       perl(CPAN::Meta) >= 2.110350
5abc74
%endif
5abc74
Requires:       perl(Compress::Zlib)
5abc74
Requires:       perl(Digest::MD5)
5abc74
# CPAN encourages Digest::SHA strongly because of integrity checks
5abc74
Requires:       perl(Digest::SHA)
5abc74
Requires:       perl(Dumpvalue)
5abc74
Requires:       perl(ExtUtils::CBuilder)
5abc74
%if ! %{defined perl_bootstrap}
5abc74
# Avoid circular deps local::lib -> Module::Install -> CPAN when bootstraping
5abc74
# local::lib recommended by CPAN::FirstTime default choice, bug #1122498
5abc74
Requires:       perl(local::lib)
5abc74
%endif
5abc74
%if ! %{defined perl_bootstrap}
5abc74
Requires:       perl(Module::Build)
5abc74
%endif
5abc74
Recommends:     perl(Pod::Perldoc)
5abc74
%if ! %{defined perl_bootstrap}
5abc74
Recommends:     perl(Term::ReadKey)
5abc74
Requires:       perl(Text::Glob)
5abc74
# Text::Levenshtein::XS or Text::Levenshtein::Damerau::XS or Text::Levenshtein
5abc74
# or Text::Levenshtein::Damerau::PP
5abc74
Suggests:       perl(Text::Levenshtein::Damerau::XS)
5abc74
# YAML::Syck or YAML or Data::Dumper or overload
5abc74
Suggests:       perl(YAML::Syck)
5abc74
%endif
5abc74
Provides:       cpan = %{version}
5abc74
5abc74
# Filter non-Linux dependencies
5abc74
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Mac::BuildTools\\)
5abc74
# Filter under-specified dependencies
5abc74
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(CPAN::Meta::Requirements\\)
5abc74
5abc74
5abc74
%description
5abc74
The CPAN module automates or at least simplifies the make and install of
5abc74
perl modules and extensions. It includes some primitive searching
5abc74
capabilities and knows how to use LWP, HTTP::Tiny, Net::FTP and certain
5abc74
external download clients to fetch distributions from the net.
5abc74
5abc74
%prep
5abc74
%setup -q -n CPAN-%{version}
5abc74
%patch0 -p1
5abc74
%patch1 -p1
5abc74
# Change configuration name
5abc74
find -type f -exec perl -i -pe 's/XCPANCONFIGNAMEX/cpan/g' {} \;
5abc74
# Remove bundled modules
5abc74
rm -r ./inc/*
5abc74
perl -i -ne 'print $_ unless m{^inc/}' MANIFEST
5abc74
5abc74
%build
5abc74
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
5abc74
%{make_build}
5abc74
5abc74
%install
5abc74
%{make_install}
5abc74
%{_fixperms} $RPM_BUILD_ROOT/*
5abc74
5abc74
%check
5abc74
unset AUTHOR_TEST CPAN_EXPECT_TIMEOUT CPAN_RUN_SHELL_TEST_WITHOUT_EXPECT \
5abc74
    ftp_proxy http_proxy no_proxy \
5abc74
    PERL5_CPAN_IS_RUNNING PERL5_CPAN_IS_RUNNING_IN_RECURSION PERL_CORE VERBOSE
5abc74
make test
5abc74
5abc74
%files
5abc74
%doc Changes PAUSE*.pub README Todo
5abc74
%{_bindir}/*
5abc74
%{perl_vendorlib}/*
5abc74
%{_mandir}/man1/*
5abc74
%{_mandir}/man3/*
5abc74
5abc74
%changelog
5abc74
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.28-8
5abc74
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
5abc74
  Related: rhbz#1991688
5abc74
5abc74
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.28-7
5abc74
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
5abc74
5abc74
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-6
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
5abc74
5abc74
* Wed Sep 23 2020 Petr Pisar <ppisar@redhat.com> - 2.28-5
5abc74
- Run-require complete perl
5abc74
5abc74
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-4
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
5abc74
5abc74
* Fri Jun 26 2020 Jitka Plesnikova <jplesnik@redhat.com> - 2.28-3
5abc74
- Perl 5.32 re-rebuild of bootstrapped packages
5abc74
5abc74
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 2.28-2
5abc74
- Perl 5.32 rebuild
5abc74
5abc74
* Mon Jun 15 2020 Petr Pisar <ppisar@redhat.com> - 2.28-1
5abc74
- 2.28 bump
5abc74
5abc74
* Fri Jan 31 2020 Petr Pisar <ppisar@redhat.com> - 2.27-4
5abc74
- Enable loading objects from session YAML files (CPAN RT#131615)
5abc74
5abc74
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.27-3
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
5abc74
5abc74
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.27-2
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
5abc74
5abc74
* Thu Jul 04 2019 Petr Pisar <ppisar@redhat.com> - 2.27-1
5abc74
- 2.27 bump
5abc74
5abc74
* Sun Jun 02 2019 Jitka Plesnikova <jplesnik@redhat.com> - 2.26-3
5abc74
- Perl 5.30 re-rebuild of bootstrapped packages
5abc74
5abc74
* Thu May 30 2019 Jitka Plesnikova <jplesnik@redhat.com> - 2.26-2
5abc74
- Perl 5.30 rebuild
5abc74
5abc74
* Tue Mar 19 2019 Petr Pisar <ppisar@redhat.com> - 2.26-1
5abc74
- 2.26 bump
5abc74
5abc74
* Mon Mar 04 2019 Petr Pisar <ppisar@redhat.com> - 2.25-1
5abc74
- 2.25 bump
5abc74
5abc74
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.22-2
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
5abc74
5abc74
* Wed Jan 02 2019 Petr Pisar <ppisar@redhat.com> - 2.22-1
5abc74
- 2.22 bump
5abc74
5abc74
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.20-418
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
5abc74
5abc74
* Sun Jul 01 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.20-417
5abc74
- Perl 5.28 re-rebuild of bootstrapped packages
5abc74
5abc74
* Tue Jun 26 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.20-416
5abc74
- Increase release to favour standalone package
5abc74
5abc74
* Wed May 23 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.20-1
5abc74
- Upgrade to 2.20 as provided in perl-5.28.0
5abc74
5abc74
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.18-397
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5abc74
5abc74
* Tue Dec 19 2017 Petr Pisar <ppisar@redhat.com> - 2.18-396
5abc74
- Rebase patches to prevent from installing back-up files
5abc74
5abc74
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.18-395
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5abc74
5abc74
* Wed Jun 07 2017 Jitka Plesnikova <jplesnik@redhat.com> - 2.18-394
5abc74
- Perl 5.26 re-rebuild of bootstrapped packages
5abc74
5abc74
* Sat Jun 03 2017 Jitka Plesnikova <jplesnik@redhat.com> - 2.18-393
5abc74
- Perl 5.26 rebuild
5abc74
5abc74
* Fri May 12 2017 Jitka Plesnikova <jplesnik@redhat.com> - 2.18-2
5abc74
- Don't BR: perl(Module::Build) when bootstrapping
5abc74
5abc74
* Wed May 10 2017 Petr Pisar <ppisar@redhat.com> - 2.18-1
5abc74
- Upgrade to CPAN-2.18 as provided in perl-5.25.12
5abc74
5abc74
* Wed Feb 15 2017 Petr Pisar <ppisar@redhat.com> - 2.16-1
5abc74
- 2.16 bump
5abc74
5abc74
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-5
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5abc74
5abc74
* Mon Jan 09 2017 Petr Pisar <ppisar@redhat.com> - 2.14-4
5abc74
- Use Perl porter's fix for searching cpan -j file (CPAN RT#116507)
5abc74
- Fix logging fatal errors (https://github.com/andk/cpanpm/pull/104)
5abc74
5abc74
* Tue Oct 18 2016 Petr Pisar <ppisar@redhat.com> - 2.14-3
5abc74
- Apply remains of CVE-2016-1238 fix from perl (CPAN RT#116507)
5abc74
- Do not search cpan -j file in @INC (CPAN RT#116507)
5abc74
5abc74
* Wed Oct 12 2016 Petr Pisar <ppisar@redhat.com> - 2.14-2
5abc74
- Fix CVE-2016-1238 properly (CPAN RT#116507)
5abc74
5abc74
* Mon Jun 27 2016 Petr Pisar <ppisar@redhat.com> - 2.14-1
5abc74
- 2.14 bump
5abc74
- Fix installation from a working directory (CPAN RT#115734)
5abc74
- Fix "cpan -O" invocation (CPAN RT#115786)
5abc74
- Do not use Net::FTP if ftp_proxy variable points to an HTTP server
5abc74
  (CPAN RT#110833)
5abc74
- Recognize URL schemata disregarding the case
5abc74
- Fix CVE-2016-1238 (loading optional modules from current working directory)
5abc74
- Recognize exact version dependency operator (CPAN RT#47934)
5abc74
- Cope with non-digit version strings
5abc74
5abc74
* Wed May 18 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-366
5abc74
- Perl 5.24 re-rebuild of bootstrapped packages
5abc74
5abc74
* Sat May 14 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-365
5abc74
- Increase release to favour standalone package
5abc74
5abc74
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.11-349
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
5abc74
5abc74
* Tue Dec 15 2015 Petr Pisar <ppisar@redhat.com> - 2.11-348
5abc74
- Require make package
5abc74
5abc74
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-347
5abc74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5abc74
5abc74
* Wed Jun 10 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-346
5abc74
- Perl 5.22 re-rebuild of bootstrapped packages
5abc74
5abc74
* Thu Jun 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-345
5abc74
- Increase release to favour standalone package
5abc74
5abc74
* Thu Jun 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-2
5abc74
- Perl 5.22 rebuild
5abc74
5abc74
* Wed May 06 2015 Petr Pisar <ppisar@redhat.com> - 2.11-1
5abc74
- 2.11 bump in order to dual-live with perl 5.22
5abc74
5abc74
* Fri Mar 13 2015 Petr Pisar <ppisar@redhat.com> - 2.10-1
5abc74
- 2.10 bump
5abc74
5abc74
* Wed Jan 28 2015 Petr Pisar <ppisar@redhat.com> - 2.05-309
5abc74
- Allow changing the configuration directory name
5abc74
5abc74
* Thu Oct 30 2014 Petr Pisar <ppisar@redhat.com> - 2.05-308
5abc74
- Create site paths for the first time (bug #1158873)
5abc74
5abc74
* Wed Sep 10 2014 Petr Pisar <ppisar@redhat.com> 2.05-307
5abc74
- Synchronize to perl.spec modifications
5abc74
- Disable non-core modules when bootstrapping
5abc74
5abc74
* Tue Apr 22 2014 Petr Pisar <ppisar@redhat.com> 2.05-1
5abc74
- Specfile autogenerated by cpanspec 1.78.