public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-Clownfish-CFC] f43: Package the tests
@ 2026-06-29 8:55
0 siblings, 0 replies; only message in thread
From: @ 2026-06-29 8:55 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/perl-Clownfish-CFC
Branch : f43
Commit : 284538242e61837eeac9fa3aed9666fe8a976c00
Author : Petr Písař <ppisar@redhat.com>
Date : 2026-06-29T10:54:32+02:00
Stats : +49/-4 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/perl-Clownfish-CFC/c/284538242e61837eeac9fa3aed9666fe8a976c00?branch=f43
Log:
Package the tests
---
diff --git a/perl-Clownfish-CFC.rpmlintrc b/perl-Clownfish-CFC.rpmlintrc
new file mode 100644
index 0000000..a5d5f5e
--- /dev/null
+++ b/perl-Clownfish-CFC.rpmlintrc
@@ -0,0 +1 @@
+addFilter('-tests\.noarch: W: no-documentation')
diff --git a/perl-Clownfish-CFC.spec b/perl-Clownfish-CFC.spec
index 70da150..3b6a8cc 100644
--- a/perl-Clownfish-CFC.spec
+++ b/perl-Clownfish-CFC.spec
@@ -5,8 +5,9 @@ Summary: Compiler for Apache Clownfish
# other files: Apache-2.0
## Unbundled
# lemon: Apache-2.0
-# modules/CommonMark: BSD-2-Clause and MIT
+# modules/CommonMark: BSD-2-Clause AND MIT
License: Apache-2.0
+SourceLicense: Apache-2.0 AND BSD-2-Clause and MIT
URL: https://metacpan.org/release/Clownfish-CFC
Source0: https://cpan.metacpan.org/authors/id/K/KA/KARMAN/Clownfish-CFC-%{version}.tar.gz
# Use system lemon, <https://issues.apache.org/jira/browse/CLOWNFISH-60>
@@ -74,9 +75,24 @@ Requires: perl(ExtUtils::ParseXS) >= 3.00
# the other modules that are defined with version in their respective files.
%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\([^)]*\\)$
+# Hide private modules
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Clownfish::CFC::Test::
+%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\(Clownfish::CFC::Test::
+
%description
This is a compiler for Apache Clownfish.
+%package tests
+Summary: Tests for %{name}
+BuildArch: noarch
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: coreutils
+Requires: perl-Test-Harness
+
+%description tests
+Tests from %{name}. Execute them
+with "%{_libexecdir}/%{name}/test".
+
%prep
%autosetup -p1 -n Clownfish-CFC-%{version}
# Unbundle lemon
@@ -85,6 +101,11 @@ perl -i -ne 'print $_ unless m{^lemon/}' MANIFEST
# Unbundle cmark
rm -rf modules/CommonMark
perl -i -ne 'print $_ unless m{^modules/CommonMark/}' MANIFEST
+# 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
perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS" \
@@ -92,9 +113,28 @@ perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS" \
./Build
%install
-./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
-find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
-%{_fixperms} $RPM_BUILD_ROOT/*
+./Build install destdir=%{buildroot} create_packlist=0
+find %{buildroot} -type f -name '*.bs' -size 0 -delete
+%{_fixperms} %{buildroot}/*
+# Install tests
+mkdir -p %{buildroot}%{_libexecdir}/%{name}
+cp -a t %{buildroot}%{_libexecdir}/%{name}
+rm %{buildroot}%{_libexecdir}/%{name}/t/000-load.t
+mkdir -p %{buildroot}%{_libexecdir}/%{name}/buildlib/Clownfish/CFC
+cp -a buildlib/Clownfish/CFC/Test %{buildroot}%{_libexecdir}/%{name}/buildlib/Clownfish/CFC
+cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
+#!/bin/bash
+set -e
+# Some tests, e.g. t/001-util.t, write into CWD
+DIR=$(mktemp -d)
+cp -a %{_libexecdir}/%{name}/* "$DIR"
+pushd "$DIR"
+unset CHARM_VALGRIND CHARM_VERBOSITY CLOWNFISH_INCLUDE
+prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
+popd
+rm -r "$DIR"
+EOF
+chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
unset CHARM_VALGRIND CHARM_VERBOSITY CLOWNFISH_INCLUDE
@@ -111,9 +151,13 @@ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print
%{perl_vendorarch}/Clownfish/CFC.{pm,pod}
%{_mandir}/man3/Clownfish::CFC.*
+%files tests
+%{_libexecdir}/%{name}
+
%changelog
* Mon Jun 29 2026 Petr Pisar <ppisar@redhat.com> - 0.6.4-1
- 0.6.4 bump
+- Package the tests
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-29 8:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 8:55 [rpms/perl-Clownfish-CFC] f43: 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