Blame SPECS/perl-Specio.spec

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