Accepting request 778013 from home:tinita:branches:devel:languages:perl

- Add patch storable-canonical.patch

Tests are passing now, except for ppc.

OBS-URL: https://build.opensuse.org/request/show/778013
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Convert-Bencode_XS?expand=0&rev=2
This commit is contained in:
Lars Vogdt
2020-02-21 20:04:08 +00:00
committed by Git OBS Bridge
parent 02c6c5f1bf
commit 41dbb8527d
4 changed files with 69 additions and 27 deletions

29
cpanspec.yml Normal file
View File

@@ -0,0 +1,29 @@
---
#description_paragraphs: 3
#description: |-
# override description from CPAN
#summary: override summary from CPAN
#no_testing: broken upstream
#sources:
# - source1
# - source2
patches:
# Tests fail due to randomized hashes in perl 5.18
# https://rt.cpan.org/Public/Bug/Display.html?id=87012
storable-canonical.patch:
#preamble: |-
# BuildRequires: gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
#post_build: |-
# rm unused.files
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 21 14:43:17 UTC 2020 - Tina Müller <tina.mueller@suse.com>
- Add patch storable-canonical.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Jan 15 12:02:41 UTC 2011 - chris@computersalat.de Sat Jan 15 12:02:41 UTC 2011 - chris@computersalat.de

View File

@@ -1,7 +1,7 @@
# #
# spec file for package perl-Convert-Bencode_XS (Version 0.06) # spec file for package perl-Convert-Bencode_XS
# #
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -12,62 +12,60 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # 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_XS Name: perl-Convert-Bencode_XS
Version: 0.06 Version: 0.06
Release: 1 Release: 0
License: GPL+ or Artistic
%define cpan_name Convert-Bencode_XS %define cpan_name Convert-Bencode_XS
Summary: Faster conversions to/from Bencode format Summary: Faster conversions to/from Bencode format
Url: http://search.cpan.org/dist/Convert-Bencode_XS/ License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl Group: Development/Libraries/Perl
#Source: http://www.cpan.org/authors/id/I/IW/IWADE/Convert-Bencode_XS-%{version}.tar.gz Url: https://metacpan.org/release/%{cpan_name}
Source: %{cpan_name}-%{version}.tar.gz Source0: https://cpan.metacpan.org/authors/id/I/IW/IWADE/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
Patch0: storable-canonical.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl BuildRequires: perl
BuildRequires: perl-macros BuildRequires: perl-macros
BuildRequires: perl(Test::More)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{perl_requires} %{perl_requires}
%description %description
* bencode($stuff) * bencode($stuff)
Returns a bencoded string representing what's in $stuff. $stuff can be Returns a bencoded string representing what's in $stuff. $stuff can be
either a scalar, an array reference or a hash reference. Every nesting of either a scalar, an array reference or a hash reference. Every nesting of
these data structures is allowed, other ones will croak. these data structures is allowed, other ones will croak.
* bdecode($bencoded) * bdecode($bencoded)
Returns a Perl data structure: it could be either a scalar, array Returns a Perl data structure: it could be either a scalar, array reference
reference or hash reference depending on what's in $bencoded. or hash reference depending on what's in $bencoded. Dictionaries are
Dictionaries are converted in hashes, lists in arrays, scalars in converted in hashes, lists in arrays, scalars in strings. If $COERCE (see
strings. If $COERCE (see below) is set to a false value then scalars below) is set to a false value then scalars encoded like integers will be
encoded like integers will be cleanse() before being returned so that a cleanse() before being returned so that a re-serialization of the structure
re-serialization of the structure will give back exactly the same will give back exactly the same bencoded string.
bencoded string.
%prep %prep
%setup -q -n %{cpan_name}-%{version} %setup -q -n %{cpan_name}-%{version}
%patch0
%build %build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%{__make} %{?_smp_mflags} make %{?_smp_mflags}
%check %check
%{__make} test make test
%install %install
%perl_make_install %perl_make_install
%perl_process_packlist %perl_process_packlist
%perl_gen_filelist %perl_gen_filelist
%clean
%{__rm} -rf %{buildroot}
%files -f %{name}.files %files -f %{name}.files
%defattr(644,root,root,755) %defattr(-,root,root,755)
%doc Changes README %doc Changes README
%changelog %changelog

10
storable-canonical.patch Normal file
View File

@@ -0,0 +1,10 @@
--- t/001_tests.t.orig Sat Nov 15 14:41:13 2014
+++ t/001_tests.t Sat Nov 15 14:41:27 2014
@@ -109,6 +109,7 @@ SKIP: {
#we use Storable so we do not rely on bencode
eval q{use Storable qw(freeze)};
skip "Storable not available", 12 if $@;
+ local $Storable::canonical = 1;
local $Convert::Bencode_XS::COERCE = 0;
is( freeze(bdecode('le')), freeze([]) );
is( freeze(bdecode('l0:0:0:e')), freeze(['', '', '']) );