# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # noarch, but to avoid debug* files interfering with manifest test: %global debug_package %{nil} # Similarly, for package note feature %undefine _package_note_file Name: perl-Test-Synopsis Version: 0.17 Release: 7.%{__distinit}%{__distvers} Summary: Test your SYNOPSIS code License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Test-Synopsis Source0: https://cpan.metacpan.org/modules/by-module/Test/Test-Synopsis-%{version}.tar.gz BuildArch: noarch # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) # Module Runtime BuildRequires: perl(ExtUtils::Manifest) BuildRequires: perl(parent) BuildRequires: perl(Pod::Simple) >= 3.09 BuildRequires: perl(strict) BuildRequires: perl(Test::Builder::Module) BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(blib) BuildRequires: perl(File::Spec) BuildRequires: perl(IO::Handle) BuildRequires: perl(IPC::Open3) BuildRequires: perl(Test::Builder) >= 0.34 BuildRequires: perl(Test::Builder::Tester) BuildRequires: perl(Test::More) # Extra Tests %if 0%{!?perl_bootstrap:1} BuildRequires: perl(Pod::Coverage::TrustPod) BuildRequires: perl(Pod::Wordlist) >= 1.06 BuildRequires: perl(Test::CPAN::Changes) BuildRequires: perl(Test::CPAN::Meta) BuildRequires: perl(Test::CPAN::Meta::JSON) BuildRequires: perl(Test::DistManifest) BuildRequires: perl(Test::EOL) BuildRequires: perl(Test::Kwalitee) >= 1.21 BuildRequires: perl(Test::MinimumVersion) BuildRequires: perl(Test::Mojibake) BuildRequires: perl(Test::More) >= 0.96 BuildRequires: perl(Test::NoTabs) BuildRequires: perl(Test::Pod) >= 1.41 BuildRequires: perl(Test::Pod::Coverage) >= 1.08 BuildRequires: perl(Test::Portability::Files) BuildRequires: perl(Test::Spelling) >= 0.12, hunspell-en BuildRequires: perl(Test::Version) %endif # Dependencies %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif Requires: perl(Test::Builder::Module) %description Test::Synopsis is an (author) test module to find .pm or .pod files under your lib directory and then make sure the example snippet code in your SYNOPSIS section passes the perl compile check. Note that this module only checks the perl syntax (by wrapping the code with sub) and doesn't actually run the code. %prep %setup -q -n Test-Synopsis-%{version} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} %check make test %if 0%{!?perl_bootstrap:1} make test TEST_FILES="$(echo $(find xt/ -name '*.t'))" %endif %files %license LICENSE %doc Changes README README.md %{perl_vendorlib}/Test/ %{_mandir}/man3/Test::Synopsis.3* %changelog * Tue May 16 2023 Paul Howarth - 0.17-7 - Use SPDX-format license tag - Bump Test::Spelling version requirement to 0.12 as per upstream * Fri Mar 11 2022 Paul Howarth - 0.17-3 - Work around FTBFS triggered by package note feature * Mon Dec 13 2021 Paul Howarth - 0.17-1 - Update to 0.17 - Mention related module Test::Synopsis::Expectation in docs (GH#22) - Use %%license unconditionally * Tue Mar 10 2020 Paul Howarth - 0.16-6 - BR: perl(blib) for t/00-compile.t * Tue May 28 2019 Paul Howarth - 0.16-1 - Update to 0.16 - Fix test failures when version 0.23 of Test::Spelling is in use (GH#21) * Fri May 24 2019 Paul Howarth - 0.15-13 - Fix FTBFS with Test::Spelling 0.23 (#1713565) - Switch upstream from search.cpan.org to metacpan.org * Thu Apr 5 2018 Paul Howarth - 0.15-8 - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - Drop workaround for building with Test::Builder 0.32 * Thu Oct 6 2016 Paul Howarth - 0.15-3 - BR: perl-generators where available - Simplify find command using -delete * Thu Mar 3 2016 Paul Howarth - 0.15-1 - Update to 0.15 - Require Pod::Simple ≥ 3.09, as needed feature missing from older versions * Wed Feb 17 2016 Paul Howarth - 0.14-1 - Update to 0.14 - Complete rewrite by dolmen - The undocumented PRIVATE subroutine extract_synopsis has been renamed; any code using it will break - Update patch to support building with Test::Builder 0.32 * Tue Jan 5 2016 Paul Howarth - 0.13-1 - Update to 0.13 - Fix #12 (conflict with multiple chunks) - Update patch to support building with Test::Builder 0.32 * Mon Dec 28 2015 Paul Howarth - 0.12-1 - Update to 0.12 - Add META.json - Re-enable use of Test::Vars with Perl 5.22 - Drop patch for building with Test::More < 0.82, no longer needed * Mon Jun 29 2015 Paul Howarth - 0.11-4 - Disable use of Test::Vars with Perl 5.22 (https://github.com/gfx/p5-Test-Vars/issues/11) * Thu Oct 9 2014 Paul Howarth - 0.11-1 - Update to 0.11 - Added #10 to CAVEATS (redefined warnings) - Fixed #11 (failing tests on newer perls) - Use %%license where possible - Update patch to support building with Test::Builder 0.32 - Add patch to support building with Test::More < 0.82 * Fri Feb 7 2014 Paul Howarth - 0.10-1 - Update to 0.10 - Fixed prereqs to allow earlier versions of Test-Simple (Issue #9) - Removed POD errors from test .pm's to increase Kwalitee - Reverted the change of renaming extract_synopsis() to _extract_synopsis(), as it appears some distros have used undocumented extract_synopsis() in their user tests, and the change is causing their distros to fail - Added contributors into META file through dzil plugin * Thu Feb 6 2014 Paul Howarth - 0.08-2 - Use Test::Kwalitee::Extra where possible * Wed Feb 5 2014 Paul Howarth - 0.08-1 - Update to 0.08 - Implemented proper handling of __DATA__ tokens - Removed unwanted warnings issued during tests - Upped required Test-Simple distro version (fixes Issue #9) - Minor pod fixes - Update patch to support building with Test::Builder 0.32 * Wed Feb 5 2014 Paul Howarth - 0.07-1 - Update to 0.07 - Converted to dzil for automation of everything and auto-generation of all the author/release tests and extra files - Fixed CPAN RT#84863: Should ignore descriptions, and other text that is not code - Fixed CPAN RT#76856: Sandbox breaks when combining synopses that use Moose and Moose::Role - Fixed CPAN RT#69438: Heredocs fail to terminate because of the leading space for verbatim blocks - Fixed CPAN RT#54731: Suggest =for conditionalized synopsis check - Fixed CPAN RT#53192: Missing Copyright information for Test::Synopsis - Fixed CPAN RT#52684: Pod directive to skip Test::Synopsis - Fixed CPAN RT#51534: End =for at blank line - Fixed CPAN RT#51535: Show failing code on error - This release by ZOFFIX -> update source URL - Package upstream's LICENSE and README.md files - Classify buildreqs by usage - Don't bother trying to run the extra tests unless we have Test::More ≥ 0.96 and we're not bootstrapping - Add patch to support building with Test::Builder 0.32 if necessary * Mon Jul 16 2012 Paul Howarth - 0.06-13 - Perl 5.16 post-bootstrap rebuild * Mon Jun 25 2012 Paul Howarth - 0.06-12 - BR: perl(base), perl(Carp) and perl(File::Spec) - Drop %%defattr, redundant since rpm 4.4 - Don't need to remove empty directories from the buildroot * Tue Jan 24 2012 Paul Howarth - 0.06-7 - BR: perl(ExtUtils::Manifest) - Only BR: perl(Test::Perl::Critic) if we're not bootstrapping - Use DESTDIR rather than PERL_INSTALL_ROOT * Thu Jul 7 2011 Paul Howarth - 0.06-6 - Rebuild for perl 5.14.1 in Rawhide - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Thu Jun 24 2010 Paul Howarth - 0.06-5 - Rebuild for perl 5.12.1 in Rawhide * Tue Jun 15 2010 Paul Howarth - 0.06-4 - Add build and runtime dependencies on perl(Test::Builder::Module) - Drop perl 5.8.1 requirement, always met if we have Test::Builder::Module * Mon May 17 2010 Paul Howarth - 0.06-3 - Fix dist tag for RHEL-6 Beta * Tue Feb 2 2010 Paul Howarth - 0.06-2 - Add buildreq perl(Test::Perl::Critic) if we have Perl 5.8.8 or later * Fri Nov 27 2009 Paul Howarth - 0.06-1 - Initial RPM version