public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-String-Similarity] epel10: Package the tests
@ 2026-09-09 8:47
0 siblings, 0 replies; only message in thread
From: @ 2026-09-09 8:47 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/perl-String-Similarity
Branch : epel10
Commit : 269b6a19720f9628fa7c0f84c9316a7edc88c80e
Author : Petr Písař <ppisar@redhat.com>
Date : 2024-12-09T12:46:35+01:00
Stats : +25/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/perl-String-Similarity/c/269b6a19720f9628fa7c0f84c9316a7edc88c80e?branch=epel10
Log:
Package the tests
---
diff --git a/perl-String-Similarity.rpmlintrc b/perl-String-Similarity.rpmlintrc
new file mode 100644
index 0000000..a5d5f5e
--- /dev/null
+++ b/perl-String-Similarity.rpmlintrc
@@ -0,0 +1 @@
+addFilter('-tests\.noarch: W: no-documentation')
diff --git a/perl-String-Similarity.spec b/perl-String-Similarity.spec
index 58656e0..af874f2 100644
--- a/perl-String-Similarity.spec
+++ b/perl-String-Similarity.spec
@@ -29,6 +29,16 @@ A value of 0 means that the strings are entirely different. A value of 1
means that the strings are identical. Everything else lies between 0 and 1
and describes the amount of similarity between the strings.
+%package tests
+Summary: Tests for %{name}
+BuildArch: noarch
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: perl-Test-Harness
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
%prep
%setup -q -n String-Similarity-%{version}
@@ -38,8 +48,16 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_
%install
%{make_install}
-find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
-%{_fixperms} $RPM_BUILD_ROOT/*
+find %{buildroot} -type f -name '*.bs' -size 0 -delete
+%{_fixperms} %{buildroot}/*
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}
+cp -a t %{buildroot}%{_libexecdir}/%{name}
+cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/sh
+cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+EOF
+chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
@@ -54,9 +72,13 @@ make test
%{perl_vendorarch}/String/Similarity.pm
%{_mandir}/man3/String::Similarity.*
+%files tests
+%{_libexecdir}/%{name}
+
%changelog
* Mon Dec 09 2024 Petr Pisar <ppisar@redhat.com> - 1.04-45
- Modernize a spec file
+- Package the tests
* Fri Jul 26 2024 Miroslav Suchý <msuchy@redhat.com> - 1.04-44
- convert license to SPDX
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-09 8:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-09 8:47 [rpms/perl-String-Similarity] epel10: 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