Package: libgphoto2
Version: 2.4.11-3.1
Followup-For: Bug #653198
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu precise ubuntu-patch

Hi folks,

Please find attached a tweaked version of this patch, which is being
uploaded to Ubuntu for multiarch support.

Differences from Kees's patch are:

 - print-camera-list doesn't need to be moved to the -dev package; it's
   shipped in an architecture-qualified path already, and it's a runtime
   tool so there's no reason to move it.

 - dh_makeshlibs seems to have problems with properly excluding DSOs from
   generated symbols files when these DSOs are installed to a multiarch
   path.  I've reported bug #653640 for this issue, but have also added a
   workaround to debian/rules.

Thanks for considering the patch.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
=== modified file 'debian/compat'
--- debian/compat	2010-11-22 09:37:03 +0000
+++ debian/compat	2011-12-29 09:23:19 +0000
@@ -1 +1 @@
-7
+9

=== modified file 'debian/control'
--- debian/control	2011-09-10 16:54:07 +0000
+++ debian/control	2011-12-29 23:00:13 +0000
@@ -6,7 +6,7 @@
  , David Paleino <da...@debian.org>
  , Gürkan Sengün <gur...@phys.ethz.ch>
 Build-Depends:
- debhelper (>= 7.0.50)
+ debhelper (>= 8.1.3~)
  , libtool
  , libltdl-dev
  , zlib1g-dev
@@ -55,10 +55,12 @@
 
 Package: libgphoto2-port0
 Architecture: any
+Multi-Arch: same
 Provides: libgphoto2port
 Replaces: libgphoto2port
 Conflicts: libgphoto2port
 Breaks: gphoto2 (<= 2.1.1)
+Pre-Depends: ${misc:Pre-Depends}
 Depends:
  ${shlibs:Depends}
  , ${misc:Depends}
@@ -72,7 +74,9 @@
 
 Package: libgphoto2-2
 Architecture: any
+Multi-Arch: same
 Breaks: gphoto2 (<= 2.1.1)
+Pre-Depends: ${misc:Pre-Depends}
 Depends:
  ${shlibs:Depends}
  , ${misc:Depends}
@@ -93,6 +97,7 @@
 Package: libgphoto2-l10n
 Section: localization
 Architecture: all
+Multi-Arch: foreign
 Breaks: libgphoto2-2 (<= 2.4.10.1-4)
 Replaces: libgphoto2-2 (<= 2.4.10.1-4)
 Depends: ${misc:Depends}

=== modified file 'debian/libgphoto2-2-dev.install'
--- debian/libgphoto2-2-dev.install	2011-04-18 19:11:01 +0000
+++ debian/libgphoto2-2-dev.install	2011-12-29 20:54:53 +0000
@@ -1,11 +1,16 @@
 usr/share/man/man3/libgphoto2.3
 usr/share/man/man3/libgphoto2_port.3
-usr/lib/libgphoto2_port.{so,a}
-usr/lib/libgphoto2_port/*/{serial,usb,disk,ptpip}.a
-usr/lib/libgphoto2.{so,a}
-usr/lib/pkgconfig/libgphoto2.pc
-usr/lib/pkgconfig/libgphoto2_port.pc
-usr/lib/libgphoto2/*/*.a
+usr/lib/*/libgphoto2_port.so
+usr/lib/*/libgphoto2_port.a
+usr/lib/*/libgphoto2_port/*/serial.a
+usr/lib/*/libgphoto2_port/*/usb.a
+usr/lib/*/libgphoto2_port/*/disk.a
+usr/lib/*/libgphoto2_port/*/ptpip.a
+usr/lib/*/libgphoto2.so
+usr/lib/*/libgphoto2.a
+usr/lib/*/pkgconfig/libgphoto2.pc
+usr/lib/*/pkgconfig/libgphoto2_port.pc
+usr/lib/*/libgphoto2/*/*.a
 usr/include/gphoto2/*.h
 usr/bin/gphoto2-port-config
 usr/bin/gphoto2-config

=== modified file 'debian/libgphoto2-2.install'
--- debian/libgphoto2-2.install	2011-04-30 16:38:30 +0000
+++ debian/libgphoto2-2.install	2011-12-29 20:55:08 +0000
@@ -4,6 +4,6 @@
 usr/share/doc/libgphoto2/README usr/share/doc/libgphoto2-2
 usr/share/doc/libgphoto2/camlibs/ usr/share/doc/libgphoto2-2
 usr/share/libgphoto2/*/konica/*
-usr/lib/libgphoto2/*/*.so
-usr/lib/libgphoto2.so.*
-usr/lib/libgphoto2/print-camera-list
+usr/lib/*/libgphoto2/*/*.so
+usr/lib/*/libgphoto2.so.*
+usr/lib/*/libgphoto2/print-camera-list

=== modified file 'debian/libgphoto2-port0.install'
--- debian/libgphoto2-port0.install	2011-04-18 19:11:01 +0000
+++ debian/libgphoto2-port0.install	2011-12-29 09:23:19 +0000
@@ -2,5 +2,5 @@
 usr/share/doc/libgphoto2_port/AUTHORS usr/share/doc/libgphoto2-port0
 usr/share/doc/libgphoto2_port/README  usr/share/doc/libgphoto2-port0
 usr/share/doc/libgphoto2_port/NEWS    usr/share/doc/libgphoto2-port0
-usr/lib/libgphoto2_port.so.*
-usr/lib/libgphoto2_port/*/*.so
+usr/lib/*/libgphoto2_port.so.*
+usr/lib/*/libgphoto2_port/*/*.so

=== added file 'debian/patches/71_format-security.patch'
--- debian/patches/71_format-security.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/71_format-security.patch	2011-12-29 09:23:19 +0000
@@ -0,0 +1,16 @@
+Description: avoid -Wformat-security warnings.
+Author: Kees Cook <k...@debian.org>
+
+Index: libgphoto2-2.4.11/packaging/generic/print-camera-list.c
+===================================================================
+--- libgphoto2-2.4.11.orig/packaging/generic/print-camera-list.c	2011-12-24 17:24:28.081326412 -0800
++++ libgphoto2-2.4.11/packaging/generic/print-camera-list.c	2011-12-24 17:24:39.841493885 -0800
+@@ -506,7 +506,7 @@
+ 			version_str);
+ 		print_version_comment(stdout, "# ", "\n", NULL, "#\n");
+ 		printf ("# this file is autogenerated, local changes will be LOST on upgrades\n");
+-		printf (pdata->begin_string);
++		printf ("%s", pdata->begin_string);
+ 
+ 		if (pdata->version == UDEV_136) {
+ 			if (pdata->mode != NULL || pdata->owner != NULL || pdata->group != NULL) {

=== modified file 'debian/patches/series'
--- debian/patches/series	2011-04-30 16:38:30 +0000
+++ debian/patches/series	2011-12-29 09:23:19 +0000
@@ -1,3 +1,4 @@
 #10_disable_cache
 #11_hurd_no_path_max_bsdsource
 70_increase_max_entries
+71_format-security.patch

=== modified file 'debian/rules'
--- debian/rules	2011-04-30 16:38:30 +0000
+++ debian/rules	2011-12-29 22:54:03 +0000
@@ -9,22 +9,11 @@
 ifeq ($(DEB_HOST_ARCH_OS),hurd)
   CONFIGURE_OPTIONS += --without-libusb
 endif
-
-### CFLAGS handling:
-CFLAGS = -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-    CFLAGS += -O0
-else
-    CFLAGS += -O2
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-    INSTALL_PROGRAM += -s
-endif
-
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 ### Overrides:
 override_dh_auto_configure:
-	CFLAGS="$(CFLAGS)" dh_auto_configure -- --with-drivers=all --enable-static $(CONFIGURE_OPTIONS)
+	dh_auto_configure -- --with-drivers=all --enable-static $(CONFIGURE_OPTIONS)
 
 override_dh_auto_install:
 	LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
@@ -49,7 +38,7 @@
 	# No longer needed with current udev. But check with non-Linux architectures stuff:
 	# rm debian/libgphoto2-2/lib/udev/check-ptp-camera
 	# Generate the udev file, get it installed, and clean:
-	CAMLIBS=`ls -d debian/libgphoto2-$(major)/usr/lib/libgphoto2/2*` ./packaging/generic/print-camera-list udev-rules version 136 mode 0664 group plugdev > debian/libgphoto2-$(major).udev
+	CAMLIBS=`ls -d debian/libgphoto2-$(major)/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/2*` ./packaging/generic/print-camera-list udev-rules version 136 mode 0664 group plugdev > debian/libgphoto2-$(major).udev
 	dh_installudev
 	rm debian/libgphoto2-$(major).udev
 endif
@@ -58,8 +47,8 @@
 	dh_fixperms --exclude usbcam
 
 override_dh_makeshlibs:
-	dh_makeshlibs -plibgphoto2-$(major) -V 'libgphoto2-$(major) (>= $(SHLIBS))'
-	dh_makeshlibs -plibgphoto2-port0    -V 'libgphoto2-port0    (>= $(SHLIBS))'
+	dh_makeshlibs -plibgphoto2-$(major) -V 'libgphoto2-$(major) (>= $(SHLIBS))' -X/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/
+	dh_makeshlibs -plibgphoto2-port0    -V 'libgphoto2-port0    (>= $(SHLIBS))' -X/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2_port/
 
 override_dh_shlibdeps:
 	dh_shlibdeps -ldebian/libgphoto2-$(major)/usr/lib/:debian/libgphoto2-port0/usr/lib/

Reply via email to