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