File perl-Text-ANSI-Fold.spec of Package perl-Text-ANSI-Fold

#
# spec file for package perl-Text-ANSI-Fold
#
# Copyright (c) 2026 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define cpan_name Text-ANSI-Fold
Name:           perl-Text-ANSI-Fold
Version:        2.3305
Release:        0
License:        Artistic-1.0 OR GPL-1.0-or-later
Summary:        Text folding library supporting ANSI terminal sequence and Asian wide ch[cut]
URL:            https://metacpan.org/release/%{cpan_name}
Source0:        https://cpan.metacpan.org/authors/id/U/UT/UTASHIRO/%{cpan_name}-%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(List::Util) >= 1.45
BuildRequires:  perl(Module::Build::Tiny) >= 0.035
BuildRequires:  perl(Test::More) >= 0.98
BuildRequires:  perl(Text::VisualWidth::PP) >= 0.08
Requires:       perl(List::Util) >= 1.45
Requires:       perl(Text::VisualWidth::PP) >= 0.08
%{perl_requires}

%description
Text::ANSI::Fold provides capability to divide a text into two parts by
given width. Text can include ANSI terminal sequences and the width is
calculated by its visible representation. If the text is divided in the
middle of colored region, reset sequence is appended to the former text,
and color recover sequence is inserted before the latter string.

OSC 8 hyperlink sequences are also handled properly. If the text is divided
in the middle of a hyperlink, the link is closed at the end of the former
text and reopened at the beginning of the latter string.

This module also support Unicode Asian full-width and non-spacing combining
characters properly. Japanese text formatting with head-or-end of line
prohibition character is also supported. Set the linebreak mode to enable
it.

Since the overhead of ANSI escape sequence handling is not significant when
the data does not include them, this module can be used for normal text
processing with small penalty.

%prep
%autosetup  -n %{cpan_name}-%{version}

%build
perl Build.PL --installdirs=vendor
./Build build --flags=%{?_smp_mflags}

%check
./Build test

%install
./Build install --destdir=%{buildroot} --create_packlist=0
%perl_gen_filelist

%files -f %{name}.files
%doc Changes OSC8-SUPPORT.md README.md
%license LICENSE

%changelog
openSUSE Build Service is sponsored by