Files
perl-MooseX-Meta-TypeConstr…/perl-MooseX-Meta-TypeConstraint-Mooish.spec
2025-08-12 18:15:44 +02:00

87 lines
2.9 KiB
RPMSpec

#
# spec file for package perl-MooseX-Meta-TypeConstraint-Mooish
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name MooseX-Meta-TypeConstraint-Mooish
Name: perl-MooseX-Meta-TypeConstraint-Mooish
Version: 0.1.0
Release: 0
# 0.001 -> normalize -> 0.1.0
%define cpan_version 0.001
License: LGPL-2.1-or-later
Summary: Translate Moo-style constraints to Moose-style
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/R/RS/RSRCHBOY/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Moose)
BuildRequires: perl(Moose::Meta::TypeConstraint)
BuildRequires: perl(Moose::Role)
BuildRequires: perl(Test::CheckDeps) >= 0.010
BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::Moose::More) >= 0.28.0
BuildRequires: perl(Test::More) >= 0.94
BuildRequires: perl(Try::Tiny)
BuildRequires: perl(aliased)
BuildRequires: perl(namespace::autoclean) >= 0.24
Requires: perl(Moose)
Requires: perl(Moose::Meta::TypeConstraint)
Requires: perl(Moose::Role)
Requires: perl(Try::Tiny)
Requires: perl(namespace::autoclean) >= 0.24
Provides: perl(MooseX::Meta::TypeConstraint::Mooish) = %{version}
Provides: perl(MooseX::TraitFor::Meta::TypeConstraint::Mooish) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
Moose type constraints are expected to return true if the value passes the
constraint, and false otherwise; Moo "constraints", on the other hand, die
if validation fails.
This metaclass allows for Moo-style constraints; it will wrap them and
translate their Moo into a dialect Moose understands.
Note that this is largely to enable functionality in
MooseX::AttributeShortcuts; the easiest way use this metaclass is by using
that package. Also, as it's not inconceivable that this functionality may
be desired in other constraint metaclasses, the bulk of this metaclass'
functionality is implemented as a trait.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README
%license LICENSE
%changelog