81 lines
2.9 KiB
RPMSpec
81 lines
2.9 KiB
RPMSpec
|
|
#
|
||
|
|
# spec file for package perl-Convert-Bencode (Version 1.03)
|
||
|
|
#
|
||
|
|
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||
|
|
#
|
||
|
|
# 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 http://bugs.opensuse.org/
|
||
|
|
#
|
||
|
|
|
||
|
|
Name: perl-Convert-Bencode
|
||
|
|
Version: 1.03
|
||
|
|
Release: 1
|
||
|
|
License: Distributable, see LICENSE
|
||
|
|
%define cpan_name Convert-Bencode
|
||
|
|
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
|
||
|
|
BuildRequires: perl
|
||
|
|
BuildRequires: perl-macros
|
||
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||
|
|
BuildArch: noarch
|
||
|
|
%{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}
|
||
|
|
|
||
|
|
%build
|
||
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
||
|
|
%{__make} %{?_smp_mflags}
|
||
|
|
|
||
|
|
%check
|
||
|
|
%{__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
|
||
|
|
|
||
|
|
%changelog
|