Files
perl-Pod-Elemental-PerlMunger/perl-Pod-Elemental-PerlMunger.spec

118 lines
3.6 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package perl-Pod-Elemental-PerlMunger
#
# 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 Pod-Elemental-PerlMunger
Name: perl-Pod-Elemental-PerlMunger
Version: 0.200.7
Release: 0
# 0.200007 -> normalize -> 0.200.7
%define cpan_version 0.200007
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Thing that takes a string of Perl and rewrites its documentation
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/R/RJ/RJBS/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
2025-08-12 18:16:35 +02:00
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.78
BuildRequires: perl(List::Util) >= 1.33
BuildRequires: perl(Moose)
BuildRequires: perl(Moose::Role)
BuildRequires: perl(PPI)
BuildRequires: perl(Params::Util)
BuildRequires: perl(Pod::Elemental) >= 0.103000
BuildRequires: perl(Test::More) >= 0.96
BuildRequires: perl(namespace::autoclean)
Requires: perl(List::Util) >= 1.33
Requires: perl(Moose)
Requires: perl(Moose::Role)
Requires: perl(PPI)
Requires: perl(Params::Util)
Requires: perl(Pod::Elemental) >= 0.103000
Requires: perl(namespace::autoclean)
Provides: perl(Pod::Elemental::PerlMunger) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This role is to be included in classes that rewrite the documentation of a
Perl document, stripping out all the Pod, munging it, and replacing it into
the Perl.
The only relevant method is 'munge_perl_string', which must be implemented
with a different interface than will be exposed.
When calling the 'munge_perl_string' method, arguments should be passed
like this:
$object->munge_perl_string($perl_string, \%arg);
'$perl_string' should be a character string containing Perl source code.
'%arg' may contain any input for the underlying procedure. Defined keys for
'%arg' are:
* filename
the name of the file whose contents are being munged; optional, used for
error messages
* no_strip_bom
If given, the BOM character (U+FEFF) won't be stripped from the input.
Probably best to leave this one off.
The method will return a character string containing the rewritten and
combined document.
Classes including this role must implement a 'munge_perl_string' that
expects to be called like this:
$object->munge_perl_string(\%doc, \%arg);
'%doc' will have two entries:
ppi - a PPI::Document of the Perl document with all its Pod removed
pod - a Pod::Elemental::Document with no transformations yet performed
This 'munge_perl_string' method should return a hashref in the same format
as '%doc'.
%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