98 lines
3.8 KiB
RPMSpec
98 lines
3.8 KiB
RPMSpec
#
|
|
# spec file for package perl-Tree-Simple
|
|
#
|
|
# 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 Tree-Simple
|
|
Name: perl-Tree-Simple
|
|
Version: 1.340.0
|
|
Release: 0
|
|
# 1.34 -> normalize -> 1.340.0
|
|
%define cpan_version 1.34
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
|
Summary: Simple tree object
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/R/RS/RSAVAGE/%{cpan_name}-%{cpan_version}.tgz
|
|
Source1: cpanspec.yml
|
|
Source100: README.md
|
|
BuildArch: noarch
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(Test::Exception) >= 0.15
|
|
BuildRequires: perl(Test::More) >= 1.001002
|
|
Provides: perl(Tree::Simple) = %{version}
|
|
Provides: perl(Tree::Simple::Visitor) = %{version}
|
|
%undefine __perllib_provides
|
|
%{perl_requires}
|
|
|
|
%description
|
|
This module in an fully object-oriented implementation of a simple n-ary
|
|
tree. It is built upon the concept of parent-child relationships, so
|
|
therefore every *Tree::Simple* object has both a parent and a set of
|
|
children (who themselves may have children, and so on). Every
|
|
*Tree::Simple* object also has siblings, as they are just the children of
|
|
their immediate parent.
|
|
|
|
It is can be used to model hierarchal information such as a file-system,
|
|
the organizational structure of a company, an object inheritance hierarchy,
|
|
versioned files from a version control system or even an abstract syntax
|
|
tree for use in a parser. It makes no assumptions as to your intended
|
|
usage, but instead simply provides the structure and means of accessing and
|
|
traversing said structure.
|
|
|
|
This module uses exceptions and a minimal Design By Contract style. All
|
|
method arguments are required unless specified in the documentation, if a
|
|
required argument is not defined an exception will usually be thrown. Many
|
|
arguments are also required to be of a specific type, for instance the
|
|
'$parent' argument to the constructor *must* be a *Tree::Simple* object or
|
|
an object derived from *Tree::Simple*, otherwise an exception is thrown.
|
|
This may seems harsh to some, but this allows me to have the confidence
|
|
that my code works as I intend, and for you to enjoy the same level of
|
|
confidence when using this module. Note however that this module does not
|
|
use any Exception or Error module, the exceptions are just strings thrown
|
|
with 'die'.
|
|
|
|
I consider this module to be production stable, it is based on a module
|
|
which has been in use on a few production systems for approx. 2 years now
|
|
with no issue. The only difference is that the code has been cleaned up a
|
|
bit, comments added and the thorough tests written for its public release.
|
|
I am confident it behaves as I would expect it to, and is (as far as I
|
|
know) bug-free. I have not stress-tested it under extreme duress, but I do
|
|
not so much intend for it to be used in that type of situation. If this
|
|
module cannot keep up with your Tree needs, i suggest switching to one of
|
|
the modules listed in the OTHER TREE MODULES section below.
|
|
|
|
%prep
|
|
%autosetup -n %{cpan_name}-%{cpan_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
|