Blob Blame History Raw
%bcond_with network_tests

Name:		perl-MetaCPAN-Client
Version:	1.004001
Release:	1%{?dist}
Summary:	A comprehensive, DWIM-featured client to the MetaCPAN API
Group:		Development/Libraries
License:	GPL+ or Artistic
URL:		https://github.com/CPAN-API/metacpan-client
Source0:	http://cpan.metacpan.org/authors/id/M/MI/MICKEY/MetaCPAN-Client-%{version}.tar.gz
BuildArch:	noarch
# Build
BuildRequires:	perl
BuildRequires:	perl(ExtUtils::MakeMaker) >= 6.30
# Module
BuildRequires:	perl(Carp)
BuildRequires:	perl(Search::Elasticsearch) >= 1.10
BuildRequires:	perl(Search::Elasticsearch::Scroll)
BuildRequires:	perl(HTTP::Tiny)
BuildRequires:	perl(JSON::MaybeXS)
BuildRequires:	perl(Moo)
BuildRequires:	perl(Moo::Role)
BuildRequires:	perl(Safe::Isa)
BuildRequires:	perl(strict)
BuildRequires:	perl(Try::Tiny)
BuildRequires:	perl(warnings)
# Test suite
BuildRequires:	perl(base)
BuildRequires:	perl(File::Spec)
BuildRequires:	perl(IO::Handle)
BuildRequires:	perl(IPC::Open3)
BuildRequires:	perl(Test::Fatal)
BuildRequires:	perl(Test::More) >= 0.88
# Author/Release tests
BuildRequires:	perl(English)
BuildRequires:	perl(Pod::Coverage::TrustPod)
BuildRequires:	perl(Test::Perl::Critic)
BuildRequires:	perl(Test::Pod) >= 1.41
BuildRequires:	perl(Test::Pod::Coverage) >= 1.08
# Runtime
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))

%description
This is a hopefully-complete API-compliant interface to MetaCPAN
(https://metacpan.org/) with DWIM capabilities, to make your life easier.

%prep
%setup -q -n MetaCPAN-Client-%{version}

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

%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
%{_fixperms} %{buildroot}

%check
%if !%{with network_tests}
mv t/api/[a-z]*.t ./
%endif

make test AUTHOR_TESTING=1 RELEASE_TESTING=1

%if !%{with network_tests}
mv ./[a-z]*.t t/api/
%endif

%files
%doc Changes LICENSE README examples/
%{perl_vendorlib}/MetaCPAN/
%{_mandir}/man3/MetaCPAN::Client.3*
%{_mandir}/man3/MetaCPAN::Client::Author.3*
%{_mandir}/man3/MetaCPAN::Client::Distribution.3*
%{_mandir}/man3/MetaCPAN::Client::Favorite.3*
%{_mandir}/man3/MetaCPAN::Client::File.3*
%{_mandir}/man3/MetaCPAN::Client::Module.3*
%{_mandir}/man3/MetaCPAN::Client::Rating.3*
%{_mandir}/man3/MetaCPAN::Client::Release.3*
%{_mandir}/man3/MetaCPAN::Client::Request.3*
%{_mandir}/man3/MetaCPAN::Client::ResultSet.3*
%{_mandir}/man3/MetaCPAN::Client::Role::Entity.3*

%changelog
* Tue May 27 2014 Paul Howarth <paul@city-fan.org> - 1.004001-1
- Update to 1.004001
  - Reworked ResultSet to allow RS in non-scrolled searches
  - Correct rev_deps query
- This release by MICKEY -> update source URL

* Sun May  4 2014 Paul Howarth <paul@city-fan.org> - 1.003000-1
- Update to 1.003000
  - Add proper POD fetching from module/file objects.
  - GH #1: Switch from JSON.pm to JSON::MaybeXS
  - GH #2: Remove incorrect and unnecessary check for class names
  - Provide "ua" attribute in the main object to override user agent
  - Add some use-case examples (examples directory)
  - Add 'releases' method to Author (not official so no docs yet)
  - GH #4: Use example with hyphen
  - Related to GH #4, use Data::Printer instead of shortened name "DDP"
- This release by XSAWYERX -> update source URL

* Fri Apr 25 2014 Paul Howarth <paul@city-fan.org> - 1.002000-2
- Sanitize for Fedora submission

* Thu Apr 24 2014 Paul Howarth <paul@city-fan.org> - 1.002000-1
- Update to 1.002000
  - Add 'not' support for complex queries
  - Add reverse_dependencies method

* Wed Apr 16 2014 Paul Howarth <paul@city-fan.org> - 1.001001-1
- Update to 1.001001
  - Fix the reading of scroller result when 'fields' param is passed

* Thu Apr 10 2014 Paul Howarth <paul@city-fan.org> - 1.001000-1
- Update to 1.001000
  - Add support for nested either/all queries
  - Add tests for complex queries (two levels deep)
  - Correct documentation on complex queries
  - Update tests to work on older versions of perl

* Thu Apr  3 2014 Paul Howarth <paul@city-fan.org> - 1.000001-1
- Update to 1.000001
  - Changed Elasticsearch (deprecated) to Search::Elasticsearch (official)
  
* Wed Apr  2 2014 Paul Howarth <paul@city-fan.org> - 1.000000-1
- Initial RPM version