2011-04-14 08:03:05 +00:00
#
2011-08-26 23:41:01 +00:00
# spec file for package perl-Crypt-Password
2011-04-14 08:03:05 +00:00
#
2024-07-19 23:33:45 +00:00
# Copyright (c) 2024 SUSE LLC
2011-04-14 08:03:05 +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.
2019-03-01 22:04:52 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2011-04-14 08:03:05 +00:00
#
2019-03-01 22:04:52 +00:00
2024-07-19 23:33:45 +00:00
%define cpan_name Crypt-Password
2011-04-14 08:03:05 +00:00
Name : perl-Crypt-Password
2024-07-19 23:33:45 +00:00
Version : 0.280.0
2019-03-01 22:04:52 +00:00
Release : 0
2024-07-19 23:33:45 +00:00
# 0.28 -> normalize -> 0.280.0
%define cpan_version 0.28
#Upstream: Code by Steve Eirium, the nostrasteve@gmail.com manpage, idea by Sam Vilain, the sam.vilain@catalyst.net.nz manpage. Development commissioned by NZ Registry Services. Artistic License v2.0, which permits relicensing under other Free Software licenses.
2019-03-01 22:04:52 +00:00
License : Artistic-2.0
2024-07-19 23:33:45 +00:00
Summary : Unix-style, Variously Hashed Passwords
URL : https://metacpan.org/release/%{cpan_name}
Source0 : https://cpan.metacpan.org/authors/id/D/DR/DRSTEVE/%{cpan_name} -%{cpan_version} .tgz
2019-03-01 22:04:52 +00:00
Source1 : cpanspec.yml
2025-08-12 18:12:51 +02:00
Source100 : README.md
2011-04-14 08:03:05 +00:00
BuildArch : noarch
2019-03-01 22:04:52 +00:00
BuildRequires : perl
2011-04-14 08:03:05 +00:00
BuildRequires : perl-macros
2024-07-19 23:33:45 +00:00
Provides : perl(Crypt::Password) = %{version}
%undefine __perllib_provides
2011-04-14 08:03:05 +00:00
%{perl_requires}
2019-03-01 22:04:52 +00:00
# MANUAL BEGIN
2019-03-01 22:07:43 +00:00
BuildRequires : man
2019-03-01 22:04:52 +00:00
BuildRequires : perl(Module::Install)
# MANUAL END
2011-04-14 08:03:05 +00:00
%description
This is just a wrapper for perl's ' crypt()', which can do everything you
would probably want to do to store a password, but this is to make usage
2019-03-01 22:04:52 +00:00
easier. The object stringifies to the return string of the crypt()
function, which is (on *Linux/glibc* et al) in Modular Crypt Format:
2011-04-14 08:03:05 +00:00
# scalar($hashed):
# v digest v hash ->
# $5$%RK2BU%L$aFZd1/4Gpko/sJZ8Oh.ZHg9UvxCjkH1YYoLZI6tw7K8
# ^ salt ^
2019-03-01 22:04:52 +00:00
That you can store, etc, retrieve then use it in 'check_password()' to
validate a login, etc.
Not without some danger, so read on, you could also string compare it to
the output of another 'password()' , as long as the salt is the same. If you
pass a crypted string as the salt it will use the same salt.
2011-04-14 08:03:05 +00:00
If the given string is already hashed it is assumed to be okay to use it as
2019-03-01 22:04:52 +00:00
is. So if you are checking something from the outside world pass it as the
second argument to 'check_password($saved, $wild)' . You could also use
'crypt_password($wild)' , which will definitely crypt its input.
This means simpler code and users can supply pre-hashed passwords
initially, but if you do it wrong a stolen hash could be used as a
password, so buck up your ideas.
If you aren't running *Linux/glibc*, everything after the WARNING in the
synopsis is dubious as. If you've got insight into how this module can work
better on your platform I would love to hear from you.
2011-04-14 08:03:05 +00:00
%prep
2024-07-19 23:33:45 +00:00
%autosetup -n %{cpan_name} -%{cpan_version}
2011-04-14 08:03:05 +00:00
%build
2024-07-19 23:33:45 +00:00
PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor
%make_build
2011-04-14 08:03:05 +00:00
%check
2019-03-01 22:04:52 +00:00
make test
2011-04-14 08:03:05 +00:00
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
2019-03-01 22:04:52 +00:00
%doc CHANGES README SubmittingPatches
%license COPYING.txt
2011-04-14 08:03:05 +00:00
%changelog