[packages/perl-Device-USB] - apply build fixes from Debian - dump_usb.pl to doc

baggins baggins at pld-linux.org
Thu Nov 3 21:32:50 CET 2016


commit ac078533f62a427d64e8731aa6bf01fb12a83579
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Nov 3 21:32:25 2016 +0100

    - apply build fixes from Debian
    - dump_usb.pl to doc

 fix-buildsystem.patch             | 20 ++++++++++++++++++
 hardening-flags.patch             | 44 +++++++++++++++++++++++++++++++++++++++
 just-assume-libusb-is-there.patch | 30 ++++++++++++++++++++++++++
 perl-Device-USB.spec              |  9 ++++++--
 4 files changed, 101 insertions(+), 2 deletions(-)
---
diff --git a/perl-Device-USB.spec b/perl-Device-USB.spec
index 8b9c138..768217c 100644
--- a/perl-Device-USB.spec
+++ b/perl-Device-USB.spec
@@ -14,6 +14,9 @@ License:	GPL v1+ or Artistic
 Group:		Development/Languages/Perl
 Source0:	http://search.cpan.org/CPAN/authors/id/G/GW/GWADEJ/Device-USB-%{version}.tar.gz
 # Source0-md5:	aa91bee777f7ed7a18225a84f8795344
+Patch0:		fix-buildsystem.patch
+Patch1:		hardening-flags.patch
+Patch2:		just-assume-libusb-is-there.patch
 URL:		http://search.cpan.org/dist/Device-USB/
 %if "%{pld_release}" == "ac"
 BuildRequires:	libusb-devel < 1.0
@@ -37,6 +40,9 @@ more Perl-ish interface.
 
 %prep
 %setup -q -n %{pdir}-%{pnam}-%{version}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 # function names conflict with libusb-1.0
 sed -e 's/libusb_/DeviceUSB_/g' -i lib/Device/USB.pm lib/Device/USB/Device.pm
@@ -62,10 +68,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc Changes README
+%doc Changes README dump_usb.pl
 %{perl_vendorarch}/Device/*.pm
 %{perl_vendorarch}/Device/USB
-%attr(755,root,root) %{perl_vendorarch}/Device/dump_usb.pl
 %dir %{perl_vendorarch}/auto/Device/USB
 %attr(755,root,root) %{perl_vendorarch}/auto/Device/USB/*.so
 %{_mandir}/man3/*
diff --git a/fix-buildsystem.patch b/fix-buildsystem.patch
new file mode 100644
index 0000000..5201894
--- /dev/null
+++ b/fix-buildsystem.patch
@@ -0,0 +1,20 @@
+Description: Ignore files we do not want installed.
+Forwarded: not-needed
+Author: Tim Retout <diocles at debian.org>
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-10-28
+
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -2,6 +2,11 @@
+ use warnings;
+ use Inline::MakeMaker;
+ 
++sub MY::libscan {
++	return if ($_[1] eq 'USB.pm' or $_[1] eq 'dump_usb.pl');
++	return $_[1];
++}
++
+ if($^O eq 'MSWin32')
+ {
+     if(!$ENV{LIBUSB_LIBDIR} or !$ENV{LIBUSB_INCDIR})
diff --git a/hardening-flags.patch b/hardening-flags.patch
new file mode 100644
index 0000000..2148a72
--- /dev/null
+++ b/hardening-flags.patch
@@ -0,0 +1,44 @@
+Description: pass *FLAGS to compiler and linker for hardening
+Origin: vendor
+Forwarded: no
+Author: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-10-28
+
+--- a/lib/Device/USB.pm
++++ b/lib/Device/USB.pm
+@@ -4,6 +4,7 @@
+ use warnings;
+ use strict;
+ use Carp;
++use Config;
+ 
+ use Inline (
+         C => "DATA",
+@@ -15,6 +16,8 @@
+         ($ENV{LIBUSB_INCDIR} ? ( INC => "-I\"$ENV{LIBUSB_INCDIR}\"" ) : () ),
+         NAME => 'Device::USB',
+         VERSION => '0.36',
++        CCFLAGS => "$Config{ccflags} $ENV{CFLAGS} $ENV{CPPFLAGS}",
++        LDDLFLAGS => "$Config{lddlflags} $ENV{LDFLAGS}",
+    );
+ 
+ Inline->init();
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,6 +1,7 @@
+ use strict;
+ use warnings;
+ use Inline::MakeMaker;
++use Config;
+ 
+ sub MY::libscan {
+ 	return if ($_[1] eq 'USB.pm' or $_[1] eq 'dump_usb.pl');
+@@ -71,6 +72,8 @@
+         "ExtUtils::MakeMaker" => 0,
+         'Inline::MakeMaker' => 0,
+     },
++    CCFLAGS => "$Config{ccflags} $ENV{CFLAGS} $ENV{CPPFLAGS}",
++    LDFLAGS => "$Config{lddlflags} $ENV{LDFLAGS}",
+ );
+ 
+ 
diff --git a/just-assume-libusb-is-there.patch b/just-assume-libusb-is-there.patch
new file mode 100644
index 0000000..9365eb4
--- /dev/null
+++ b/just-assume-libusb-is-there.patch
@@ -0,0 +1,30 @@
+Subject: Just assume libusb is out there
+ Makefile.PL should not try to check for libusb in a given list of directories
+ as the compiler might look in other places as well.
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/639677
+Forwarded: not-needed
+From: Ansgar Burchardt <ansgar at debian.org>
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-10-28
+
+--- libdevice-usb-perl.orig/Makefile.PL
++++ libdevice-usb-perl/Makefile.PL
+@@ -21,7 +21,7 @@
+     }
+ }
+ 
+-unless(header_found())
++unless(1 || header_found())
+ {
+     die <<"END";
+ ERROR: Can't find usb.h header.
+@@ -36,7 +36,7 @@
+ END
+ }
+ 
+-unless(lib_found())
++unless(1 || lib_found())
+ {
+     die <<"END";
+ ERROR: Can't find libusb library.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/perl-Device-USB.git/commitdiff/ac078533f62a427d64e8731aa6bf01fb12a83579



More information about the pld-cvs-commit mailing list