Blame SPECS/perl-Specio.spec

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