File perl-File-Slurper-Temp.spec of Package perl-File-Slurper-Temp
#
# spec file for package perl-File-Slurper-Temp
#
# 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 File-Slurper-Temp
Name: perl-File-Slurper-Temp
Version: 0.010
Release: 0
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: File::Slurper + File::Temp
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/P/PE/PERLANCAR/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Carp) >= 1.12
BuildRequires: perl(File::Slurper)
BuildRequires: perl(File::Temp) >= 0.2310
BuildRequires: perl(Test::Exception)
BuildRequires: perl(Test::More) >= 0.98
Requires: perl(Carp) >= 1.12
Requires: perl(File::Slurper)
Requires: perl(File::Temp) >= 0.2310
%{perl_requires}
%description
This module is a simple combination of File::Slurper and File::Temp. It
provides its version of write_text and write_binary, as well as a couple of
functions of its own.
This module's version of 'write_text' and 'write_binary' write to temporary
file first using File::Temp's tempfile() before renaming to the final
destination path using Perl's rename(). If the destination path is
originally a symlink, it will be replaced with a regular file by
'rename()'. This can avoid symlink attack.
In addition the above two functions, this module also provides
write_text_to_tempfile and write_binary_to_tempfile. You don't have to
specify destination path but just content to write, and the functions will
return the temporary filename created.
%prep
%autosetup -n %{cpan_name}-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%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