# 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 Name: perl-PPIx-Utils Version: 0.003 Release: 9.%{__distinit}%{__distvers} Summary: Utility functions for PPI License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/PPIx-Utils Source0: https://cpan.metacpan.org/authors/id/D/DB/DBOOK/PPIx-Utils-%{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(B::Keywords) >= 1.09 BuildRequires: perl(Exporter) BuildRequires: perl(PPI) >= 1.250 BuildRequires: perl(PPI::Document::Fragment) BuildRequires: perl(PPI::Token::Quote::Single) BuildRequires: perl(Scalar::Util) BuildRequires: perl(strict) BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(Carp) BuildRequires: perl(Data::Dumper) BuildRequires: perl(File::Spec) BuildRequires: perl(PPI::Document) BuildRequires: perl(PPI::Dumper) BuildRequires: perl(PPI::Statement) BuildRequires: perl(PPI::Statement::Break) BuildRequires: perl(PPI::Statement::Compound) BuildRequires: perl(PPI::Statement::Data) BuildRequires: perl(PPI::Statement::End) BuildRequires: perl(PPI::Statement::Expression) BuildRequires: perl(PPI::Statement::Include) BuildRequires: perl(PPI::Statement::Null) BuildRequires: perl(PPI::Statement::Package) BuildRequires: perl(PPI::Statement::Scheduled) BuildRequires: perl(PPI::Statement::Sub) BuildRequires: perl(PPI::Statement::Unknown) BuildRequires: perl(PPI::Statement::UnmatchedBrace) BuildRequires: perl(PPI::Statement::Variable) BuildRequires: perl(PPI::Token::Word) BuildRequires: perl(Test::More) >= 0.88 # Optional Tests BuildRequires: perl(CPAN::Meta) >= 2.120900 BuildRequires: perl(CPAN::Meta::Prereqs) # Dependencies %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif %description PPIx::Utils is a collection of utility functions for working with PPI documents. The functions are organized into submodules, and may be imported from the appropriate submodule or via this module. These functions were originally from Perl::Critic::Utils and related modules, and have been split off to this distribution for use outside of Perl::Critic. %prep %setup -q -n PPIx-Utils-%{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 %files %license LICENSE %doc Changes README %{perl_vendorlib}/PPIx/ %{_mandir}/man3/PPIx::Utils.3* %{_mandir}/man3/PPIx::Utils::Classification.3* %{_mandir}/man3/PPIx::Utils::Language.3* %{_mandir}/man3/PPIx::Utils::Traversal.3* %changelog * Fri Jul 7 2023 Paul Howarth - 0.003-9 - Use SPDX-format license tag * Thu Apr 22 2021 Paul Howarth - 0.003-1 - Initial RPM version