[perl-File-LibMagic] Fix FTBFS with file 5.10 (#813178)
Paul Howarth
pghmcfc at fedoraproject.org
Mon Apr 23 20:55:45 UTC 2012
commit 36d0a8bbb9835df1de5abf8928003c2559cd7e43
Author: Paul Howarth <paul at city-fan.org>
Date: Mon Apr 23 21:49:00 2012 +0100
Fix FTBFS with file 5.10 (#813178)
- Update test suite to work with file 5.10 (CPAN RT#75457)
- Don't need to link against libz (CPAN RT#56479)
do-not-link-libz.patch | 15 ++++++++
file-5.10.patch | 83 +++++++++++++++++++++++++++++++++++++++++++++++
perl-File-LibMagic.spec | 18 +++++++++-
3 files changed, 114 insertions(+), 2 deletions(-)
---
diff --git a/do-not-link-libz.patch b/do-not-link-libz.patch
new file mode 100644
index 0000000..a264b56
--- /dev/null
+++ b/do-not-link-libz.patch
@@ -0,0 +1,15 @@
+From: Ansgar Burchardt
+Date: Sun, 11 Apr 2010 17:53:55 +0900
+Bug-Debian: http://bugs.debian.org/577288
+Subject: Do not link libz
+--- libfile-libmagic-perl.orig/Makefile.PL
++++ libfile-libmagic-perl/Makefile.PL
+@@ -15,7 +15,7 @@
+ 'PREREQ_PM' => { },
+ 'ABSTRACT_FROM' => 'LibMagic.pm', # retrieve abstract from module
+ 'AUTHOR' => 'Andreas Fitzner <andreas.fitzner at fv-berlin.de>',
+- 'LIBS' => ['-lmagic -lz'], # e.g., '-lm'
++ 'LIBS' => ['-lmagic'], # e.g., '-lm'
+ 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
+ 'INC' => '-I.', # e.g., '-I. -I/usr/include/other'
+ # Un-comment this if you add C files to link with later:
diff --git a/file-5.10.patch b/file-5.10.patch
new file mode 100644
index 0000000..468f21e
--- /dev/null
+++ b/file-5.10.patch
@@ -0,0 +1,83 @@
+Description: adjust for magic 5.10
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/661800
+Author: gregor herrmann <gregoa at debian.org>
+Last-Update: 2012-03-01
+
+--- a/t/2-easy.t
++++ b/t/2-easy.t
+@@ -7,7 +7,7 @@
+ is( MagicBuffer("Hello World\n"), 'ASCII text' );
+
+ is( MagicFile('t/samples/foo.txt'), 'ASCII text' );
+-is( MagicFile('t/samples/foo.c' ), 'ASCII C program text' );
++is( MagicFile('t/samples/foo.c' ), 'C source, ASCII text' );
+
+ # check the error handling
+ eval { MagicBuffer(undef) };
+--- a/t/3-complete.t
++++ b/t/3-complete.t
+@@ -32,7 +32,7 @@
+ is( magic_buffer( $handle, "Footastic\n" ), 'A foo file' );
+
+ is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
+- is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
++ is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII text' );
+ is( magic_file( $handle, 't/samples/foo.foo' ), 'A foo file' );
+
+ magic_close($handle);
+@@ -45,7 +45,7 @@
+ is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
+
+ is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
+- is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
++ is( magic_file( $handle, 't/samples/foo.c' ), 'C source, ASCII text' );
+ is( magic_file( $handle, 't/samples/foo.foo' ), 'ASCII text' );
+
+ magic_close($handle);
+@@ -58,7 +58,7 @@
+ is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
+
+ is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
+- is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
++ is( magic_file( $handle, 't/samples/foo.c' ), 'C source, ASCII text' );
+ is( magic_file( $handle, 't/samples/foo.foo' ), 'ASCII text' );
+
+ magic_close($handle);
+--- a/t/4-all.t
++++ b/t/4-all.t
+@@ -8,7 +8,7 @@
+ is( MagicBuffer("Hello World\n"), 'ASCII text' );
+
+ is( MagicFile('t/samples/foo.txt'), 'ASCII text' );
+-is( MagicFile('t/samples/foo.c' ), 'ASCII C program text' );
++is( MagicFile('t/samples/foo.c' ), 'C source, ASCII text' );
+
+ # subs from :complete
+ my $handle = magic_open(MAGIC_NONE);
+@@ -16,7 +16,7 @@
+ is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
+
+ is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
+-is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
++is( magic_file( $handle, 't/samples/foo.c' ), 'C source, ASCII text' );
+
+ magic_close($handle);
+
+--- a/t/6-oo.t
++++ b/t/6-oo.t
+@@ -6,12 +6,12 @@
+
+ my %standard = (
+ 'foo.foo' => [ 'ASCII text', 'text/plain; charset=us-ascii' ],
+- 'foo.c' => [ 'ASCII C program text', 'text/x-c; charset=us-ascii' ],
++ 'foo.c' => [ 'C source, ASCII text', 'text/x-c; charset=us-ascii' ],
+ );
+
+ my %custom = (
+ 'foo.foo' => [ 'A foo file', 'text/plain; charset=us-ascii' ],
+- 'foo.c' => [ 'ASCII C program text', 'text/x-c; charset=us-ascii' ],
++ 'foo.c' => [ 'ASCII text', 'text/plain; charset=us-ascii' ],
+ );
+
+ plan tests => 4 + 4*(keys %standard) + 4*(keys %custom);
diff --git a/perl-File-LibMagic.spec b/perl-File-LibMagic.spec
index 1507836..ebcc1b2 100644
--- a/perl-File-LibMagic.spec
+++ b/perl-File-LibMagic.spec
@@ -5,14 +5,16 @@
Name: perl-%{module}
Version: 0.96
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Perl wrapper/interface for libmagic
License: GPL+ or Artistic
Group: Development/Libraries
Source: http://search.cpan.org/CPAN/authors/id/F/FI/FITZNER/%{module}-%{version}.tgz
URL: http://search.cpan.org/dist/%{module}/
+Patch0: file-5.10.patch
+Patch1: do-not-link-libz.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: %{_includedir}/magic.h, zlib-devel, perl(ExtUtils::MakeMaker), perl(Test::More)
+BuildRequires: %{_includedir}/magic.h, perl(ExtUtils::MakeMaker), perl(Test::More)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description
@@ -22,6 +24,14 @@ file (4.x or 5.x) package.
%prep
%setup -q -n %{module}-%{version}
+# Update test suite to work with file 5.10 (CPAN RT#75457)
+# Patch from debian
+%patch0 -p1
+
+# Don't need to link against libz (CPAN RT#56479)
+# Patch from debian
+%patch1 -p1
+
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
@@ -50,6 +60,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/*
%changelog
+* Mon Apr 23 2012 Paul Howarth <paul at city-fan.org> - 0.96-6
+- Update test suite to work with file 5.10 (CPAN RT#75457)
+- Don't need to link against libz (CPAN RT#56479)
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.96-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list