diff --git a/cpanspec.yml b/cpanspec.yml index d284df5..cc44a2b 100644 --- a/cpanspec.yml +++ b/cpanspec.yml @@ -8,7 +8,8 @@ description: |- #no_testing: broken upstream sources: - libintl-perl-rpmlintrc -#patches: +patches: + disable-broken-04find_domain_bug-test.patch: -p1 # foo.patch: -p1 # bar.patch: preamble: |- diff --git a/disable-broken-04find_domain_bug-test.patch b/disable-broken-04find_domain_bug-test.patch new file mode 100644 index 0000000..e0e23ab --- /dev/null +++ b/disable-broken-04find_domain_bug-test.patch @@ -0,0 +1,86 @@ +Disable the test as it uses libc gettext which is +highly dependant on local configuration and thus unstable. + +https://github.com/gflohr/libintl-perl/issues/3 + +diff --git a/tests/04find_domain_bug.t b/tests/04find_domain_bug.t +deleted file mode 100644 +index b027d98..0000000 +--- a/tests/04find_domain_bug.t ++++ /dev/null +@@ -1,75 +0,0 @@ +-#! /usr/local/bin/perl -w +- +-# vim: syntax=perl +-# vim: tabstop=4 +- +-use strict; +- +-use Test; +- +-use constant NUM_TESTS => 2; +- +-use Locale::Messages; +-use POSIX; +- +-BEGIN { +- plan tests => NUM_TESTS; +-} +- +-# Jan Kratochvil described the following bug: When using any functions +-# from Locale::TextDomain with a locale setting for a language that +-# has no message catalog installed, __find_domain() from Locale::TextDomain +-# will never look into the directories "LocaleData" again. It +-# tries to bindtextdomain() to all search directories, and when it +-# fails to find a translation for the emtpy string (should always be +-# present), it will assume that this directory is not the one holding +-# the mo files. +-# +-# This can actually only happen, when you switch languages behind the +-# user's back. Fixed by checking for the presence of _any_ (g)mo file +-# in the relevant directories. +-BEGIN { +- # Force language that is not supported. +- Locale::Messages::nl_putenv ("LANGUAGE=en_US"); +- Locale::Messages::nl_putenv ("LC_ALL=en_US"); +- Locale::Messages::nl_putenv ("LANG=en_US"); +- Locale::Messages::nl_putenv ("LC_MESSAGES=en_US"); +- Locale::Messages::nl_putenv ("OUTPUT_CHARSET=iso-8859-1"); +- +- Locale::Messages::setlocale (POSIX::LC_ALL() => ''); +-} +- +-# Make sure that LocaleData/ can befound. +-BEGIN { +- unshift @INC, $1 if $0 =~ m#(.*)[\\\/]#; +-} +-use Locale::TextDomain ('existing'); +- +-ok "February" eq __"February"; +- +-Locale::Messages::nl_putenv ("LANGUAGE=de_AT"); +-Locale::Messages::nl_putenv ("LC_ALL=de_AT"); +-Locale::Messages::nl_putenv ("LANG=de_AT"); +-Locale::Messages::nl_putenv ("LC_MESSAGES=de_AT"); +- +-my $missing_locale = Locale::Messages::setlocale (POSIX::LC_ALL() => '') ? +- '' : 'locale de_AT missing'; +- +-my $locale = Locale::Messages::setlocale (POSIX::LC_ALL() => ''); +-my $translation = Locale::TextDomain::__("February"); +-skip $missing_locale, "Feber" eq $translation; +- +-__END__ +- +-Local Variables: +-mode: perl +-perl-indent-level: 4 +-perl-continued-statement-offset: 4 +-perl-continued-brace-offset: 0 +-perl-brace-offset: -4 +-perl-brace-imaginary-offset: 0 +-perl-label-offset: -4 +-cperl-indent-level: 4 +-cperl-continued-statement-offset: 2 +-tab-width: 4 +-End: diff --git a/perl-libintl-perl.changes b/perl-libintl-perl.changes index 0ca5928..5e5576e 100644 --- a/perl-libintl-perl.changes +++ b/perl-libintl-perl.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Nov 1 14:54:38 UTC 2018 - Vítězslav Čížek + +- Disable 04find_domain_bug test broken with glibc 2.28 + * https://github.com/gflohr/libintl-perl/issues/3 + * add disable-broken-04find_domain_bug-test.patch + ------------------------------------------------------------------- Fri Nov 10 07:07:07 UTC 2017 - coolo@suse.com diff --git a/perl-libintl-perl.spec b/perl-libintl-perl.spec index 9e2898a..68388b9 100644 --- a/perl-libintl-perl.spec +++ b/perl-libintl-perl.spec @@ -1,7 +1,7 @@ # # spec file for package perl-libintl-perl # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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 @@ -12,7 +12,7 @@ # 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/ # @@ -21,12 +21,14 @@ Version: 1.29 Release: 0 %define cpan_name libintl-perl Summary: High-Level Interface to Uniforum Message Translation -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Development/Libraries/Perl Url: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/G/GU/GUIDO/%{cpan_name}-%{version}.tar.gz Source1: libintl-perl-rpmlintrc Source2: cpanspec.yml +# PATCH-FIX-SUSE https://github.com/gflohr/libintl-perl/issues/3 +Patch0: disable-broken-04find_domain_bug-test.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros @@ -45,6 +47,7 @@ for example in GNU gettext. %prep %setup -q -n %{cpan_name}-%{version} +%patch0 -p1 find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644 %build