Disable non-core dependencies when bootstrapping a core module

This commit is contained in:
Jitka Plesnikova 2024-07-22 13:02:25 +02:00
parent 98b83a6707
commit d6959a8c7d

View File

@ -1,11 +1,17 @@
# Disable non-core dependencies when bootstrapping a core module
%if !%{defined perl_bootstrap}
# Recognize terminal size
%bcond_without perl_Term_Table_enables_terminal
# Respect Unicode rules when breaking lines
%bcond_without perl_Term_Table_enables_unicode
%else
%bcond_with perl_Term_Table_enables_terminal
%bcond_with perl_Term_Table_enables_unicode
%endif
Name: perl-Term-Table
Version: 0.018
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Format a header and rows into a table
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/Term-Table
@ -24,7 +30,9 @@ BuildRequires: perl(warnings)
BuildRequires: perl(Carp)
BuildRequires: perl(Config)
BuildRequires: perl(List::Util)
%if !%{defined perl_bootstrap}
BuildRequires: perl(Object::HashBase) >= 0.008
%endif
BuildRequires: perl(Scalar::Util)
# Optional run-time:
%if %{with perl_Term_Table_enables_terminal}
@ -50,6 +58,11 @@ Recommends: perl(Term::Size::Any) >= 0.002
Recommends: perl(Unicode::GCString) >= 2013.10
%endif
%if %{defined perl_bootstrap}
# Filter modules bundled for tests
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(main::HBase.*\\)
%endif
%description
This Perl module is able to format rows of data into tables.
@ -64,12 +77,14 @@ with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n Term-Table-%{version}
%if !%{defined perl_bootstrap}
%patch -P0 -p1
# Delete bundled Object::HashBase
for F in lib/Term/Table/HashBase.pm t/HashBase.t; do
perl -e 'unlink $ARGV[0] or die $!' "$F"
perl -i -s -ne 'print $_ unless m{\A\Q$file\E\b}' -- -file="$F" MANIFEST
done
%endif
# Help generators to recognize Perl scripts
for F in t/*.t t/Table/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"
@ -106,6 +121,9 @@ make test
%{_libexecdir}/%{name}
%changelog
* Fri Jul 19 2024 Jitka Plesnikova <jplesnik@redhat.com> - 0.018-5
- Disable non-core dependencies when bootstrapping a core module
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.018-4
- Bump release for June 2024 mass rebuild