# # spec file for package perl-Class-Roles # # 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 Class-Roles Name: perl-Class-Roles Version: 0.300.0 Release: 0 # 0.30 -> normalize -> 0.300.0 %define cpan_version 0.30 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Use Perl 6 roles in Perl 5 URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/C/CH/CHROMATIC/%{cpan_name}-%{cpan_version}.tar.gz Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Module::Build) BuildRequires: perl(Test::Exception) Requires: perl(Test::Exception) Provides: perl(Class::Roles) = %{version} %undefine __perllib_provides %{perl_requires} %description Class::Roles provides a Perl 5 implementation of Perl 6 roles. Roles are named collections of reusable behavior. They provide a mechanism to mark that a class performs certain behaviors and to reuse the code that performs those behaviors. Polymorphism is a fundamental feature of object orientation. It's important that behaviors that are similar in a semantic sense but different in specific details can be abstracted behind the same name. A dog may sleep by turning in circles three times then lying down while a cat may sprawl out across the nearest human lap. Both sleep, however. Allomorphism -- polymorphic equivalence -- is a lesser-known feature. This suggests that objects with compatible behavior should be able to be treated interchangeably. A 'Dog' and a 'Lifeguard' may both understand the 'rescue_drowning_swimmer' message, not because they share a common ancestor class but because they share a role. %prep %autosetup -n %{cpan_name}-%{cpan_version} %build perl Build.PL --installdirs=vendor ./Build build --flags=%{?_smp_mflags} %check ./Build test %install ./Build install --destdir=%{buildroot} --create_packlist=0 %perl_gen_filelist %files -f %{name}.files %doc README %changelog