# 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 Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif %global distro %{__distinit}%{__distvers} Summary: A simple way to extract links Name: perl-HTML-SimpleLinkExtor Version: 1.273 Release: 2.%{distro} License: Artistic-2.0 URL: https://metacpan.org/release/HTML-SimpleLinkExtor Source0: https://cpan.metacpan.org/modules/by-module/HTML/HTML-SimpleLinkExtor-%{version}.tar.gz BuildArch: noarch # Module build requirements BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) >= 6.64 BuildRequires: perl(File::Spec) BuildRequires: perl(File::Spec::Functions) # Module requirements BuildRequires: perl(AutoLoader) BuildRequires: perl(Carp) BuildRequires: perl(HTML::LinkExtor) >= 1.28 BuildRequires: perl(LWP::UserAgent) BuildRequires: perl(parent) BuildRequires: perl(strict) BuildRequires: perl(subs) BuildRequires: perl(URI) >= 1.09 BuildRequires: perl(vars) BuildRequires: perl(warnings) # Test suite requirements BuildRequires: perl(Test::Manifest) >= 1.21 BuildRequires: perl(Test::More) >= 0.96 BuildRequires: perl(Test::Most) BuildRequires: perl(Test::Output) BuildRequires: perl(Test::Pod) BuildRequires: perl(Test::Pod::Coverage) BuildRequires: perl(URI::file) # Runtime requirements, not automatically detected %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif Requires: perl(HTML::LinkExtor) >= 1.28 Requires: perl(URI) >= 1.09 %description This is a simple HTML link extractor designed for the person who does not want to deal with the intricacies of HTML::Parser or the dereferencing needed to get links out of HTML::LinkExtor. You can extract all the links or some of the links (based on the HTML tag name or attribute name). If a tag is found, all of the relative URLs will be resolved according to that reference. %prep %setup -q -n HTML-SimpleLinkExtor-%{version} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} %check make test %files %license LICENSE %doc Changes README.pod %{_bindir}/linktractor %{perl_vendorlib}/HTML/ %{perl_vendorlib}/auto/HTML/ %{_mandir}/man1/linktractor.1* %{_mandir}/man3/HTML::SimpleLinkExtor.3* %changelog * Mon Jul 17 2023 Paul Howarth - 1.273-2 - Use SPDX-format license tag - Drop support for building with ExtUtils::MakeMaker < 6.64 - Use %%license unconditionally * Sat Nov 14 2020 Paul Howarth - 1.273-1 - Update to 1.273 - Module adopted by Nigel Horne (no code changes) * Mon Jul 22 2019 Paul Howarth - 1.272-1 - Update to 1.272 - Upstream author Brian D Foy has abandoned the module * Tue Jun 5 2018 Paul Howarth - 1.271-1 - Update to 1.271 - Change to the Artistic License 2.0 - Switch upstream from search.cpan.org to metacpan.org - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - Drop workaround for building with Test::More < 0.96 - Drop workaround for Bug #472354 * Thu Aug 25 2016 Paul Howarth - 1.27-3 - BR: perl-generators where available - Simplify find command using -delete * Thu Sep 11 2014 Paul Howarth - 1.27-2 - Drop %%defattr, redundant since rpm 4.4 - Use %%license where possible * Tue Jan 7 2014 Paul Howarth - 1.27-1 - Update to 1.27 - Add the test for CPAN RT#87288 to test_manifest - Update patch for old Test::More versions - Add new patch to support building with ExtUtils::MakeMaker < 6.64 * Mon Jan 6 2014 Paul Howarth - 1.26-1 - Update to 1.26 - Filter links by allowed tags (CPAN RT#87288) - Get rid of MYMETA - Update patch for old Test::More versions * Fri Jul 6 2012 Paul Howarth - 1.25-2 - BR: perl(HTML::LinkExtor) rather than perl(HTML::Parser) - BR: perl(LWP::UserAgent) rather than perl(LWP::Simple) - BR: perl-libwww-perl on F-8 to F-11 to work around Bug #472354 - BR: perl(AutoLoader), perl(Carp), perl(File::Spec), perl(Test::Manifest), perl(Test::More) and perl(URI::file) - 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 - Use %%{_fixperms} macro rather than our own chmod incantation * Fri Aug 5 2011 Paul Howarth - 1.25-1 - Update to 1.25 - Needs Test::More 0.96 for subtests without explicit done_testing (CPAN RT#70042) - Update patch for old Test::More versions * Thu Aug 4 2011 Paul Howarth - 1.24-1 - Update to 1.24 - Fix clear_links so it actually clears the links - Convert most tests to use subtest and Test::More 0.90 - Cleanups for the move to Github - Drop manpage patch, no longer needed - Add patch to support building with Test::More < 0.96 (CPAN RT#70042) * Tue Jul 26 2011 Paul Howarth - 1.23-6 - Rebuild for perl 5.14.1 in Rawhide - Fix dist tag for CentOS 6 and Scientific Linux * Fri Apr 22 2011 Paul Howarth - 1.23-5 - Nobody else likes macros for commands * Fri Jun 25 2010 Paul Howarth - 1.23-4 - Rebuild for perl 5.12.1 in Rawhide * Thu May 13 2010 Paul Howarth - 1.23-3 - Fix dist tag for RHEL-6 Beta * Fri Mar 5 2010 Paul Howarth - 1.23-2 - Dist tag for Rawhide no longer needs special-casing * Mon Jun 1 2009 Paul Howarth - 1.23-1 - Update to 1.23 (iframe patch upstreamed, RT #45198) - Add patch to restore manpage for HTML::SimpleLinkExtor * Wed May 13 2009 Paul Howarth - 1.22-2 - Apply patch to example HTML files to terminate iframe section, as HTML::Parser > 3.56 ignores links in iframe sections, causing tests to fail - Update to SLES-compatible dist tag macros * Mon Sep 8 2008 Paul Howarth - 1.22-1 - Update to 1.22 * Mon Sep 1 2008 Paul Howarth - 1.21-1 - Update to 1.21 - Tweak dist tag macros to work on current Rawhide with three-part releasenum - Add buildreq perl(Test::Output) * Tue Mar 11 2008 Paul Howarth - 1.19-2 - Rebuild for perl 5.10.0 on Fedora 9 * Fri Dec 7 2007 Paul Howarth - 1.19-1 - Update to 1.19 * Tue Nov 27 2007 Paul Howarth - 1.18-1 - Update to 1.18 - Clarify license as GPL version 1 or later, or Artistic (i.e. same as perl) * Mon Mar 19 2007 Paul Howarth - 1.17-1 - Update to 1.17 - Fix dist tag for Fedora 7 onwards - Add buildreq perl(ExtUtils::MakeMaker) * Wed Jan 10 2007 Paul Howarth - 1.16-1 - Update to 1.16 * Fri Jan 5 2007 Paul Howarth - 1.15-1 - Update to 1.15 - Add buildreq perl(LWP::Simple), needed for test suite * Wed Jan 3 2007 Paul Howarth - 1.14-1 - Update to 1.14 - Fix argument order for find with -depth - Add linktractor program and manpage - Add buildreq perl(Test::Pod::Coverage) for better test cover - Include LICENSE file * Fri Sep 1 2006 Paul Howarth - 1.13-2 - Fix distribution tags for development releases * Mon May 29 2006 Paul Howarth - 1.13-1 - Update to 1.13 - Define %%{__id_u} in a more portable way * Fri Jan 13 2006 Paul Howarth - 1.12-1 - Update to 1.12 - Clarify spec by removing __perl_version and __perl_package macros - Simplify distribution-detection - Don't use macros in build-time command paths, hardcode them instead - Unconditionally remove buildroot in %%clean and %%install - Use search.cpan.org URLs - Don't include generic README file * Thu Aug 25 2005 Paul Howarth - 1.11-1 - Update to 1.11 - Remove redundant optmization flags - Add BR: Test::Pod for better test cover * Fri Jul 8 2005 Paul Howarth - 1.09-2 - Rewrite spec file in (mainly) Fedora Extras style - Include full URL for source - Use MODULE_COMPAT dependency style and remove explicit perl dependency - Remove MANIFEST from %%doc * Fri Apr 1 2005 Paul Howarth - 1.09-1 - Update to 1.09 * Wed Oct 27 2004 Paul Howarth - 1.08-1 - Update to 1.08 - Tidy up spec file * Mon May 10 2004 Paul Howarth - 0.72-1 - Initial build