d52fc5
# Add support for IPv6
d52fc5
%{bcond_without perl_Net_HTTP_enables_ipv6}
d52fc5
# Do not run network tests accessing Internet
d52fc5
%{bcond_with perl_Net_HTTP_enables_network_test}
d52fc5
# Add support for TLS/SSL
d52fc5
%{bcond_without perl_Net_HTTP_enables_ssl}
d52fc5
d52fc5
Name:           perl-Net-HTTP
d52fc5
Version:        6.21
d52fc5
Release:        3%{?dist}
d52fc5
Summary:        Low-level HTTP connection (client)
d52fc5
License:        GPL+ or Artistic
d52fc5
URL:            https://metacpan.org/release/Net-HTTP
d52fc5
Source0:        https://cpan.metacpan.org/authors/id/O/OA/OALDERS/Net-HTTP-%{version}.tar.gz
d52fc5
BuildArch:      noarch
d52fc5
BuildRequires:  coreutils
d52fc5
BuildRequires:  make
d52fc5
BuildRequires:  perl-generators
d52fc5
BuildRequires:  perl-interpreter
d52fc5
BuildRequires:  perl(:VERSION) >= 5.6.2
d52fc5
BuildRequires:  perl(Config)
d52fc5
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
d52fc5
BuildRequires:  perl(Getopt::Long)
d52fc5
BuildRequires:  perl(strict)
d52fc5
# Run-time:
d52fc5
BuildRequires:  perl(base)
d52fc5
BuildRequires:  perl(Carp)
d52fc5
BuildRequires:  perl(Compress::Raw::Zlib)
d52fc5
# Prefer IO::Socket::IP over IO::Socket::INET and IO::Socket::INET6
d52fc5
%if %{with perl_Net_HTTP_enables_ipv6}
d52fc5
BuildRequires:  perl(IO::Socket::IP)
d52fc5
%else
d52fc5
BuildRequires:  perl(IO::Socket)
d52fc5
%endif
d52fc5
%if %{with perl_Net_HTTP_enables_ssl}
d52fc5
# IO::Socket::SSL or Net::SSL
d52fc5
BuildRequires:  perl(IO::Socket::SSL) >= 2.012
d52fc5
%endif
d52fc5
BuildRequires:  perl(IO::Uncompress::Gunzip)
d52fc5
BuildRequires:  perl(Symbol)
d52fc5
BuildRequires:  perl(URI)
d52fc5
BuildRequires:  perl(warnings)
d52fc5
# Tests only:
d52fc5
BuildRequires:  perl(Data::Dumper)
d52fc5
BuildRequires:  perl(File::Spec)
d52fc5
BuildRequires:  perl(IO::Select)
d52fc5
BuildRequires:  perl(IO::Socket::INET)
d52fc5
BuildRequires:  perl(Socket)
d52fc5
BuildRequires:  perl(Test::More)
d52fc5
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
d52fc5
Requires:       perl(Compress::Raw::Zlib)
d52fc5
Requires:       perl(IO::Uncompress::Gunzip)
d52fc5
# Prefer IO::Socket::IP over IO::Socket::INET and IO::Socket::INET6
d52fc5
%if %{with perl_Net_HTTP_enables_ipv6}
d52fc5
Requires:       perl(IO::Socket::IP)
d52fc5
%else
d52fc5
Requires:       perl(IO::Socket)
d52fc5
%endif
d52fc5
Requires:       perl(Symbol)
d52fc5
%if %{with perl_Net_HTTP_enables_ssl}
d52fc5
Requires:       perl(IO::Socket::SSL) >= 2.012
d52fc5
%endif
d52fc5
Conflicts:      perl-libwww-perl < 6
d52fc5
d52fc5
%description
d52fc5
The Net::HTTP class is a low-level HTTP client. An instance of the
d52fc5
Net::HTTP class represents a connection to an HTTP server. The HTTP
d52fc5
protocol is described in RFC 2616. The Net::HTTP class supports HTTP/1.0
d52fc5
and HTTP/1.1.
d52fc5
d52fc5
%package tests
d52fc5
Summary:        Tests for %{name}
d52fc5
Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
d52fc5
Requires:       perl-Test-Harness
d52fc5
%if %{with perl_Net_HTTP_enables_network_test}
d52fc5
%if %{with perl_Net_HTTP_enables_ssl}
d52fc5
Requires:  perl(IO::Socket::SSL) >= 2.012
d52fc5
%endif
d52fc5
%endif
d52fc5
d52fc5
%description tests
d52fc5
Tests from %{name}. Execute them
d52fc5
with "%{_libexecdir}/%{name}/test".
d52fc5
d52fc5
%prep
d52fc5
%setup -q -n Net-HTTP-%{version}
d52fc5
%if %{without perl_Net_HTTP_enables_network_test}
d52fc5
rm t/live*.t
d52fc5
perl -i -ne 'print $_ unless m{^t/live.*\.t}' MANIFEST
d52fc5
%endif
d52fc5
# Help generators to recognize a Perl code
d52fc5
for F in t/*.t; do
d52fc5
    perl -i -MConfig -pe 'print qq{$Config{startperl}\n} if $. == 1 && !s{\A#!.*\bperl}{$Config{startperl}}' "$F"
d52fc5
    chmod +x "$F"
d52fc5
done
d52fc5
d52fc5
%build
d52fc5
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
d52fc5
%{make_build}
d52fc5
d52fc5
%install
d52fc5
%{make_install}
d52fc5
%{_fixperms} $RPM_BUILD_ROOT/*
d52fc5
# Install tests
d52fc5
mkdir -p %{buildroot}%{_libexecdir}/%{name}
d52fc5
cp -a t %{buildroot}%{_libexecdir}/%{name}
d52fc5
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
d52fc5
#!/bin/sh
d52fc5
set -e
d52fc5
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
d52fc5
EOF
d52fc5
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
d52fc5
d52fc5
%check
d52fc5
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
d52fc5
make test
d52fc5
d52fc5
%files
d52fc5
%license LICENSE
d52fc5
%doc Changes CONTRIBUTORS README.md
d52fc5
%{perl_vendorlib}/*
d52fc5
%{_mandir}/man3/*
d52fc5
d52fc5
%files tests
d52fc5
%{_libexecdir}/%{name}
d52fc5
d52fc5
%changelog
d52fc5
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 6.21-3
d52fc5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
d52fc5
  Related: rhbz#1991688
d52fc5
d52fc5
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.21-2
d52fc5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
d52fc5
d52fc5
* Fri Mar 19 2021 Petr Pisar <ppisar@redhat.com> - 6.21-1
d52fc5
- 6.21 bump
d52fc5
- Package tests
d52fc5
d52fc5
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.20-2
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d52fc5
d52fc5
* Mon Jan 11 2021 Petr Pisar <ppisar@redhat.com> - 6.20-1
d52fc5
- 6.20 bump
d52fc5
d52fc5
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.19-6
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d52fc5
d52fc5
* Tue Jun 23 2020 Jitka Plesnikova <jplesnik@redhat.com> - 6.19-5
d52fc5
- Perl 5.32 rebuild
d52fc5
d52fc5
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.19-4
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d52fc5
d52fc5
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.19-3
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d52fc5
d52fc5
* Fri May 31 2019 Jitka Plesnikova <jplesnik@redhat.com> - 6.19-2
d52fc5
- Perl 5.30 rebuild
d52fc5
d52fc5
* Fri May 17 2019 Petr Pisar <ppisar@redhat.com> - 6.19-1
d52fc5
- 6.19 bump
d52fc5
d52fc5
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.18-4
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d52fc5
d52fc5
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.18-3
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d52fc5
d52fc5
* Thu Jun 28 2018 Jitka Plesnikova <jplesnik@redhat.com> - 6.18-2
d52fc5
- Perl 5.28 rebuild
d52fc5
d52fc5
* Thu May 10 2018 Jitka Plesnikova <jplesnik@redhat.com> - 6.18-1
d52fc5
- 6.18 bump
d52fc5
d52fc5
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.17-2
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
d52fc5
d52fc5
* Mon Sep 04 2017 Petr Pisar <ppisar@redhat.com> - 6.17-1
d52fc5
- 6.17 bump
d52fc5
d52fc5
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.16-3
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
d52fc5
d52fc5
* Mon Jun 05 2017 Jitka Plesnikova <jplesnik@redhat.com> - 6.16-2
d52fc5
- Perl 5.26 rebuild
d52fc5
d52fc5
* Tue May 30 2017 Petr Pisar <ppisar@redhat.com> - 6.16-1
d52fc5
- 6.16 bump
d52fc5
d52fc5
* Mon May 15 2017 Petr Pisar <ppisar@redhat.com> - 6.15-1
d52fc5
- 6.15 bump
d52fc5
d52fc5
* Tue Apr 25 2017 Petr Pisar <ppisar@redhat.com> - 6.14-1
d52fc5
- 6.14 bump
d52fc5
d52fc5
* Mon Feb 20 2017 Petr Pisar <ppisar@redhat.com> - 6.13-1
d52fc5
- 6.13 bump
d52fc5
d52fc5
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.12-2
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d52fc5
d52fc5
* Fri Jan 06 2017 Petr Pisar <ppisar@redhat.com> - 6.12-1
d52fc5
- 6.12 bump
d52fc5
d52fc5
* Mon May 16 2016 Jitka Plesnikova <jplesnik@redhat.com> - 6.09-5
d52fc5
- Perl 5.24 rebuild
d52fc5
d52fc5
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 6.09-4
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
d52fc5
d52fc5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.09-3
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
d52fc5
d52fc5
* Sat Jun 06 2015 Jitka Plesnikova <jplesnik@redhat.com> - 6.09-2
d52fc5
- Perl 5.22 rebuild
d52fc5
d52fc5
* Thu May 21 2015 Petr Pisar <ppisar@redhat.com> - 6.09-1
d52fc5
- 6.09 bump
d52fc5
d52fc5
* Thu Aug 28 2014 Jitka Plesnikova <jplesnik@redhat.com> - 6.07-2
d52fc5
- Perl 5.20 rebuild
d52fc5
d52fc5
* Tue Jul 29 2014 Petr Pisar <ppisar@redhat.com> - 6.07-1
d52fc5
- 6.07 bump
d52fc5
d52fc5
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.06-5
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
d52fc5
d52fc5
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.06-4
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
d52fc5
d52fc5
* Wed Jul 31 2013 Petr Pisar <ppisar@redhat.com> - 6.06-3
d52fc5
- Specify all dependencies
d52fc5
d52fc5
* Tue Jul 23 2013 Petr Pisar <ppisar@redhat.com> - 6.06-2
d52fc5
- Perl 5.18 rebuild
d52fc5
d52fc5
* Mon Mar 11 2013 Petr Pisar <ppisar@redhat.com> - 6.06-1
d52fc5
- 6.06 bump
d52fc5
d52fc5
* Fri Mar 08 2013 Petr Pisar <ppisar@redhat.com> - 6.05-3
d52fc5
- Handle IO::Socket::SSL as non-blocking (bug #768394)
d52fc5
d52fc5
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.05-2
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
d52fc5
d52fc5
* Tue Nov 13 2012 Petr Pisar <ppisar@redhat.com> - 6.05-1
d52fc5
- 6.05 bump
d52fc5
d52fc5
* Fri Nov 09 2012 Petr Pisar <ppisar@redhat.com> - 6.04-1
d52fc5
- 6.04 bump
d52fc5
d52fc5
* Mon Aug 13 2012 Petr Pisar <ppisar@redhat.com> - 6.03-4
d52fc5
- Specify all dependencies
d52fc5
d52fc5
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.03-3
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
d52fc5
d52fc5
* Thu Jun 14 2012 Petr Pisar <ppisar@redhat.com> - 6.03-2
d52fc5
- Perl 5.16 rebuild
d52fc5
d52fc5
* Mon Feb 20 2012 Petr Pisar <ppisar@redhat.com> - 6.03-1
d52fc5
- 6.03 bump: Restore blocking override for Net::SSL (RT #72790)
d52fc5
d52fc5
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.02-2
d52fc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
d52fc5
d52fc5
* Tue Nov 22 2011 Petr Pisar <ppisar@redhat.com> - 6.02-1
d52fc5
- 6.02 bump
d52fc5
- Fixes HTTPS time-out in LWP::UserAgent/IO::Socket::SSL (bug #750793)
d52fc5
d52fc5
* Tue Jul 19 2011 Petr Sabata <contyk@redhat.com> - 6.01-2
d52fc5
- Perl mass rebuild
d52fc5
d52fc5
* Mon Apr 18 2011 Petr Pisar <ppisar@redhat.com> - 6.01-1
d52fc5
- 6.01 bump
d52fc5
d52fc5
* Thu Mar 17 2011 Petr Pisar <ppisar@redhat.com> 6.00-1
d52fc5
- Specfile autogenerated by cpanspec 1.78.
d52fc5
- Remove BuildRoot stuff
d52fc5
- Conflicts with perl-libwww-perl-5* and older