From 1ab8e2551103563e742987f9c4a7602378f1048d Mon Sep 17 00:00:00 2001 From: Paul Howarth <p...@city-fan.org> Date: Tue, 3 May 2016 14:16:39 +0100 Subject: Fix "Redundant argument in sprintf" warning (CPAN RT#109673)
Also: - Classify buildreqs by usage - Simplify find command using -delete - Use %license where possible --- File-MMagic-1.30-rt109673.patch | 20 ++++++++++++++++++++ perl-File-MMagic.spec | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 File-MMagic-1.30-rt109673.patch diff --git a/File-MMagic-1.30-rt109673.patch b/File-MMagic-1.30-rt109673.patch new file mode 100644 index 0000000..24edb78 --- /dev/null +++ b/File-MMagic-1.30-rt109673.patch @@ -0,0 +1,20 @@ +--- MMagic.pm ++++ MMagic.pm +@@ -929,7 +929,7 @@ sub magicMatch { + } + else { + # $$p_desc .= ' ' . sprintf($message,$data) if $message; +- $$p_desc .= sprintf($message,$data) if $message; ++ $$p_desc .= index($message, '%') >= 0 ? sprintf($message, $data) : $message if $message; + } + + my $subtest; +@@ -1094,7 +1094,7 @@ sub magicMatchStr { + } + else { + # $$p_desc .= ' ' . sprintf($message,$data) if $message; +- $$p_desc .= sprintf($message,$data) if $message; ++ $$p_desc .= index($message, '%') >= 0 ? sprintf($message, $data) : $message if $message; + } + + my $subtest; diff --git a/perl-File-MMagic.spec b/perl-File-MMagic.spec index 52d0618..bdc2142 100644 --- a/perl-File-MMagic.spec +++ b/perl-File-MMagic.spec @@ -1,22 +1,30 @@ Name: perl-File-MMagic Version: 1.30 -Release: 8%{?dist} +Release: 9%{?dist} Summary: A Perl module emulating the file(1) command Group: Development/Libraries License: ASL 1.0 and BSD URL: http://search.cpan.org/dist/File-MMagic/ Source0: http://www.cpan.org/authors/id/K/KN/KNOK/File-MMagic-%{version}.tar.gz +Patch0: File-MMagic-1.30-rt109673.patch BuildArch: noarch +# Module Build +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: glibc-common +BuildRequires: make BuildRequires: perl -BuildRequires: perl(base) BuildRequires: perl(ExtUtils::MakeMaker) +# Module Runtime BuildRequires: perl(FileHandle) -BuildRequires: perl(Scalar::Util) BuildRequires: perl(strict) +BuildRequires: perl(vars) +# Test Suite +BuildRequires: perl(base) BuildRequires: perl(Test) BuildRequires: perl(Test::More) -BuildRequires: perl(vars) BuildRequires: perl(warnings) +# Runtime Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version)) %description @@ -25,6 +33,11 @@ command. %prep %setup -q -n File-MMagic-%{version} + +# Fix "Redundant argument in sprintf" warning (CPAN RT#109673) +%patch0 + +# Re-code README.ja as UTF-8 iconv -f ISO-2022-JP -t utf8 README.ja > README.ja.utf8 && mv README.ja.utf8 README.ja %build @@ -33,18 +46,29 @@ make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} -find %{buildroot} -type f -name .packlist -exec rm -f {} + +find %{buildroot} -type f -name .packlist -delete %{_fixperms} %{buildroot} %check make test %files -%doc ChangeLog COPYING README.en README.ja +%if 0%{?_licensedir:1} +%license COPYING +%else +%doc COPYING +%endif +%doc ChangeLog README.en README.ja %{perl_vendorlib}/File/ -%{_mandir}/man3/File::MMagic.3pm* +%{_mandir}/man3/File::MMagic.3* %changelog +* Tue May 3 2016 Paul Howarth <p...@city-fan.org> - 1.30-9 +- Fix "Redundant argument in sprintf" warning (CPAN RT#109673) +- Classify buildreqs by usage +- Simplify find command using -delete +- Use %%license where possible + * Thu Feb 04 2016 Fedora Release Engineering <rel...@fedoraproject.org> - 1.30-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild -- cgit v0.12 http://pkgs.fedoraproject.org/cgit/perl-File-MMagic.git/commit/?h=f24&id=1ab8e2551103563e742987f9c4a7602378f1048d -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org