public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Class-Autouse] rawhide: Package the tests
Date: Thu, 04 Jun 2026 14:55:50 GMT	[thread overview]
Message-ID: <178058495030.1.15578725929784468381.rpms-perl-Class-Autouse-da5411c5e8fb@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-Class-Autouse
Branch : rawhide
Commit : da5411c5e8fbb1c24be566a40fbe42bc5f937e80
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-06-04T16:54:24+02:00
Stats  : +45/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Class-Autouse/c/da5411c5e8fbb1c24be566a40fbe42bc5f937e80?branch=rawhide

Log:
Package the tests

---
diff --git a/perl-Class-Autouse.rpmlintrc b/perl-Class-Autouse.rpmlintrc
index dac5d69..f6e8c1f 100644
--- a/perl-Class-Autouse.rpmlintrc
+++ b/perl-Class-Autouse.rpmlintrc
@@ -1 +1,2 @@
 addFilter('spelling-error \(\'Manip\'')
+addFilter('-tests\.noarch: W: no-documentation')

diff --git a/perl-Class-Autouse.spec b/perl-Class-Autouse.spec
index e6788b7..0c5eaed 100644
--- a/perl-Class-Autouse.spec
+++ b/perl-Class-Autouse.spec
@@ -7,10 +7,12 @@ URL:            https://metacpan.org/release/Class-Autouse
 Source0:        https://cpan.metacpan.org/authors/id/E/ET/ETHER/Class-Autouse-%{version}.tar.gz
 BuildArch:      noarch
 BuildRequires:  coreutils
+BuildRequires:  findutils
 BuildRequires:  make
 BuildRequires:  perl-generators
 BuildRequires:  perl-interpreter
 BuildRequires:  perl(:VERSION) >= 5.6
+BuildRequires:  perl(Config)
 BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
 BuildRequires:  perl(strict)
 BuildRequires:  perl(warnings)
@@ -34,8 +36,14 @@ BuildRequires:  perl(IO::File)
 BuildRequires:  perl(lib)
 BuildRequires:  perl(Test::More) >= 0.94
 # Optional tests:
-BuildRequires:  perl(prefork)
 # CPAN::Meta 2.120900 not helpful
+BuildRequires:  perl(prefork)
+
+# Filter under-specified dependencies
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)$
+# Hide private modules
+%global __requires_exclude %{__requires_exclude}|^perl\\((baseA|baseC|C|E)\\)
+%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\((A|A::B|baseA|baseB|baseC|baseD|C|D|E|F|G|H|I|J|T|T::A|T::B|T::B::G)\\)
 
 %description
 Class::Autouse allows you to specify a class the will only load when a
@@ -43,8 +51,29 @@ method of that class is called. For large classes that might not be used
 during the running of a program, such as Date::Manip, this can save you
 large amounts of memory, and decrease the script load time.
 
+%package tests
+Summary:        Tests for %{name}
+BuildArch:      noarch
+Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires:       perl(prefork)
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
 %prep
 %setup -q -n Class-Autouse-%{version}
+# Correct permissions
+find -type f -exec chmod 0644 {} +
+# Help generators to recognize Perl scripts
+for F in t/*.t; do
+    perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"
+    chmod +x "$F"
+done
+# Correct EOLs
+for F in t/02_main.t t/15_regex.t; do
+    perl -i -pe 's/\r$//' "$F"
+done
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
@@ -52,7 +81,16 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
 
 %install
 %{make_install}
-%{_fixperms} $RPM_BUILD_ROOT/*
+%{_fixperms} %{buildroot}/*
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}
+cp -a t %{buildroot}%{_libexecdir}/%{name}
+cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/sh
+unset AUTHOR_TESTING
+cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+EOF
+chmod +x %{buildroot}%{_libexecdir}/%{name}/test
 
 %check
 unset AUTHOR_TESTING
@@ -67,9 +105,13 @@ make test
 %{perl_vendorlib}/Class/Autouse.pm
 %{_mandir}/man3/Class::Autouse.*
 
+%files tests
+%{_libexecdir}/%{name}
+
 %changelog
 * Thu Jun 04 2026 Petr Pisar <ppisar@redhat.com> - 2.02-3
 - Modernize a spec file
+- Package the tests
 
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.02-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

                 reply	other threads:[~2026-06-04 14:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178058495030.1.15578725929784468381.rpms-perl-Class-Autouse-da5411c5e8fb@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox