Files
perl-Data-Fake/perl-Data-Fake.spec
2025-08-12 18:13:02 +02:00

105 lines
3.5 KiB
RPMSpec

#
# spec file for package perl-Data-Fake
#
# 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 Data-Fake
Name: perl-Data-Fake
Version: 0.6.0
Release: 0
# 0.006 -> normalize -> 0.6.0
%define cpan_version 0.006
License: Apache-2.0
Summary: Declaratively generate fake structured data for testing
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
# PATCH-FIX-UPSTREAM https://github.com/dagolden/Data-Fake/issues/15
Patch0: issue15.patch
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Import::Into) >= 1.002005
BuildRequires: perl(Test::Deep)
BuildRequires: perl(Test::More) >= 0.96
BuildRequires: perl(Text::Lorem)
BuildRequires: perl(Time::Piece) >= 1.270
Requires: perl(Import::Into) >= 1.002005
Requires: perl(Text::Lorem)
Requires: perl(Time::Piece) >= 1.270
Provides: perl(Data::Fake) = %{version}
Provides: perl(Data::Fake::Company) = %{version}
Provides: perl(Data::Fake::Core) = %{version}
Provides: perl(Data::Fake::Dates) = %{version}
Provides: perl(Data::Fake::Internet) = %{version}
Provides: perl(Data::Fake::Names) = %{version}
Provides: perl(Data::Fake::Text) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module generates randomized, fake structured data using declarative
syntax.
'Data::Fake' is built on higher-order programming principles. It provides
users with "factory" functions, which create "generator" functions for
specific pieces of data.
Wherever randomized, fake data is desired, a generator code reference is
used as a placeholder for the desired output. Each time the top-level
generator is run, nested generators are recursively run to turn
placeholders into the desired randomized data.
For example, the SYNOPSIS declares the desired form of a "hero" using the
'fake_hash' factory function. The input is a hash-reference, with nested
generators created as placeholders by the 'fake_name', 'fake_sentences',
etc. factory functions:
my $hero_generator = fake_hash(
{
name => fake_name(),
battlecry => fake_sentences(1),
birthday => fake_past_datetime("%Y-%m-%d"),
friends => fake_array( fake_int(2,4), fake_name() ),
gender => fake_pick(qw/Male Female Other/),
}
);
Every time '$hero_generator' is run, a new hash is generated based on the
template and nested generators.
%prep
%autosetup -n %{cpan_name}-%{cpan_version} -p1
%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 CONTRIBUTING.mkdn examples README
%license LICENSE
%changelog