Files
perl-Class-Gomor/perl-Class-Gomor.spec
2025-08-12 18:12:25 +02:00

80 lines
2.7 KiB
RPMSpec

#
# spec file for package perl-Class-Gomor
#
# 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-Gomor
Name: perl-Class-Gomor
Version: 1.30.0
Release: 0
# 1.03 -> normalize -> 1.30.0
%define cpan_version 1.03
License: Artistic-1.0
Summary: Another class and object builder
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/G/GO/GOMOR/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Module::Build)
Provides: perl(Class::Gomor) = %{version}
Provides: perl(Class::Gomor::Array) = %{version}
Provides: perl(Class::Gomor::Hash) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module is yet another class builder. This one adds parameter checking
in *new* constructor, that is to check for attributes existence, and
definedness.
In order to validate parameters, the module needs to find attributes, and
that is the reason for declaring attributes in global variables named
*@AS*, *@AA*, *@AO*. They respectively state for Attributes Scalar,
Attributes Array and Attributes Other. The last one is used to avoid
autocreation of accessors, that is to let you declare your own ones.
Attribute validation is performed by looking at classes hierarchy, by
following @ISA tree inheritance.
The loss in speed by validating all attributes is quite negligeable on a
decent machine (Pentium IV, 2.4 GHz) with Perl 5.8.x. But if you want to
avoid checking, you can do it, see below.
This class is the base class for *Class::Gomor::Array* and
*Class::Gomor::Hash*, so they will inherite the following methods.
%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 Changes examples README
%license LICENSE LICENSE.Artistic
%changelog