public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Clownfish-CFC] rawhide: Package the tests
Date: Mon, 29 Jun 2026 08:49:49 GMT	[thread overview]
Message-ID: <178272298924.1.13149730105425342227.rpms-perl-Clownfish-CFC-46d998574809@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-Clownfish-CFC
Branch : rawhide
Commit : 46d99857480953c255477f345c06508231d0a30a
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-06-29T10:48:10+02:00
Stats  : +49/-4 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Clownfish-CFC/c/46d99857480953c255477f345c06508231d0a30a?branch=rawhide

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 2aaa0d1..d99f553 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
 
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-32
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

                 reply	other threads:[~2026-06-29  8:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178272298924.1.13149730105425342227.rpms-perl-Clownfish-CFC-46d998574809@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox