Files
perl-Object-Simple/perl-Object-Simple.spec
2025-08-12 18:16:13 +02:00

86 lines
2.8 KiB
RPMSpec

#
# spec file for package perl-Object-Simple
#
# 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 Object-Simple
Name: perl-Object-Simple
Version: 3.190.0
Release: 0
# 3.19 -> normalize -> 3.190.0
%define cpan_version 3.19
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Simplest class builder, Mojo::Base porting, fast and less memory
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/K/KI/KIMOTO/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
Provides: perl(Object::Simple) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
Object::Simple is *Simplest* class builder. All you learn is only 'has'
function. You can learn all features of Object::Simple in *an hour*. There
is nothing difficult.
Do you like Mojolicious? In fact, Object::Simple is Mojo::Base porting.
Mojo::Base is basic class builder in Mojolicious project. If you like
Mojolicious, this is good choice. If you have known Mojo::Base, you learn
nothing.
'new' and accessor method is *fast*. Implementation is pure perl and plain
old hash-base object. Memory is saved. Extra objects is not created at all.
Very light-weight object-oriented module.
Comparison with Class::Accessor::Fast
Class::Accessor::Fast is simple, but lack often used features. 'new' method
can't receive hash arguments. Default value can't be specified. If multiple
values is set through the accessor, its value is converted to array
reference without warnings.
Comparison with Moose
Moose has very complex syntax and depend on much many modules. You have to
learn many things to do object-oriented programing. Understanding source
code is difficult. Compile-time is very slow and memory usage is very
large. Execution speed is not fast. For simple OO, Moose is overkill. Moo
is improved in this point.
%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.md
%changelog