public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Server-Starter] rawhide: Package the tests
@ 2026-06-22 11:05 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-22 11:05 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/perl-Server-Starter
Branch : rawhide
Commit : 53efe9ef948047e7d994b4ac5e568b408bb44e00
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-06-22T13:00:31+02:00
Stats  : +41/-5 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Server-Starter/c/53efe9ef948047e7d994b4ac5e568b408bb44e00?branch=rawhide

Log:
Package the tests

---
diff --git a/perl-Server-Starter.rpmlintrc b/perl-Server-Starter.rpmlintrc
index 33a7fcf..20585ac 100644
--- a/perl-Server-Starter.rpmlintrc
+++ b/perl-Server-Starter.rpmlintrc
@@ -1,3 +1,4 @@
 addFilter('spelling-error \(\'Superdaemon\'')
 addFilter('spelling-error \(\'superdaemon\'')
 addFilter('summary-not-capitalized perl-Server-Starter start_server')
+addFilter('-tests\.noarch: W: no-documentation')

diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index c2f2c4f..f6dec1c 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -11,6 +11,7 @@ BuildRequires:  perl-generators
 BuildRequires:  perl-interpreter
 BuildRequires:  perl(:VERSION) >= 5.8.1
 BuildRequires:  perl(base)
+BuildRequires:  perl(Config)
 BuildRequires:  perl(File::Basename)
 BuildRequires:  perl(File::Spec)
 BuildRequires:  perl(Module::Build)
@@ -39,9 +40,8 @@ BuildRequires:  perl(Test::Requires)
 BuildRequires:  perl(Test::SharedFork)
 BuildRequires:  perl(Test::TCP) >= 2.08
 
-%package start_server
-Summary:        perl-Server-Starter start_server script
-Requires:       perl-Server-Starter = %{version}-%{release}
+# Remove under-specified depenendencies
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::TCP\\)$
 
 %description
 It is often a pain to write a server program that supports graceful
@@ -53,11 +53,32 @@ handles the necessary tasks (for example, responding to incoming
 connections). The spawned server programs under Server::Starter call
 accept(2) and handle the requests.
 
+%package start_server
+Summary:        perl-Server-Starter start_server script
+Requires:       perl-Server-Starter = %{version}-%{release}
+
 %description start_server
 perl-Server-Starter's start_server script.
 
+%package tests
+Summary:        Tests for %{name}
+Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires:       perl-Test-Harness
+Requires:       perl(IO::Socket::IP)
+Requires:       perl(Test::TCP) >= 2.08
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
 %prep
 %setup -q -n Server-Starter-%{version}
+# 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
+chmod 0755 t/*.pl
 
 %build
 unset RELEASE_TESTING
@@ -65,8 +86,18 @@ perl Build.PL --installdirs=vendor
 ./Build
 
 %install
-./Build install --destdir=$RPM_BUILD_ROOT --create_packlist=0
-%{_fixperms} $RPM_BUILD_ROOT/*
+./Build install --destdir=%{buildroot} --create_packlist=0
+%{_fixperms} %{buildroot}/*
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}
+cp -a t %{buildroot}%{_libexecdir}/%{name}
+cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/sh
+unset AUTO_RESTART_INTERVAL ENABLE_AUTO_RESTART ENVDIR KILL_OLD_DELAY \
+    SERVER_STARTER_GENERATION SERVER_STARTER_PORT
+cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+EOF
+chmod +x %{buildroot}%{_libexecdir}/%{name}/test
 
 %check
 unset AUTO_RESTART_INTERVAL ENABLE_AUTO_RESTART ENVDIR KILL_OLD_DELAY \
@@ -86,9 +117,13 @@ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print
 %{_bindir}/start_server
 %{_mandir}/man1/start_server.*
 
+%files tests
+%{_libexecdir}/%{name}
+
 %changelog
 * Mon Jun 22 2026 Petr Pisar <ppisar@redhat.com> - 0.35-20
 - Modernize a spec file
+- Package the tests
 
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.35-19
 - 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-22 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-22 11:05 [rpms/perl-Server-Starter] 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