Files
perl-PerlIO-eol/perl-PerlIO-eol.spec

79 lines
2.6 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package perl-PerlIO-eol
#
# Copyright (c) 2024 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 PerlIO-eol
Name: perl-PerlIO-eol
Version: 0.190.0
Release: 0
%define cpan_version 0.19
Provides: perl(PerlIO::eol) = 0.190.0
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: PerlIO layer for normalizing line endings
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
2025-08-12 18:16:29 +02:00
Source100: README.md
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(File::Temp) >= 0.19
%undefine __perllib_provides
%{perl_requires}
%description
This layer normalizes any of 'CR', 'LF', 'CRLF' and 'Native' into the
designated line ending. It works for both input and output handles.
If you specify two different line endings joined by a '-', it will use the
first one for reading and the second one for writing. For example, the
'LF-CRLF' encoding means that all input should be normalized to 'LF', and
all output should be normalized to 'CRLF'.
By default, data with mixed newlines are normalized silently. Append a '!'
to the line ending will raise a fatal exception when mixed newlines are
spotted. Append a '?' will raise a warning instead.
It is advised to pop any potential ':crlf' or encoding layers before this
layer; this is usually done using a ':raw' prefix.
This module also optionally exports a 'eol_is_mixed' function; it takes a
string and returns the position of the first inconsistent line ending found
in that string, or '0' if the line endings are consistent.
The 'CR', 'LF', 'CRLF' and 'NATIVE' constants are also exported at request.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README
%license LICENSE
%changelog