Blame SPECS/perl-Specio.spec

7397a5
# Run optional test
7397a5
%if ! (0%{?rhel})
7397a5
%bcond_without perl_Specio_enables_optional_test
7397a5
%else
7397a5
%bcond_with perl_Specio_enables_optional_test
7397a5
%endif
7397a5
7397a5
Name:		perl-Specio
7397a5
Version:	0.42
7397a5
Release:	2%{?dist}
7397a5
Summary:	Type constraints and coercions for Perl
7397a5
License:	Artistic 2.0
7397a5
URL:		http://search.cpan.org/dist/Specio/
7397a5
Source0:	http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Specio-%{version}.tar.gz
7397a5
BuildArch:	noarch
7397a5
# Module Build
7397a5
BuildRequires:	coreutils
7397a5
BuildRequires:	make
7397a5
BuildRequires:	perl-generators
7397a5
BuildRequires:	perl-interpreter
7397a5
BuildRequires:	perl(ExtUtils::MakeMaker) >= 6.76
7397a5
# Module Runtime
7397a5
BuildRequires:	perl(B)
7397a5
BuildRequires:	perl(Carp)
7397a5
BuildRequires:	perl(Devel::StackTrace)
7397a5
BuildRequires:	perl(Eval::Closure)
7397a5
BuildRequires:	perl(Exporter)
7397a5
BuildRequires:	perl(IO::File)
7397a5
BuildRequires:	perl(List::Util) >= 1.33
7397a5
BuildRequires:	perl(Module::Runtime)
7397a5
BuildRequires:	perl(MRO::Compat)
7397a5
BuildRequires:	perl(overload)
7397a5
BuildRequires:	perl(parent)
7397a5
BuildRequires:	perl(re)
7397a5
BuildRequires:	perl(Ref::Util) >= 0.112
7397a5
BuildRequires:	perl(Role::Tiny) >= 1.003003
7397a5
BuildRequires:	perl(Role::Tiny::With)
7397a5
BuildRequires:	perl(Scalar::Util)
7397a5
BuildRequires:	perl(Storable)
7397a5
BuildRequires:	perl(strict)
7397a5
BuildRequires:	perl(Sub::Quote)
7397a5
BuildRequires:	perl(Sub::Util) >= 1.40
7397a5
BuildRequires:	perl(Test::Fatal)
7397a5
BuildRequires:	perl(Test::More) >= 0.96
7397a5
BuildRequires:	perl(Try::Tiny)
7397a5
BuildRequires:	perl(version) >= 0.83
7397a5
BuildRequires:	perl(warnings)
7397a5
# Test Suite
7397a5
BuildRequires:	perl(File::Spec)
7397a5
BuildRequires:	perl(lib)
7397a5
BuildRequires:	perl(open)
7397a5
BuildRequires:	perl(Test::Needs)
7397a5
BuildRequires:	perl(utf8)
7397a5
%if %{with perl_Specio_enables_optional_test}
7397a5
# Optional Tests
7397a5
BuildRequires:	perl(CPAN::Meta) >= 2.120900
7397a5
BuildRequires:	perl(CPAN::Meta::Prereqs)
7397a5
BuildRequires:	perl(Moo)
7397a5
%if !%{defined perl_bootstrap}
7397a5
# Break cycle: perl-Moose → perl-DateTime → perl-Specio
7397a5
BuildRequires:	perl(Moose) >= 2.1207
7397a5
# Break cycle: perl-Mouse → perl-Moose → perl-DateTime → perl-Specio
7397a5
BuildRequires:	perl(Mouse)
7397a5
%endif
7397a5
BuildRequires:	perl(namespace::autoclean)
7397a5
%endif
7397a5
# Dependencies
7397a5
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
7397a5
Requires:	perl(Ref::Util) >= 0.112
7397a5
Requires:	perl(Sub::Util) >= 1.40
7397a5
7397a5
# Avoid provides for private packages
7397a5
%global __provides_exclude ^perl\\(_T::.*\\)
7397a5
7397a5
%description
7397a5
The Specio distribution provides classes for representing type constraints
7397a5
and coercion, along with syntax sugar for declaring them.
7397a5
7397a5
Note that this is not a proper type system for Perl. Nothing in this
7397a5
distribution will magically make the Perl interpreter start checking a value's
7397a5
type on assignment to a variable. In fact, there's no built-in way to apply a
7397a5
type to a variable at all.
7397a5
7397a5
Instead, you can explicitly check a value against a type, and optionally coerce
7397a5
values to that type.
7397a5
7397a5
%package -n perl-Test-Specio
7397a5
Summary:	Test helpers for Specio
7397a5
License:	Artistic 2.0
7397a5
Requires:	%{name} = %{version}-%{release}
7397a5
7397a5
%description -n perl-Test-Specio
7397a5
This package provides some helper functions and variables for testing Specio
7397a5
types.
7397a5
7397a5
%prep
7397a5
%setup -q -n Specio-%{version}
7397a5
7397a5
%build
7397a5
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
7397a5
make %{?_smp_mflags}
7397a5
7397a5
%install
7397a5
make install DESTDIR=%{buildroot}
7397a5
%{_fixperms} -c %{buildroot}
7397a5
7397a5
%check
7397a5
make test
7397a5
7397a5
%files
7397a5
%license LICENSE
7397a5
%doc Changes CONTRIBUTING.md README.md TODO.md
7397a5
%{perl_vendorlib}/Specio.pm
7397a5
%{perl_vendorlib}/Specio/
7397a5
%{_mandir}/man3/Specio.3*
7397a5
%{_mandir}/man3/Specio::Coercion.3*
7397a5
%{_mandir}/man3/Specio::Constraint::AnyCan.3*
7397a5
%{_mandir}/man3/Specio::Constraint::AnyDoes.3*
7397a5
%{_mandir}/man3/Specio::Constraint::AnyIsa.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Enum.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Intersection.3*
7397a5
%{_mandir}/man3/Specio::Constraint::ObjectCan.3*
7397a5
%{_mandir}/man3/Specio::Constraint::ObjectDoes.3*
7397a5
%{_mandir}/man3/Specio::Constraint::ObjectIsa.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Parameterizable.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Parameterized.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Role::CanType.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Role::DoesType.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Role::Interface.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Role::IsaType.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Simple.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Structurable.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Structured.3*
7397a5
%{_mandir}/man3/Specio::Constraint::Union.3*
7397a5
%{_mandir}/man3/Specio::Declare.3*
7397a5
%{_mandir}/man3/Specio::DeclaredAt.3*
7397a5
%{_mandir}/man3/Specio::Exception.3*
7397a5
%{_mandir}/man3/Specio::Exporter.3*
7397a5
%{_mandir}/man3/Specio::Helpers.3*
7397a5
%{_mandir}/man3/Specio::Library::Builtins.3*
7397a5
%{_mandir}/man3/Specio::Library::Numeric.3*
7397a5
%{_mandir}/man3/Specio::Library::Perl.3*
7397a5
%{_mandir}/man3/Specio::Library::String.3*
7397a5
%{_mandir}/man3/Specio::Library::Structured.3*
7397a5
%{_mandir}/man3/Specio::Library::Structured::Dict.3*
7397a5
%{_mandir}/man3/Specio::Library::Structured::Map.3*
7397a5
%{_mandir}/man3/Specio::Library::Structured::Tuple.3*
7397a5
%{_mandir}/man3/Specio::OO.3*
7397a5
%{_mandir}/man3/Specio::PartialDump.3*
7397a5
%{_mandir}/man3/Specio::Registry.3*
7397a5
%{_mandir}/man3/Specio::Role::Inlinable.3*
7397a5
%{_mandir}/man3/Specio::Subs.3*
7397a5
%{_mandir}/man3/Specio::TypeChecks.3*
7397a5
7397a5
%files -n perl-Test-Specio
7397a5
%{perl_vendorlib}/Test/
7397a5
%{_mandir}/man3/Test::Specio.3*
7397a5
7397a5
%changelog
7397a5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.42-2
7397a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7397a5
7397a5
* Mon Nov  6 2017 Paul Howarth <paul@city-fan.org> - 0.42-1
7397a5
- Update to 0.42
7397a5
  - Fixed checks for whether a class is loaded in light of upcoming
7397a5
    optimization in Perl 5.28 (GH#12)
7397a5
  - The Perl library claimed it provided types named LaxVersionStr and
7397a5
    StrictVersionStr but they were really named LaxVersion and StrictVersion;
7397a5
    the names have now been fixed to match the documentation, so they are
7397a5
    LaxVersionStr and StrictVersionStr
7397a5
7397a5
* Fri Aug  4 2017 Paul Howarth <paul@city-fan.org> - 0.40-1
7397a5
- Update to 0.40
7397a5
  - Fixed more bugs with {any,object}_{can,does,isa}_type
7397a5
    - When passed a glob (not a globref) they would die in their type check
7397a5
    - On Perl 5.16 or earlier, passing a number to an any_* type would also die
7397a5
  - Fixed subification overloading: if Sub::Quote was loaded, this would be
7397a5
    used, but any environment variables needed for the closure would not be
7397a5
    included, which broke enums, among other things
7397a5
7397a5
* Thu Aug  3 2017 Paul Howarth <paul@city-fan.org> - 0.39-1
7397a5
- Update to 0.39
7397a5
  - Many bug fixes and improvements to the types created by
7397a5
    {any,object}_{can,does,isa}_type; in some cases, an invalid value could
7397a5
    cause an exception in type check itself, and in other cases, a value that
7397a5
    failed a type check would cause an exception when generating a message
7397a5
    describing the failure
7397a5
  - The messages describing a failure for all of these types have been improved
7397a5
  - You can now create anonymous *_does and *_isa types using the exports from
7397a5
    Specio::Declare
7397a5
7397a5
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.38-2
7397a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7397a5
7397a5
* Sat Jul  1 2017 Paul Howarth <paul@city-fan.org> - 0.38-1
7397a5
- Update to 0.38
7397a5
  - Simplify checks for overloading to not call overload::Overloaded(); just
7397a5
    checking the return value of overload::Method() is sufficient
7397a5
7397a5
* Wed Jun 07 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-3
7397a5
- Perl 5.26 re-rebuild of bootstrapped packages
7397a5
7397a5
* Mon Jun 05 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-2
7397a5
- Perl 5.26 rebuild
7397a5
7397a5
* Tue May  9 2017 Paul Howarth <paul@city-fan.org> - 0.37-1
7397a5
- Update to 0.37
7397a5
  - Possible fix for very weird failures seen under threaded Perls with some
7397a5
    modules that use Specio
7397a5
7397a5
* Mon Feb 20 2017 Paul Howarth <paul@city-fan.org> - 0.36-1
7397a5
- Update to 0.36
7397a5
  - Inlined coercions would attempt to coerce for every type that matched the
7397a5
    value given, instead of stopping after the first type (GH#11)
7397a5
  - Inlined coercions did not include the inline environment variables needed
7397a5
    by the type from which the coercion was being performed (GH#8)
7397a5
  - When you use the same type repeatedly as coderef (for example, as a
7397a5
    constraint with Moo), it will only generate its subified form once, rather
7397a5
    than regenerating it each time it is de-referenced
7397a5
  - Added an API to Specio::Subs to allow you to combine type libraries and
7397a5
    helper subs in one package for exporting; see the Specio::Exporter docs for
7397a5
    more detail
7397a5
7397a5
* Mon Feb 13 2017 Paul Howarth <paul@city-fan.org> - 0.35-1
7397a5
- Update to 0.35
7397a5
  - Added Specio::Subs, a module that allows you to turn one or more library's
7397a5
    types into subroutines like is_Int() and to_Int()
7397a5
  - Added an inline_coercion method to Specio constraints
7397a5
7397a5
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.34-2
7397a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7397a5
7397a5
* Mon Jan 30 2017 Paul Howarth <paul@city-fan.org> - 0.34-1
7397a5
- Update to 0.34
7397a5
  - Packages with Specio::Exporter can now specify additional arbitrary subs to
7397a5
    exporter; see the Specio::Exporter docs for details
7397a5
  - Importing the same library twice in a given package would throw an
7397a5
    exception; the second attempt to import is now ignored
7397a5
7397a5
* Wed Jan 25 2017 Paul Howarth <paul@city-fan.org> - 0.33-1
7397a5
- Update to 0.33
7397a5
  - Fixed a mistake in the SYNOPSIS for Specio::Declare; the example for the
7397a5
    *_isa_type helpers was not correct
7397a5
  - Removed the alpha warning from the docs; this is being used by enough of my
7397a5
    modules on CPAN that I don't plan on doing any big breaking changes without
7397a5
    a deprecation first
7397a5
7397a5
* Fri Jan 13 2017 Paul Howarth <paul@city-fan.org> - 0.32-1
7397a5
- Update to 0.32
7397a5
  - Fixed a bug in the inlining for types create by any_can_type() and
7397a5
    object_can_type(); this inlining mostly worked by accident because of some
7397a5
    List::Util XS magic, but this broke under the debugger (GH#6,
7397a5
    https://github.com/houseabsolute/DateTime.pm/issues/49)
7397a5
7397a5
* Mon Nov  7 2016 Paul Howarth <paul@city-fan.org> - 0.31-1
7397a5
- Update to 0.31
7397a5
  - The stack trace contained by Specio::Exception objects no longer includes
7397a5
    stack frames for the Specio::Exception package
7397a5
  - Made the inline_environment() and description() methods public on type and
7397a5
    coercion objects
7397a5
7397a5
* Thu Oct 20 2016 Petr Pisar <ppisar@redhat.com> - 0.30-2
7397a5
- Break build cycle: perl-Moose → perl-DateTime → perl-Specio
7397a5
7397a5
* Sun Oct 16 2016 Paul Howarth <paul@city-fan.org> - 0.30-1
7397a5
- Update to 0.30
7397a5
  - Fix a bug with the Sub::Quoted sub returned by $type->coercion_sub; if a
7397a5
    type had more than one coercion, the generated sub could end up coercing
7397a5
    the value to undef some of the time and, depending on hash key ordering,
7397a5
    this could end up being a heisenbug that only occurred some of the time
7397a5
7397a5
* Mon Oct 10 2016 Paul Howarth <paul@city-fan.org> - 0.29-1
7397a5
- Update to 0.29
7397a5
  - Document Specio::PartialDump because you may want to use it as part of the
7397a5
    failure message generation code for a type
7397a5
7397a5
* Mon Oct  3 2016 Paul Howarth <paul@city-fan.org> - 0.28-1
7397a5
- Update to 0.28
7397a5
  - Added a Test::Specio module to provide helpers for testing Specio libraries
7397a5
  - Fixed another bug with a subtype of special types and inlining
7397a5
- Introduce sub-package perl-Test-Specio to avoid dependencies on Test::Fatal
7397a5
  and Test::More in main package
7397a5
7397a5
* Sun Oct  2 2016 Paul Howarth <paul@city-fan.org> - 0.27-1
7397a5
- Update to 0.27
7397a5
  - Cloning a type with coercions defined on it would cause an exception
7397a5
  - Creating a subtype of a special type created by *_isa_type, *_can_type, or
7397a5
    *_does_type, or enum would die when trying to inline type constraint
7397a5
  - Removed the never-documented Any type
7397a5
  - Added documentation for each type in Specio::Library::Builtins
7397a5
7397a5
* Mon Sep 26 2016 Paul Howarth <paul@city-fan.org> - 0.26-1
7397a5
- Update to 0.26
7397a5
  - Require Role::Tiny 1.003003, which should fix some test failures
7397a5
7397a5
* Mon Sep  5 2016 Paul Howarth <paul@city-fan.org> - 0.25-1
7397a5
- Update to 0.25
7397a5
  - Calling {any,object}_{isa,does}_type repeatedly in a package with the same
7397a5
    class or role name would die; these subs are now special-cased to simply
7397a5
    return an existing type for the given name when they receive a single
7397a5
    argument (the name of the class or role)
7397a5
7397a5
* Fri Jul  1 2016 Paul Howarth <paul@city-fan.org> - 0.24-2
7397a5
- Sanitize for Fedora submission
7397a5
7397a5
* Fri Jul  1 2016 Paul Howarth <paul@city-fan.org> - 0.24-1
7397a5
- Initial RPM version