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