File perl-Sys-Export.spec of Package perl-Sys-Export

#
# spec file for package perl-Sys-Export
#
# Copyright (c) 2025 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 Sys-Export
Name:           perl-Sys-Export
Version:        0.003
Release:        0
License:        Artistic-1.0 OR GPL-1.0-or-later
Summary:        Export a subset of installed system files, for initrd or containers
URL:            https://metacpan.org/release/%{cpan_name}
Source0:        https://cpan.metacpan.org/authors/id/N/NE/NERDVANA/%{cpan_name}-%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Test2::Suite) >= 0.000139
BuildRequires:  perl(Test2::Tools::Subtest)
BuildRequires:  perl(Test2::V0)
BuildRequires:  perl(autodie)
BuildRequires:  perl(experimental)
BuildRequires:  perl(parent)
Requires:       perl(experimental)
Requires:       perl(parent)
%{perl_requires}

%description
This module is designed to export a subset of an operating system to a new
directory, automatically detecting and including any libraries or
interpreters required by the requested subset, and optionally rewriting
paths and users/groups and updating the copied files to refer to the
rewritten paths, when possible.

The actual export implementation is handled by a OS-specific module, like
Sys::Export::Linux. This top-level module just exports methods. You can
configure a global exporter instance on the 'use' line, and then call its
methods via exported functions. For instance,

  use Sys::Export \%options;

is roughly equivalent to:

  BEGIN {
    if ($^O eq 'linux') {
      require Sys::Export::Linux;
      $Sys::Export::exporter= Sys::Export::Linux->new(\%options);
    } else {
      ...
    }
    sub exporter      { $Sys::Export::exporter }
    sub add           { $Sys::Export::exporter->add(@_) }
    sub rewrite_path  { $Sys::Export::exporter->rewrite_path(@_) }
    sub rewrite_user  { $Sys::Export::exporter->rewrite_user(@_) }
    sub rewrite_group { $Sys::Export::exporter->rewrite_group(@_) }
    sub finish        { $Sys::Export::exporter->finish }
  }

In other words, just a convenience for creating an exporter instance and
giving you access to most of its important methods without needing to
reference the object. You can skip this module entirely and just directly
use a 'Sys::Export::Linux' object, if you prefer.

Currently, only Linux is fully supported.

%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.md
%license LICENSE

%changelog
openSUSE Build Service is sponsored by