24eecf4
# We don't really need ExtUtils::MakeMaker ≥ 6.30
24eecf4
%global old_eumm %(perl -MExtUtils::MakeMaker -e 'print (($ExtUtils::MakeMaker::VERSION < 6.30) ? 1 : 0);' 2>/dev/null || echo 0)
24eecf4
24eecf4
# We need to patch the test suite if we have Test::More < 0.88
24eecf4
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0)
71fa66d
71fa66d
Name:		perl-CPAN-Meta-YAML
24eecf4
Version:	0.004
24eecf4
Release:	1%{?dist}
71fa66d
Summary:	Read and write a subset of YAML for CPAN Meta files
71fa66d
License:	GPL+ or Artistic
71fa66d
Group:		Development/Libraries
71fa66d
URL:		http://search.cpan.org/dist/CPAN-Meta-YAML/
71fa66d
Source0:	http://search.cpan.org/CPAN/authors/id/D/DA/DAGOLDEN/CPAN-Meta-YAML-%{version}.tar.gz
24eecf4
Patch0:		CPAN-Meta-YAML-0.004-old-EU::MM.patch
24eecf4
Patch1:		CPAN-Meta-YAML-0.004-old-Test::More.patch
24eecf4
Patch2:		CPAN-Meta-YAML-0.004-old-Scalar::Util.patch
570b4ad
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
71fa66d
BuildArch:	noarch
71fa66d
BuildRequires:	perl(ExtUtils::MakeMaker)
71fa66d
BuildRequires:	perl(File::Spec)
71fa66d
BuildRequires:	perl(Test::CPAN::Meta)
71fa66d
BuildRequires:	perl(Test::More)
71fa66d
BuildRequires:	perl(Test::Pod)
24eecf4
# RHEL <= 6 doesn't have a recent enough perl(version) for perl(Test::Version)
24eecf4
%if 0%{?fedora} || 0%{?rhel} > 6
24eecf4
BuildRequires:	perl(Test::Version)
24eecf4
%endif
71fa66d
BuildRequires:	perl(YAML)
71fa66d
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
71fa66d
71fa66d
%description
71fa66d
This module implements a subset of the YAML specification for use in reading
71fa66d
and writing CPAN metadata files like META.yml and MYMETA.yml. It should not be
71fa66d
used for any other general YAML parsing or generation task.
71fa66d
71fa66d
%prep
71fa66d
%setup -q -n CPAN-Meta-YAML-%{version}
71fa66d
24eecf4
# We don't really need ExtUtils::MakeMaker ≥ 6.30
71fa66d
%if %{old_eumm}
71fa66d
%patch0 -p1
71fa66d
%endif
71fa66d
24eecf4
# We need to patch the test suite if we have Test::More < 0.88
24eecf4
%if %{old_test_more}
24eecf4
%patch1 -p1
24eecf4
%endif
24eecf4
24eecf4
# Fix operation with Scalar::Util < 1.18 properly (CPAN RT#53490)
24eecf4
%patch2 -p1
24eecf4
71fa66d
%build
1df143e
perl Makefile.PL INSTALLDIRS=vendor
71fa66d
make %{?_smp_mflags}
71fa66d
71fa66d
%install
71fa66d
rm -rf %{buildroot}
71fa66d
make pure_install DESTDIR=%{buildroot}
71fa66d
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
71fa66d
find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null
71fa66d
%{_fixperms} %{buildroot}
71fa66d
71fa66d
%check
71fa66d
make test TEST_FILES="t/*.t xt/*/*.t"
71fa66d
71fa66d
%clean
71fa66d
rm -rf %{buildroot}
71fa66d
71fa66d
%files
71fa66d
%defattr(-,root,root,-)
71fa66d
%doc Changes LICENSE README
1df143e
%{perl_vendorlib}/CPAN/
71fa66d
%{_mandir}/man3/CPAN::Meta::YAML.3pm*
71fa66d
71fa66d
%changelog
24eecf4
* Wed Sep  7 2011 Paul Howarth <paul@city-fan.org> - 0.004-1
24eecf4
- Update to 0.004:
24eecf4
  - Generated from ADAMK/YAML-Tiny-1.50.tar.gz
24eecf4
- BR: perl(Test::Version) for additional test coverage
24eecf4
- Update patch for building with ExtUtils::MakeMaker < 6.30
24eecf4
- Add patch to support building with Test::More < 0.88
24eecf4
- Add patch to fix operation with Scalar::Util < 1.18
24eecf4
1df143e
* Tue Aug 16 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.003-7
570b4ad
- Install to vendor perl directories to avoid potential debuginfo conflicts
570b4ad
  with the main perl package if this module ever becomes arch-specific
1df143e
c277bbe
* Wed Jun 29 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.003-6
d4aa88a
- Perl mass rebuild
d4aa88a
61c39ba
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.003-4
61c39ba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
61c39ba
71fa66d
* Thu Jan 27 2011 Paul Howarth <paul@city-fan.org> - 0.003-3
71fa66d
- Trim %%description (#672807)
71fa66d
71fa66d
* Wed Jan 26 2011 Paul Howarth <paul@city-fan.org> - 0.003-2
71fa66d
- Sanitize for Fedora submission
71fa66d
71fa66d
* Tue Jan 25 2011 Paul Howarth <paul@city-fan.org> - 0.003-1
71fa66d
- Initial RPM version