Blob Blame History Raw
Name:		perl-Class-Load
Version:	0.10
Release:	1%{?dist}
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.09-old-Test::More.patch
Patch2:		Class-Load-0.09-old-eu::mm.patch
Patch3:		Class-Load-0.08-no-Test::Requires.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)
BuildRequires:	perl(Package::Stash) >= 0.32
BuildRequires:	perl(Try::Tiny)
# ===================================================================
# Regular test suite requirements
# ===================================================================
BuildRequires:	perl(Test::Fatal)
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
# Modules not in EPEL-4
%if 0%{?fedora} || 0%{?rhel} > 4
BuildRequires:	perl(Test::Requires)
%endif
# Modules not in EPEL-4/5/6
%if 0%{?fedora} || 0%{?rhel} > 6
BuildRequires:	perl(Pod::Coverage::Moose)
BuildRequires:	perl(Test::CPAN::Changes)
%endif
# ===================================================================
# Runtime requirements
# ===================================================================
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# 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}

# We need to patch the test suite if we have Test::More < 0.88
%if "%{?rhel}" == "4" || "%{?rhel}" == "5"
%patch0 -p1
%endif

# Work around absence of Test::Requires and ancient ExtUtils::MakeMaker if necessary
%if "%{?rhel}" == "4"
%patch2 -p1
%patch3 -p1
%endif

# 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 DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
%{_fixperms} %{buildroot}

%check
# Pod Coverage test breaks the build if we don't have Pod::Coverage::Moose
%if ! 0%{?fedora} && 0%{?rhel} <= 6
mv t/release-pod-coverage.t .
%endif
make test RELEASE_TESTING=1
[ -f release-pod-coverage.t ] && mv release-pod-coverage.t t/

%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 <paul@city-fan.org> - 0.10-1
- Update to 0.10:
  - 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)
- Update patches to apply cleanly

* Tue Aug 16 2011 Paul Howarth <paul@city-fan.org> - 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-en
- Add patch for building with ExtUtils::MakeMaker < 6.30
- Add patch for building with Test::More < 0.88
- Add patch for building without Test::Requires
- Add patch for fixing spell checker word list
- Don't try to run the POD Coverage test if we don't have Pod::Coverage::Moose

* Tue Jun 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.06-5
- Perl mass rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.06-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Dec 21 2010 Paul Howarth <paul@city-fan.org> - 0.06-3
- Drop explicit dependency on core module perl(Exporter) (#656408)

* Tue Nov 23 2010 Paul Howarth <paul@city-fan.org> - 0.06-2
- Sanitize spec for Fedora submission

* Mon Nov 22 2010 Paul Howarth <paul@city-fan.org> - 0.06-1
- Initial RPM version