2017-05-29 19:11:51 +00:00
|
|
|
#
|
|
|
|
# spec file for package perl-MooX-ConfigFromFile
|
|
|
|
#
|
2024-08-12 19:54:21 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-05-29 19:11:51 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2024-08-12 19:54:21 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-05-29 19:11:51 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-08-12 19:54:21 +00:00
|
|
|
%define cpan_name MooX-ConfigFromFile
|
2017-05-29 19:11:51 +00:00
|
|
|
Name: perl-MooX-ConfigFromFile
|
2024-08-12 19:54:21 +00:00
|
|
|
Version: 0.9.0
|
2017-05-29 19:11:51 +00:00
|
|
|
Release: 0
|
2024-08-12 19:54:21 +00:00
|
|
|
# 0.009 -> normalize -> 0.9.0
|
|
|
|
%define cpan_version 0.009
|
2018-05-02 11:36:45 +00:00
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2024-08-12 19:54:21 +00:00
|
|
|
Summary: Moo eXtension for initializing objects from config file
|
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/R/RE/REHSACK/%{cpan_name}-%{cpan_version}.tar.gz
|
2018-05-02 11:36:45 +00:00
|
|
|
Source1: cpanspec.yml
|
2025-08-12 18:15:51 +02:00
|
|
|
Source100: README.md
|
2017-05-29 19:11:51 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(Config::Any)
|
|
|
|
BuildRequires: perl(File::Find::Rule) >= 0.30
|
|
|
|
BuildRequires: perl(Hash::Merge)
|
|
|
|
BuildRequires: perl(JSON)
|
|
|
|
BuildRequires: perl(Moo) >= 1.003
|
2024-08-12 19:54:21 +00:00
|
|
|
BuildRequires: perl(MooX::File::ConfigDir) >= 0.2.0
|
2017-05-29 19:11:51 +00:00
|
|
|
BuildRequires: perl(Test::More) >= 0.9
|
|
|
|
Requires: perl(Config::Any)
|
|
|
|
Requires: perl(File::Find::Rule) >= 0.30
|
|
|
|
Requires: perl(Moo) >= 1.003
|
2024-08-12 19:54:21 +00:00
|
|
|
Requires: perl(MooX::File::ConfigDir) >= 0.2.0
|
|
|
|
Provides: perl(MooX::ConfigFromFile) = %{version}
|
|
|
|
Provides: perl(MooX::ConfigFromFile::Role) = %{version}
|
|
|
|
Provides: perl(MooX::ConfigFromFile::Role::HashMergeLoaded) = %{version}
|
|
|
|
Provides: perl(MooX::ConfigFromFile::Role::SortedByFilename) = %{version}
|
|
|
|
%undefine __perllib_provides
|
2017-05-29 19:11:51 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
|
|
|
This module is intended to easy load initialization values for attributes
|
|
|
|
on object construction from an appropriate config file. The building is
|
|
|
|
done in MooX::ConfigFromFile::Role - using MooX::ConfigFromFile ensures the
|
|
|
|
role is applied.
|
|
|
|
|
|
|
|
For easier usage, with 0.004, several options can be passed via _use_
|
|
|
|
resulting in default initializers for appropriate role attributes:
|
|
|
|
|
|
|
|
* 'config_prefix'
|
|
|
|
|
|
|
|
Default for MooX::ConfigFromFile::Role/config_prefix.
|
|
|
|
|
|
|
|
* 'config_prefixes'
|
|
|
|
|
|
|
|
Default for MooX::ConfigFromFile::Role/config_prefixes. Ensure when use
|
|
|
|
this flag together with MooX::Cmd to load 'MooX::ConfigFromFile' before
|
|
|
|
'MooX::Cmd'.
|
|
|
|
|
|
|
|
* 'config_prefix_map_separator'
|
|
|
|
|
|
|
|
Default for MooX::ConfigFromFile::Role/config_prefix_map_separator.
|
|
|
|
|
|
|
|
package Foo;
|
|
|
|
|
|
|
|
# apply role MooX::ConfigFromFile::Role and override default for
|
|
|
|
# attribute config_prefix_map_separator
|
|
|
|
use MooX::ConfigFromFile config_prefix_map_separator => "~";
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
* 'config_extensions'
|
|
|
|
|
|
|
|
Default for MooX::ConfigFromFile::Role/config_extensions.
|
|
|
|
|
|
|
|
* 'config_dirs'
|
|
|
|
|
|
|
|
Default for MooX::ConfigFromFile::Role/config_dirs. Same warning regarding
|
|
|
|
modifying this attribute applies here: Possible, but use with caution!
|
|
|
|
|
|
|
|
package Foo;
|
|
|
|
|
|
|
|
use MooX::ConfigFromFile config_dirs => [qw(/opt/foo/etc /home/alfred/area/foo/etc)];
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
* 'config_files'
|
|
|
|
|
|
|
|
Default for MooX::ConfigFromFile::Role/config_files.
|
|
|
|
|
|
|
|
Reasonable when you want exactly one config file in development mode. For
|
|
|
|
production code it is highly recommended to override the builder.
|
|
|
|
|
|
|
|
* 'config_singleton'
|
|
|
|
|
|
|
|
Flag adding a wrapper around the _builder_ of
|
|
|
|
MooX::ConfigFromFile::Role/loaded_config to ensure a config is loaded only
|
|
|
|
once per class. The _per class_ restriction results from applicable
|
|
|
|
modifiers per class (and singletons are per class).
|
|
|
|
|
|
|
|
* 'config_identifier'
|
|
|
|
|
|
|
|
Default for MooX::File::ConfigDir/config_identifier.
|
|
|
|
|
|
|
|
package Foo;
|
|
|
|
|
|
|
|
# apply role MooX::ConfigFromFile::Role and override default for
|
|
|
|
# attribute config_identifier - means to look e.g. in /etc/foo/
|
|
|
|
use MooX::ConfigFromFile config_identifier => "foo";
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
* 'config_hashmergeloaded'
|
|
|
|
|
|
|
|
Consumes role MooX::ConfigFromFile::Role::HashMergeLoaded directly after
|
|
|
|
MooX::ConfigFromFile::Role has been consumed.
|
|
|
|
|
|
|
|
%prep
|
2024-08-12 19:54:21 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
2017-05-29 19:11:51 +00:00
|
|
|
|
|
|
|
%build
|
2024-08-12 19:54:21 +00:00
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%make_build
|
2017-05-29 19:11:51 +00:00
|
|
|
|
|
|
|
%check
|
2024-08-12 19:54:21 +00:00
|
|
|
make test
|
2017-05-29 19:11:51 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
2024-08-12 19:54:21 +00:00
|
|
|
%doc Changes README.md
|
|
|
|
%license ARTISTIC-1.0 GPL-1 LICENSE
|
2017-05-29 19:11:51 +00:00
|
|
|
|
|
|
|
%changelog
|