2024-07-19 22:34:48 +00:00
committed by Git OBS Bridge
parent 457e1cfb18
commit 50a45a19bc

View File

@@ -1,7 +1,7 @@
#
# spec file for package perl-Convert-Bencode (Version 1.03)
# spec file for package perl-Convert-Bencode
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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
@@ -12,69 +12,48 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: perl-Convert-Bencode
Version: 1.03
Release: 1
License: Distributable, see LICENSE
%define cpan_name Convert-Bencode
Name: perl-Convert-Bencode
Version: 1.30.0
Release: 0
# 1.03 -> normalize -> 1.30.0
%define cpan_version 1.03
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Functions for converting to/from bencoded strings
Url: http://search.cpan.org/dist/Convert-Bencode/
Group: Development/Libraries/Perl
#Source: http://www.cpan.org/authors/id/O/OR/ORCLEV/Convert-Bencode-%{version}.tar.gz
Source: %{cpan_name}-%{version}.tar.gz
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/O/OR/ORCLEV/%{cpan_name}-%{cpan_version}.tar.gz
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Provides: perl(Convert::Bencode) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module provides two functions, 'bencode' and 'bdecode', which encode
and decode bencoded strings respectivly.
Encoding
'bencode()' expects to be passed a single value, which is either a
scalar, a arrary ref, or a hash ref, and it returns a scalar containing
the bencoded representation of the data structure it was passed. If the
value passed was a scalar, it returns either a bencoded string, or a
bencoded integer (floating points are not implemented, and would be
returned as a string rather than a integer). If the value was a array
ref, it returns a bencoded list, with all the values of that array also
bencoded recursivly. If the value was a hash ref, it returns a bencoded
dictionary (which for all intents and purposes can be thought of as a
synonym for hash) containing the recursivly bencoded key and value
pairs of the hash.
Decoding
'bdecode()' expects to be passed a single scalar containing the
bencoded string to be decoded. Its return value will be either a hash
ref, a array ref, or a scalar, depending on whether the outer most
element of the bencoded string was a dictionary, list, or a
string/integer respectivly.
%prep
%setup -q -n %{cpan_name}-%{version}
%autosetup -n %{cpan_name}-%{cpan_version}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
%{__make} test
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%clean
%{__rm} -rf %{buildroot}
%files -f %{name}.files
%defattr(644,root,root,755)
%doc Changes LICENSE README Todo
%doc Changes README Todo
%license LICENSE
%changelog