Blob Blame History Raw
Name:		perl-Package-Stash-XS
Version:	0.19
Release:	1%{?dist}
Summary:	Faster and more correct implementation of the Package::Stash API
Group:		Development/Libraries
License:	GPL+ or Artistic
URL:		http://search.cpan.org/dist/Package-Stash-XS/
Source0:	http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Package-Stash-XS-%{version}.tar.gz
Patch0:		Package-Stash-XS-0.17-old-eumm.patch
Patch1:		Package-Stash-XS-0.19-old-Test::More.patch
Patch2:		Package-Stash-XS-0.17-no-Test-Requires.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	perl >= 3:5.8.3
BuildRequires:	perl(ExtUtils::MakeMaker)
BuildRequires:	perl(Test::EOL)
BuildRequires:	perl(Test::Fatal)
BuildRequires:	perl(Test::More)
BuildRequires:	perl(Test::NoTabs)
BuildRequires:	perl(Test::Pod)
BuildRequires:	perl(Test::Pod::Coverage)
# Some test suite requirements not universally available
%if "%{?rhel}" != "4" && "%{?rhel}" != "5"
BuildRequires:	perl(Test::LeakTrace) >= 0.11
%endif
%if "%{?rhel}" != "4"
BuildRequires:	perl(Pod::Coverage::TrustPod)
BuildRequires:	perl(Test::Requires)
%endif
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

# Don't "provide" private Perl libs
%{?perl_default_filter}

%description
This is a back-end for Package::Stash, which provides the functionality in a
way that's less buggy and much faster. It will be used by default if it's
installed, and should be preferred in all environments with a compiler.

%prep
%setup -q -n Package-Stash-XS-%{version}

# Don't really need ExtUtils::MakeMaker >= 6.31
%if "%{?rhel}" == "4" || "%{?rhel}" == "5"
%patch0 -p1
%endif

# Patch test suite to work with old Test::More versions if necessary
%if "%{?rhel}" == "4" || "%{?rhel}" == "5"
%patch1 -p1
%endif

# Work around absence of Test::Requires in EPEL-4
%if "%{?rhel}" == "4"
%patch2 -p1
%endif

%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
chmod -R u+w %{buildroot}

%check
make test RELEASE_TESTING=1

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc Changes LICENSE README
%{perl_vendorarch}/auto/Package/
%{perl_vendorarch}/Package/
%{_mandir}/man3/Package::Stash::XS.3pm*

%changelog
* Thu Jan  6 2011 Paul Howarth <paul@city-fan.org> - 0.19-1
- Update to 0.19 (more correct validity test for scalars)
- Update patch for old Test::More versions

* Wed Nov 17 2010 Paul Howarth <paul@city-fan.org> - 0.17-2
- Santitize spec for Fedora submission

* Wed Nov 17 2010 Paul Howarth <paul@city-fan.org> - 0.17-1
- Initial RPM build