Files
perl-Test-Pod-Content/perl-Test-Pod-Content.spec
2025-08-12 18:17:51 +02:00

90 lines
2.8 KiB
RPMSpec

#
# spec file for package perl-Test-Pod-Content
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: perl-Test-Pod-Content
Version: 0.0.6
Release: 0
%define cpan_name Test-Pod-Content
Summary: Test a Pod's content
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Test-Pod-Content/
Source: http://www.cpan.org/authors/id/M/MK/MKUTTER/%{cpan_name}-v%{version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Module::Build) >= 0.36
BuildRequires: perl(Pod::Simple)
BuildRequires: perl(version)
Requires: perl(Pod::Simple)
Requires: perl(version)
%{perl_requires}
%description
This is a very simple module for testing a Pod's content. It is mainly
intended for testing the content of generated Pod - that is, the Pod
included in perl modules generated by some mechanism.
Another usage example is to test whether all files contain the same
copyright notice:
plan tests => scalar @filelist;
for my $file (sort @filelist) {
pod_section_like( $file, 'LICENSE AND COPYRIGHT', qr{
This \s library \s is \s free \s software\. \s
You \s may \s distribute/modify \s it \s under \s
the \s same \s terms \s as \s perl \s itself
}xms, "$file License notice");
}
See the files in the t/ directory for live examples.
Test::Pod::Content has a very simple concept of Pods: To
Test::Pod::Content, a Pod is separated into section. Each section starts
with a =head(1|2|3|4) directive, and ends with the next =head, or with the
end of the document (=cut).
This is a very drastic simplification of Pod's document object model, and
only allows for coarse-grained tests.
Test::Pod::Content provides the following subroutines for testing a Pod's
content:
%prep
%setup -q -n %{cpan_name}-v%{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
%defattr(-,root,root,755)
%doc Changes HACKING README
%changelog