Blob Blame History Raw
%bcond_with network_tests

# TODO: BR: perl(HTTP::Tiny::Mech) and perl(WWW::Mechanize::Cache) when available

Name:		perl-MetaCPAN-Client
Version:	1.015000
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:	coreutils
BuildRequires:	findutils
BuildRequires:	make
BuildRequires:	perl
BuildRequires:	perl(ExtUtils::MakeMaker)
# Module
BuildRequires:	perl(Carp)
BuildRequires:	perl(Search::Elasticsearch) >= 2.02
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(Search::Elasticsearch::Scroll)
BuildRequires:	perl(Test::Fatal)
BuildRequires:	perl(Test::More) >= 0.88
BuildRequires:	perl(Test::Requires)
# 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 -delete
%{_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
%license LICENSE
%doc Changes 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::Mirror.3*
%{_mandir}/man3/MetaCPAN::Client::Module.3*
%{_mandir}/man3/MetaCPAN::Client::Pod.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
* Fri Jun  3 2016 Paul Howarth <paul@city-fan.org> - 1.015000-1
- Update to 1.015000
  - Adding 'source' method to MetaCPAN::Client::File
- This release by MICKEY → update source URL

* Mon May 16 2016 Jitka Plesnikova <jplesnik@redhat.com> - 1.014000-2
- Perl 5.24 rebuild

* Fri Apr 29 2016 Paul Howarth <paul@city-fan.org> - 1.014000-1
- Update to 1.014000
  - Fix warning on missing fields param
  - Switch to Search::Elasticsearch 2.0
  - You can test MetaCPAN::Client with a different domain using the
    environment variable "METACPAN_DOMAIN"
- This release by XSAWYERX → update source URL
- Simplify find command using -delete
- POD tests are now author tests rather than release tests, so drop hack for
  running them

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.013000-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.013000-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jun 08 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.013000-2
- Perl 5.22 rebuild

* Sun Apr 26 2015 Paul Howarth <paul@city-fan.org> - 1.013000-1
- Update to 1.013000
  - Use Travis for CI (GH#34)
  - Improve Kwalitee + test improvements (GH#35)

* Thu Apr  9 2015 Paul Howarth <paul@city-fan.org> - 1.012000-1
- Update to 1.012000
  - Added Mirror type and support for mirrors search in 'all' queries (GH#33)
  - Support 'ratings' search in 'all' queries (GH#33)
  - More example scripts: facets, top favorites, all authors blogs
  - Clean-up and documentation updates

* Tue Jan 27 2015 Paul Howarth <paul@city-fan.org> - 1.011000-1
- Update to 1.011000
  - Support 'favorites' type and 'facets' key param in 'all' queries

* Fri Jan 23 2015 Paul Howarth <paul@city-fan.org> - 1.010000-1
- Update to 1.010000
  - Support wildcard-only value in complex search
  - Support raw ElasticSearch filters in 'all' queries

* Mon Jan 12 2015 Paul Howarth <paul@city-fan.org> - 1.009000-1
- Update to 1.009000
  - Added support for 'fields' filtering (GH#25, CPAN RT#99499)
- This release by MICKEY → update source URL

* Tue Jan  6 2015 Paul Howarth <paul@city-fan.org> - 1.008001-1
- Update to 1.008001
  - Correct Meta resources for the repo
  - Correct link in POD for the Pod element
- This release by XSAWYERX → update source URL

* Sat Nov 22 2014 Paul Howarth <paul@city-fan.org> - 1.008000-1
- Update to 1.008000
  - CPAN RT#99498: added API for 'match_all' queries via all($type)
  - GH#21: make 'domain' and 'version' settable via new()
  - CPAN  RT#94491: document nested queries

* Thu Oct  9 2014 Paul Howarth <paul@city-fan.org> - 1.007001-1
- Update to 1.007001
  - GH#18: HTTP::Tiny::Mech and WWW::Mechanize::Cached downgraded to being
    non-essential for tests
  - GH#19: Include 'metadata' in known_fields for ::Release
- Make the POD tests author tests instead of release tests so we can run them

* Mon Sep 01 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1.007000-2
- Perl 5.20 rebuild

* Tue Aug 19 2014 Paul Howarth <paul@city-fan.org> - 1.007000-1
- Update to 1.007000
  - Ensure passing user-specified ua values to all parts internally, including
    to Elasticsearch (GH #17, CPAN RT#95796)
  - Entity-consuming roles now have a 'client' attribute that will lazy build,
    or reference the MetaCPAN::Client that created them via new_from_request
    (GH #17)
- Use %%license
- Upstream dropped switching to filters document
- Skip the release tests for now because of missing optional test dependencies
  and failing Pod Coverage test with Moo ≥ 1.005
  (#1124400, https://github.com/CPAN-API/metacpan-client/issues/16)

* Tue Jun 24 2014 Paul Howarth <paul@city-fan.org> - 1.006000-1
- Update to 1.006000
  - Add 'recent' functionality (latest releases)

* Tue Jun 10 2014 Paul Howarth <paul@city-fan.org> - 1.005000-1
- Update to 1.005000
  - Add Pod object to allow direct POD fetching
  - Support single element without wrapping arrayref in structures
  - Updated documents - basic/complex search links and wording
- Package additional documentation file on switching to filters

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.004001-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* 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