public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Net-UPnP] f45: Package the tests
@ 2026-11-09 17:41
0 siblings, 0 replies; only message in thread
From: @ 2026-11-09 17:41 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/perl-Net-UPnP
Branch : f45
Commit : 95ebdd2477d270cb4f7ab1df2cfa2692ede8b0a2
Author : Petr Písař <ppisar@redhat.com>
Date : 2026-11-09T18:36:07+01:00
Stats : +37/-5 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/perl-Net-UPnP/c/95ebdd2477d270cb4f7ab1df2cfa2692ede8b0a2?branch=f45
Log:
Package the tests
---
diff --git a/perl-Net-UPnP.rpmlintrc b/perl-Net-UPnP.rpmlintrc
new file mode 100644
index 0000000..a5d5f5e
--- /dev/null
+++ b/perl-Net-UPnP.rpmlintrc
@@ -0,0 +1 @@
+addFilter('-tests\.noarch: W: no-documentation')
diff --git a/perl-Net-UPnP.spec b/perl-Net-UPnP.spec
index d9c8fa3..6f13204 100644
--- a/perl-Net-UPnP.spec
+++ b/perl-Net-UPnP.spec
@@ -32,25 +32,42 @@ BuildRequires: perl(version)
BuildRequires: perl(Cwd)
BuildRequires: perl(File::Temp)
BuildRequires: perl(IO::Socket::INET)
+# Shell is a private module generated by t/media-safety.t
BuildRequires: perl(Test::More)
BuildRequires: perl(utf8)
# Optional test:
BuildRequires: perl(XML::Parser)
+# Hide private modules
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Shell\\)
+
%description
This package provides some functions to control UPnP devices.
+%package tests
+Summary: Tests for %{name}
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: perl-Test-Harness
+Requires: perl(XML::Parser)
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
%prep
%setup -q -n Net-UPnP-%{version}
# Fix file attributes
find -name '*.pm' -exec chmod a-x '{}' +
# Fix shebangs
-for file in examples/*.pl; do
- sed '1 s|^#!/usr/bin/env perl|%(perl -MConfig -e 'print $Config{startperl}')|g' \
- "$file" > "${file}.mod" && \
- touch -r "$file" "${file}.mod" && \
- mv "${file}.mod" "$file"
+for F in examples/*.pl; do
+ perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"
+done
+
+# 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
%build
@@ -60,6 +77,16 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install
%{make_install}
%{_fixperms} %{buildroot}/*
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}
+cp -a t %{buildroot}%{_libexecdir}/%{name}
+mkdir -p %{buildroot}%{_libexecdir}/%{name}/examples
+cp -a examples/dms2vodcast.pl %{buildroot}%{_libexecdir}/%{name}/examples
+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}')
@@ -75,9 +102,13 @@ make test
%{_mandir}/man3/Net::UPnP.*
%{_mandir}/man3/Net::UPnP::*
+%files tests
+%{_libexecdir}/%{name}
+
%changelog
* Mon Nov 09 2026 Petr Pisar <ppisar@redhat.com> - 1:1.4.7-1
- 1.4.7 bump
+- Package the tests
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.4.6-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-09 17:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 17:41 [rpms/perl-Net-UPnP] f45: 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