# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify CentOS Linux and Scientific Linux as rhel %if "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "sl" || "%{__distinit}" == "sls" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # I wish upstream would stick to version numbers with the same number of digits %global cpanversion 1.163 Summary: HTTP-SimpleLinkChecker module for perl Name: perl-HTTP-SimpleLinkChecker Version: 1.16.3 Release: 2.%{__distinit}%{__distvers} License: GPL+ or Artistic Group: Development/Libraries Url: http://search.cpan.org/dist/HTTP-SimpleLinkChecker/ Source0: http://search.cpan.org/CPAN/authors/id/B/BD/BDFOY/HTTP-SimpleLinkChecker-%{cpanversion}.tar.gz Patch0: HTTP-SimpleLinkChecker-1.163-links.patch Patch1: HTTP-SimpleLinkChecker-1.163-EU::MM.patch Patch2: HTTP-SimpleLinkChecker-1.163-ssl_opts.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch # Module Build BuildRequires: findutils BuildRequires: make BuildRequires: perl %if 0%{?fedora} > 20 || 0%{?rhel} > 7 BuildRequires: perl-generators %endif BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 BuildRequires: perl(File::Spec) BuildRequires: perl(File::Spec::Functions) BuildRequires: perl(Test::Manifest) >= 1.21 # Module Runtime BuildRequires: perl(Exporter) BuildRequires: perl(HTTP::Request) >= 1.28 BuildRequires: perl(LWP::UserAgent) >= 1.09 BuildRequires: perl(strict) BuildRequires: perl(vars) BuildRequires: perl(warnings) # Script Runtime BuildRequires: perl(HTTP::Status) # Test Suite BuildRequires: perl(IO::Socket::SSL) BuildRequires: perl(LWP::Protocol::https) BuildRequires: perl(Test::More) # Optional tests BuildRequires: perl(Test::Pod) >= 1.00 BuildRequires: perl(Test::Pod::Coverage) # Runtime Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %description You don't have to know anything about objected-oriented Perl, LWP, or the HTTP module to be able to check your links. This module is designed for the casual user. It has one function, check_link, that returns the HTTP response code that it receives when it tries to fetch the web address passed to it. The undef value is returned for any failure and the $HTTP::SimpleLinkChecker::ERROR variable is set. The HEAD method is tried first, although if anything other than a good status code (those less than 400) is received, another request is made with the GET method. %prep %setup -q -n HTTP-SimpleLinkChecker-%{cpanversion} # Use links that work for the test suite %patch0 # Really don't need such a new ExtUtils::MakeMaker %patch1 # Support LWP::UserAgent < 6.00 %patch2 %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf %{buildroot} make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} %{buildroot} # If we have an old ExtUtils::MakeMaker, README.pod could get installed, which we don't want rm -f %{buildroot}%{_mandir}/man3/HTTP::README.3pm rm -f %{buildroot}%{perl_vendorlib}/HTTP/README.pod %check make test %clean rm -rf %{buildroot} %files %if 0%{?_licensedir:1} %license LICENSE %else %doc LICENSE %endif %doc Changes README.pod %{_bindir}/http_status %{perl_vendorlib}/HTTP/ %{_mandir}/man1/http_status.1* %{_mandir}/man3/HTTP::SimpleLinkChecker.3* %changelog * Tue Aug 2 2016 Paul Howarth - 1.16.3-2 - BR: perl-generators where available - Avoid installing README.pod with old ExtUtils::MakeMaker versions - Simplify find command using -delete * Thu Jan 14 2016 Paul Howarth - 1.16.3-1 - Update to 1.163 - Handle HTTPS, now that LWP needs extra help - Fix prereq test (CPAN RT#111166) - Fix up MANIFEST - Update links patch, supporting old versions of Test::More - Add patch to support building with ExtUtils::MakeMaker < 6.64 - Add patch to support HTTPS with LWP::UserAgent < 6.00 * Mon Jun 22 2015 Paul Howarth - 1.16-6 - Use links that work for the test suite - Classify buildreqs by usage * Tue Sep 2 2014 Paul Howarth - 1.16-5 - Drop %%defattr, redundant since rpm 4.4 - Use %%license where possible * Tue Jul 3 2012 Paul Howarth - 1.16-4 - BR: perl(base), perl(ExtUtils::MakeMaker), perl(Test::Manifest) and perl(Test::More) - Drop explicit perl(Exporter) runtime dependency, detected automatically from rpm 4.9, not needed prior to that as the module is bundled with perl - Don't need to remove empty directories from the buildroot - Drop support for old distributions prior to FC-3: - Don't need to define %%{perl_vendorlib} - Use DESTDIR rather than PERL_INSTALL_ROOT * Mon Jun 27 2011 Paul Howarth - 1.16-3 - Rebuild for perl 5.14.1 in Rawhide - Use %%{_fixperms} macro rather than our own %%{__chmod} incantation - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Fri Jun 25 2010 Paul Howarth - 1.16-2 - Rebuild for perl 5.12.1 in Rawhide * Mon May 24 2010 Paul Howarth - 1.16-1 - Update to 1.16 (fix 403 status test - CPAN RT#57584) - Drop patch for 403.t, no longer needed * Thu May 13 2010 Paul Howarth - 1.15-5 - Fix dist tag for RHEL-6 Beta - Add patch for 403.t to use a working URL * Fri Feb 12 2010 Paul Howarth - 1.15-4 - Drop explicit perl-libwww-perl dep and req/buildreq specific perl modules - BR/Req perl(Exporter), used in "use base" clause - Dist tag for Rawhide no longer needs special-casing * Thu Jun 25 2009 Paul Howarth - 1.15-3 - Define RPM macros in global scope * Tue Mar 11 2008 Paul Howarth - 1.15-2 - Rebuild for perl 5.10.0 on Fedora 9 * Mon Dec 10 2007 Paul Howarth - 1.15-1 - Update to 1.15 - httpstatus renamed to http_status * Tue Nov 27 2007 Paul Howarth - 1.14-1 - Update to 1.14 - Add binary and manpage for httpstatus * Wed Nov 7 2007 Paul Howarth - 1.13-2 - Fix dist tag for Fedora 7 onwards - Clarify license as GPL version 1 or later, or Artistic (i.e. same as perl) * Wed Jan 10 2007 Paul Howarth - 1.13-1 - Update to 1.13 - Include LICENSE file * Tue Jan 2 2007 Paul Howarth - 1.11-1 - Update to 1.11 - Fix argument order for find with -depth - Add buildreqs perl(Test::Pod) and perl(Test::Pod::Coverage) for better test cover * Fri Sep 1 2006 Paul Howarth - 1.10-2 - Fix distribution tags for development releases - Use search.cpan.org URL * Thu Jun 8 2006 Paul Howarth - 1.10-1 - Update to 1.10 - Simplify distribution-detection code - Define %%{__id_u} in a more portable way - Remove macros %%{__perl_package} and %%{__perl_version} - Remove buildroot unconditionally in %%clean and %%install - Don't use macros in command paths, hardcode them instead - Add Test::Prereq as an additional buildreq for improved test cover * Fri Jul 8 2005 Paul Howarth - 1.09-1 - Update to 1.09 - Rewrite spec file in (mainly) Fedora Extras style - Include full URL for source - Fix URL - Use MODULE_COMPAT dependency style and remove explicit perl dependency - Remove MANIFEST from %%doc * Fri Apr 1 2005 Paul Howarth - 1.08-1 - Update to 1.08 * Wed Feb 9 2005 Paul Howarth - 1.07-1 - Update to 1.07 * Wed Oct 27 2004 Paul Howarth - 1.06-1 - Update to 1.06 - Tidy up spec file * Mon May 10 2004 Paul Howarth - 1.04-1 - Initial build