Files
perl-meta/perl-meta.spec
2025-08-12 18:15:25 +02:00

100 lines
3.8 KiB
RPMSpec

#
# spec file for package perl-meta
#
# Copyright (c) 2025 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 meta
Name: perl-meta
Version: 0.13.0
Release: 0
# 0.013 -> normalize -> 0.13.0
%define cpan_version 0.013
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Meta-programming API
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.%{cpan_name}cpan.org/authors/id/P/PE/PEVANS/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::CBuilder)
BuildRequires: perl(Module::Build) >= 0.400.400
BuildRequires: perl(Test2::V0)
Provides: perl(meta) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This package provides an API for metaprogramming; that is, allowing code to
inspect or manipulate parts of its own program structure. Parts of the perl
interpreter itself can be accessed by means of "meta"-objects provided by
this package. Methods on these objects allow inspection of details, as well
as creating new items or removing existing ones.
The intention of this API is to provide a nicer replacement for existing
tricks such as 'no strict 'refs'' and using globrefs, and also to be a more
consistent place to add new abilities, such as more APIs for inspection and
alteration of internal structures, metaprogramming around the new ''class''
feature, and other such uses.
This module should be considered *experimental*; no API stability
guarantees are made at this time. Behaviour may be added, altered, or
removed in later versions. Once a workable API shape has been found, it is
hoped that this module will eventually become dual-life and shipped as part
of Perl core, as the implementation for PPC 0022. See the link in the SEE
ALSO section.
This module attempts to find a balance between accurately representing
low-level concepts within the current implementation of the Perl
interpreter, while also providing higher-level abstractions that provide
useful behaviour for code that uses it. One place this can be seen is the
lower-level list_globs method, which directly maps to the way that GVs are
stored in symbol table stashes but requires the user to be aware of the
GV-less optimisised storage of CVs, as compared to the higher-level
list_symbols method which provides an abstraction over this complication
and presents the more useful but less accurate impression of separately
named symbols that neatly map to their values.
_Since version 0.003_002_ all the entry-point functions and constructors in
this module will provoke warnings in the 'meta::experimental' category.
They can be silenced by
use meta;
no warnings 'meta::experimental';
_Since version 0.005_ the various 'can_...'-prefixed variant accessor
methods print deprecation warnings. They are likely to be removed soon.
%prep
%autosetup -n %{cpan_name}-%{cpan_version} -p1
%build
perl Build.PL --installdirs=vendor optimize="%{optflags}"
./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 README
%license LICENSE
%changelog