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

80 lines
2.5 KiB
RPMSpec

#
# spec file for package perl-Data-Rand-Obscure
#
# 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-Rand-Obscure
Name: perl-Data-Rand-Obscure
Version: 0.21.0
Release: 0
# 0.021 -> normalize -> 0.21.0
%define cpan_version 0.021
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Generate (fairly) random strings easily
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/R/RK/RKRIMEN/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Carp::Clan)
BuildRequires: perl(Module::Build)
BuildRequires: perl(Object::Tiny)
Requires: perl(Carp::Clan)
Requires: perl(Object::Tiny)
Provides: perl(Data::Rand::Obscure) = %{version}
Provides: perl(Data::Rand::Obscure::Generator)
%undefine __perllib_provides
%{perl_requires}
%description
Data::Rand::Obscure provides a method for generating random hexadecimal,
binary, and base64 strings of varying length. To do this, it first
generates a pseudo-random "seed" and hashes it using a SHA-1, SHA-256, or
MD5 digesting algorithm.
Currently, the seed generator is:
join("", <an increasing counter>, time, rand, $$, {})
You can use the output to make obscure "one-shot" identifiers for cookie
data, "secret" values, etc.
Values are not GUARANTEED to be unique (see Data::UUID for that), but
should be sufficient for most purposes.
This package was inspired by (and contains code taken from) the
Catalyst::Plugin::Session package by Yuval Kogman
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
PERL_USE_UNSAFE_INC=1 perl Build.PL --installdirs=vendor
./Build build --flags=%{?_smp_mflags}
%check
./Build test
%install
./Build install --destdir=%{buildroot} --create_packlist=0
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README
%changelog