# 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 # perl_vendorlib/perl_vendorarch not defined by default prior to F-2 %{!?perl_vendorlib: %global perl_vendorlib %(eval "`perl -V:installvendorlib`"; echo $installvendorlib)} Name: perl-Class-Load Version: 0.08 Release: 2.%{__distinit}%{__distvers} Summary: A working (require "Class::Name") and more Group: Development/Libraries License: GPL+ or Artistic URL: http://search.cpan.org/dist/Class-Load/ Source0: http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Class-Load-%{version}.tar.gz Patch0: Class-Load-0.08-old-Test::More.patch Patch1: Class-Load-0.08-no-Test::Fatal.patch Patch2: Class-Load-0.08-old-eu::mm.patch Patch3: Class-Load-0.08-no-Test::Requires.patch Patch4: Class-Load-0.08-no-Moose.patch Patch5: Class-Load-0.08-stopwords.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) # =================================================================== # Module build requirements # =================================================================== BuildRequires: perl(ExtUtils::MakeMaker) # =================================================================== # Module requirements # =================================================================== BuildRequires: perl(Data::OptList) # =================================================================== # Regular test suite requirements # =================================================================== BuildRequires: perl(Test::Exception) BuildRequires: perl(Test::More) BuildRequires: perl(version) # =================================================================== # Author/Release test requirements # =================================================================== BuildRequires: perl(Test::EOL) BuildRequires: perl(Test::NoTabs) BuildRequires: perl(Test::Pod) BuildRequires: perl(Test::Pod::Coverage) BuildRequires: perl(Test::Spelling), aspell-en-gb # =================================================================== # Runtime requirements # =================================================================== Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %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} # We need to patch the test suite as our Test::More is too old %patch0 -p1 # On perl 5.8.0, have to use Test::Exception rather than Test::Fatal %patch1 -p1 # We don't really need ExtUtils::MakeMaker ≥ 6.30 %patch2 -p1 # Test::Requires needs Test::Builder::Module, unavailable for perl 5.8.0 %patch3 -p1 # No Moose on perl 5.8.0 either %patch4 -p1 # Add extra stopwords to spell check test to account for dictionary # coverage differences between distros %patch5 -p1 %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf %{buildroot} make pure_install PERL_INSTALL_ROOT=%{buildroot} find %{buildroot} -type f -name .packlist -exec rm -f {} ';' find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null %{_fixperms} %{buildroot} %check make test RELEASE_TESTING=1 %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc Changes LICENSE README %{perl_vendorlib}/Class/ %{_mandir}/man3/Class::Load.3pm* %changelog * Tue Sep 6 2011 Paul Howarth - 0.08-2 - Remove conditionals as we know we have ancient versions of everything * 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