# 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 #TODO: BR: Test::Pod::No404s when available Name: perl-Class-Load Version: 0.25 Release: 25.%{__distinit}%{__distvers} Summary: A working (require "Class::Name") and more License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Class-Load Source0: https://cpan.metacpan.org/modules/by-module/Class/Class-Load-%{version}.tar.gz Patch0: Class-Load-0.24-stopwords.patch BuildArch: noarch # =================================================================== # Module build requirements # =================================================================== BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) # =================================================================== # Module requirements # =================================================================== BuildRequires: perl(base) BuildRequires: perl(Carp) BuildRequires: perl(Data::OptList) >= 0.110 BuildRequires: perl(Exporter) BuildRequires: perl(Module::Implementation) >= 0.04 BuildRequires: perl(Module::Runtime) >= 0.012 BuildRequires: perl(Package::Stash) >= 0.14 BuildRequires: perl(Scalar::Util) BuildRequires: perl(Try::Tiny) # =================================================================== # Regular test suite requirements # =================================================================== # Class::Load::XS → Class::Load %if 0%{!?perl_bootstrap:1} BuildRequires: perl(Class::Load::XS) %endif BuildRequires: perl(CPAN::Meta) >= 2.120900 BuildRequires: perl(File::Spec) BuildRequires: perl(lib) BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Test::Needs) BuildRequires: perl(Test::Without::Module) BuildRequires: perl(version) # =================================================================== # Author/Release test requirements # =================================================================== %if 0%{!?perl_bootstrap:1} BuildRequires: perl(blib) BuildRequires: perl(Encode) BuildRequires: perl(Test::CPAN::Changes) BuildRequires: perl(Test::CPAN::Meta) BuildRequires: perl(Test::EOL) BuildRequires: perl(Test::Kwalitee) BuildRequires: perl(Test::MinimumVersion) BuildRequires: perl(Test::Mojibake) BuildRequires: perl(Test::More) >= 0.96 BuildRequires: perl(Test::NoTabs) BuildRequires: perl(Test::Pod) >= 1.41 BuildRequires: perl(Test::Portability::Files) BuildRequires: perl(Test::Spelling), hunspell-en %endif # =================================================================== # Runtime requirements # =================================================================== %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif # Also requires core module perl(Exporter) via a "use base" construct %description require EXPR only accepts Class/Name.pm style module names, not Class::Name. How frustrating! For that, we provide load_class 'Class::Name'. It's often useful to test whether a module can be loaded, instead of throwing an error when it's not available. For that, we provide try_load_class 'Class::Name'. Finally, sometimes we need to know whether a particular class has been loaded. Asking %%INC is an option, but that will miss inner packages and any class for which the filename does not correspond to the package name. For that, we provide is_class_loaded 'Class::Name'. %prep %setup -q -n Class-Load-%{version} # Add extra stopwords to spell check test to account for dictionary # coverage differences between distros %patch -P 0 %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 # Author/Release tests %if 0%{!?perl_bootstrap:1} make test TEST_FILES="$(echo $(find xt/ -name '*.t'))" RELEASE_TESTING=1 %endif %files %license LICENSE %doc Changes CONTRIBUTING README %{perl_vendorlib}/Class/ %{_mandir}/man3/Class::Load.3* %changelog * Fri Jun 14 2024 Paul Howarth - 0.25-25 - Avoid use of deprecated patch syntax * Fri Mar 10 2023 Paul Howarth - 0.25-22 - Use SPDX-format license tag - Use %%license unconditionally * Fri Jun 7 2019 Paul Howarth - 0.25-7 - Perl 5.30 rebuild * Mon Jun 11 2018 Paul Howarth - 0.25-1 - Update to 0.25 - Merged required and recommended Data::OptList version prerequisite, to work around CPAN.pm bug (CPAN RT#123447) - Switch upstream from search.cpan.org to metacpan.org - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl * Tue Apr 11 2017 Paul Howarth - 0.24-1 - Update to 0.24 - Fix test to handle altered Test::Without::Module exception message (GH#2) - Update spelling patch * Fri Apr 7 2017 Paul Howarth - 0.23-6 - Fix FTBFS with Test::Without::Module ≥ 0.19 (https://github.com/moose/Class-Load/pull/2) - 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 support for building with Test::More < 0.96 - Can run author/release tests on all supported distributions now - Spell checker is always hunspell now * Tue Aug 9 2016 Paul Howarth - 0.23-4 - Fix FTBFS when perl is not in the minimal buildroot - BR: perl-generators where available - Simplify find command using -delete * Thu Jun 25 2015 Paul Howarth - 0.23-1 - Update to 0.23 - Remove use of namespace::clean - Switch to ExtUtils::MakeMaker flow - Update patches as needed * Thu Sep 4 2014 Paul Howarth - 0.22-1 - Update to 0.22 - Document some of the caveats to using this module, and refer to Module::Runtime as an alternative - Drop %%defattr, redundant since rpm 4.4 - Use %%license where possible - BR: perl(Test::Without::Module), perl(Test::Requires) and perl(Test::CPAN::Changes) unconditionally - Drop now-redundant BR's: perl(Test::Vars) and perl(Test::Version) - Update patches as needed * Mon Feb 10 2014 Paul Howarth - 0.21-1 - Update to 0.21 - Repository moved to the github moose organization - This release by ETHER -> update source URL - Switch to Module::Build::Tiny flow - Package upstream CONTRIBUTING and README.md files - Add manpage for Class::Load::PP to %%files list - Work around failing Pod Coverage test for Class::Load::PP with Perl < 5.10.1 - Update patches as needed * Thu Jan 16 2014 Paul Howarth - 0.20-3 - Don't BR: perl(Test::Spelling) when bootstrapping * Mon Jul 16 2012 Paul Howarth - 0.20-2 - Perl 5.16 post-bootstrap rebuild * Sun Jul 15 2012 Paul Howarth - 0.20-1 - Update to 0.20 - Same as the most recent 0.19, but with a new version (CPAN RT#78389) * Sun Jul 15 2012 Paul Howarth - 0.19-7 - New upstream re-release of 0.19 by DROLSKY - The load_class() subroutine now returns the class name on success (CPAN RT#76931) - Exceptions and errors from Class::Load no longer contain references to line numbers in Class::Load or Module::Runtime; this applies to exceptions thrown by load_class, load_first_existing_class, and load_optional_class, as well as the error returned by try_load_class - Exceptions are now croaked properly so they appear to come from the calling code, not from an internal subroutine; this makes the exceptions look more like the ones thrown by Perl's require (CPAN RT#68663) - This release by DROLSKY -> update source URL - Update patch for building with Test::More < 0.88 * Wed Jul 11 2012 Paul Howarth - 0.19-6 - BR: perl(Exporter), perl(Scalar::Util), and perl(lib) - Add version requirements for perl(Test::Pod) and perl(Test::Pod::Coverage) - Don't BR: perl(strict) and perl(warnings) - not dual-lived * Tue Apr 3 2012 Paul Howarth - 0.19-1 - Update to 0.19 (no functional changes) - This release by DOY -> update source URL - Don't need to remove empty directories from buildroot - Drop support for distributions prior to FC-3: - Don't need to define %%{perl_vendorlib} - Use DESTDIR rather than PERL_INSTALL_ROOT * Sat Feb 18 2012 Paul Howarth - 0.18-1 - Update to 0.18: - Require Package::Stash ≥ 0.14 (CPAN RT#75095) * Sun Feb 12 2012 Paul Howarth - 0.17-1 - Update to 0.17: - Require Module::Runtime 0.012, which has a number of useful bug fixes - A bug in Class::Load caused test failures when Module::Runtime 0.012 was used with Perl 5.8.x (CPAN RT#74897) * Thu Feb 9 2012 Paul Howarth - 0.15-1 - Update to 0.15: - Small test changes to accomodate latest version of Module::Implementation - BR: at least version 0.04 of perl(Module::Implementation) - Update patch for old Test::More versions * Wed Feb 8 2012 Paul Howarth - 0.14-2 - Don't BR: perl(Class::Load::XS) or perl(Pod::Coverage::Moose) if we're bootstrapping - Don't run the release tests when bootstrapping as the Pod coverage test will fail in the absence of Pod::Coverage::Moose * Tue Feb 7 2012 Paul Howarth - 0.14-1 - Update to 0.14: - Use Module::Implementation to handle loading the XS or PP versions of the code; using this module fixes a few bugs - Under taint mode, setting an implementation in the CLASS_LOAD_IMPLEMENTATION env var caused a taint error - An invalid value in the CLASS_LOAD_IMPLEMENTATION env var is now detected and reported immediately; no attempt is made to load an invalid implementation - BR: perl(Module::Implementation) - BR: perl(base), perl(Carp), perl(strict) and perl(warnings) for completeness - Drop version requirement for perl(Package::Stash), no longer present upstream - Drop explicit runtime dependencies, no longer needed - Update patches for old distros * Thu Dec 22 2011 Paul Howarth - 0.13-1 - Update to 0.13: - Fix some bugs with our use of Try::Tiny, which could cause warnings on some systems where Class::Load::XS wasn't installed (CPAN RT#72345) - BR: perl(Test::Without::Module), but only if we have perl > 5.8.6 as the module appears to be incompatible with Package::Stash::XS on older perls (CPAN RT#74151) - Update patches for old distros * Tue Oct 25 2011 Paul Howarth - 0.12-1 - Update to 0.12: - Require Module::Runtime ≥ 0.011, which fixes problems with Catalyst under Perl 5.8 and 5.10 - Add versioned runtime dependencies for Module::Runtime and Package::Stash * Wed Oct 5 2011 Paul Howarth - 0.11-1 - Update to 0.11: - Don't accept package names that start with a digit - Rewrite some of the guts to use Module::Runtime rather than reimplementing its functionality - Drop patches to support building without Test::Fatal or Pod::Coverage::Moose since these are only needed with perl < 5.8.1 and we need at least 5.8.1 for Package::Stash - Update patch for building with old Test::More versions * Tue Sep 6 2011 Paul Howarth - 0.10-1 - Update to 0.10: - Make sure the $@ localization doesn't hide errors - invalid module name errors were being suppressed on perls before 5.14 * Tue Sep 6 2011 Paul Howarth - 0.09-1 - Update to 0.09: - Fix is_class_loaded to ignore $ISA (but still look for @ISA) when trying to determine whether a class is loaded - Lots of internals cleanup - BR: perl(Package::Stash) ≥ 0.32 and perl(Try::Tiny) - BR: aspell-en rather than just aspell with perl ≥ 5.8.1 - Update patches to apply cleanly * Tue Aug 16 2011 Paul Howarth - 0.08-1 - Update to 0.08: - The previous version was missing a prereq declaration for Data::OptList (CPAN RT#70285) - This release by DROLSKY -> update source URL - Package new documentation: LICENSE and README - Add build requirements for new release tests and run them: - perl(Pod::Coverage::Moose) - perl(Test::CPAN::Changes) - perl(Test::EOL) - perl(Test::NoTabs) - perl(Test::Pod) - perl(Test::Pod::Coverage) - perl(Test::Requires) - perl(Test::Spelling) and aspell/aspell-en-gb - Add patch for building with ExtUtils::MakeMaker < 6.30 - Add patch for building with Test::More < 0.88 - Add patch for building without Pod::Coverage::Moose - Add patch for building without Test::Requires - Add patch for fixing spell checker word list - Update patch for building without Test::Fatal (using Test::Exception) * Wed Jun 22 2011 Paul Howarth - 0.06-5 - Rebuild for perl 5.14.1 in Rawhide - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Mon Nov 22 2010 Paul Howarth - 0.06-1 - Initial RPM version