%bcond_with network_tests
# TODO: BR: perl(HTTP::Tiny::Mech) and perl(WWW::Mechanize::Cache) when available
Name: perl-MetaCPAN-Client
Version: 1.022002
Release: 1%{?dist}
Summary: A comprehensive, DWIM-featured client to the MetaCPAN API
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: make
BuildRequires: perl
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
# 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(Ref::Util)
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)
%if %{with network_tests}
BuildRequires: perl(LWP::Protocol::https)
%endif
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 NO_PACKLIST=1 NO_PERLLOCAL=1
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
%check
%if !%{with network_tests}
mv t/api/[a-z]*.t ./
%endif
make test AUTHOR_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::DownloadURL.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
* Sat Aug 6 2016 Paul Howarth <paul@city-fan.org> - 1.022002-1
- Update to 1.022002
- Added LWP::Protocol::https as test dependency
* Fri Aug 5 2016 Paul Howarth <paul@city-fan.org> - 1.022001-1
- Update to 1.022001
- Rework type checking - enforce expected types, including single-valued
array-ref unwrapping; doesn't break types that are expected to be
array-refs
- Check user provided UA for 'get' and 'post' methods
- Documentation updates
* Thu Jul 28 2016 Paul Howarth <paul@city-fan.org> - 1.021000-1
- Update to 1.021000
- Fix result values in v1 - single valued arrayref in ES result will be
turned to a scalar
* Tue Jul 12 2016 Paul Howarth <paul@city-fan.org> - 1.020000-1
- Update to 1.020000
- Added support for Author->release_count and Author->links methods
- Added support for url_prefix parameter for Pod
* Wed Jul 6 2016 Paul Howarth <paul@city-fan.org> - 1.019000-1
- Update to 1.019000
- Added missing 'download_url' attribute to file/module result objects
* Wed Jul 6 2016 Paul Howarth <paul@city-fan.org> - 1.018000-1
- Update to 1.018000
- Added support for download_url endpoint
- Default domain set by providing 'version' - makes it easy to work with v1
- Use recent EU:MM's NO_PERLLOCAL option
- Drop legacy Group: tag
* Tue Jun 28 2016 Paul Howarth <paul@city-fan.org> - 1.017000-1
- Update to 1.017000
- Fixed nodes list for Search::Elasticsearch
- Added support for 'aggregations'
- Use recent EU:MM's NO_PACKLIST option
* Mon Jun 27 2016 Paul Howarth <paul@city-fan.org> - 1.016000-1
- Update to 1.016000
- Added support for 'all' filters type 'files'
- http → https
- BR: perl-generators
* 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