Accepting request 296384 from devel:languages:perl:autoupdate
automatic update OBS-URL: https://build.opensuse.org/request/show/296384 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-String-Random?expand=0&rev=2
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package perl-String-Random (Version 0.22)
|
||||
# spec file for package perl-String-Random
|
||||
#
|
||||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -15,23 +15,21 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: perl-String-Random
|
||||
Version: 0.22
|
||||
Release: 1
|
||||
License: GPL+ or Artistic
|
||||
Version: 0.28
|
||||
Release: 0
|
||||
%define cpan_name String-Random
|
||||
Summary: Perl module to generate random strings based on a pattern
|
||||
Url: http://search.cpan.org/dist/String-Random/
|
||||
License: Artistic-1.0 or GPL-1.0+
|
||||
Group: Development/Libraries/Perl
|
||||
Source: http://www.cpan.org/authors/id/S/ST/STEVE/%{cpan_name}-%{version}.tar.gz
|
||||
Url: http://search.cpan.org/dist/String-Random/
|
||||
Source: http://www.cpan.org/authors/id/S/SH/SHLOMIF/%{cpan_name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: perl
|
||||
BuildRequires: perl(Module::Build)
|
||||
BuildRequires: perl-macros
|
||||
BuildRequires: perl(Module::Build)
|
||||
BuildRequires: perl(Test::More)
|
||||
Requires: perl(Test::More)
|
||||
BuildRequires: perl(Module::Build) >= 0.36
|
||||
%{perl_requires}
|
||||
|
||||
%description
|
||||
@@ -41,19 +39,22 @@ As an example, let's say you are writing a script that needs to generate a
|
||||
random password for a user. The relevant code might look something like
|
||||
this:
|
||||
|
||||
use String::Random;
|
||||
$pass = new String::Random;
|
||||
print "Your password is ", $pass->randpattern("CCcc!ccn"), "\n";
|
||||
use String::Random;
|
||||
my $pass = String::Random->new;
|
||||
print "Your password is ", $pass->randpattern("CCcc!ccn"), "\n";
|
||||
|
||||
This would output something like this:
|
||||
|
||||
Your password is UDwp$tj5
|
||||
|
||||
*NOTE!!!*: currently, String::Random uses Perl's built-in predictable
|
||||
random number generator so the passwords generated by it are insecure.
|
||||
|
||||
If you are more comfortable dealing with regular expressions, the following
|
||||
code would have a similar result:
|
||||
|
||||
use String::Random;
|
||||
$pass = new String::Random;
|
||||
my $pass = String::Random->new;
|
||||
print "Your password is ",
|
||||
$pass->randregex('[A-Z]{2}[a-z]{2}.[a-z]{2}\d'), "\n";
|
||||
|
||||
@@ -71,11 +72,8 @@ code would have a similar result:
|
||||
./Build install destdir=%{buildroot} create_packlist=0
|
||||
%perl_gen_filelist
|
||||
|
||||
%clean
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
%files -f %{name}.files
|
||||
%defattr(-,root,root,755)
|
||||
%doc Changes README TODO
|
||||
%doc Changes LICENSE README TODO
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user