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