public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Class-Autouse] rawhide: Package the tests
@ 2026-06-04 14:55
0 siblings, 0 replies; only message in thread
From: @ 2026-06-04 14:55 UTC (permalink / raw)
To: git-commits
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-04 14:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04 14:55 [rpms/perl-Class-Autouse] rawhide: Package the tests
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox