--- libgphoto2-2.4.0.orig/debian/control
+++ libgphoto2-2.4.0/debian/control
@@ -0,0 +1,68 @@
+Source: libgphoto2
+Section: libs
+Priority: optional
+Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Frederic Peters <fpeters@debian.org>
+Build-Depends: debhelper (>> 5.0.0),
+               dpatch,
+               type-handling,
+               libtool,
+               libltdl3-dev,
+               zlib1g-dev,
+               libusb-dev (>= 1:0.1.5) [!hurd-i386],
+               libgpmg1-dev | not+linux-gnu,
+               pkg-config,
+               libexif-dev (>= 0.5.9),
+               libjpeg62-dev,
+               libhal-dev (>= 0.5.0-1) | not+linux-gnu,
+               doxygen,
+               libdbus-1-dev
+Build-Conflicts: liblockdev1-dev
+Standards-Version: 3.7.2
+
+Package: libgphoto2-2-dev
+Section: libdevel
+Architecture: any
+Provides: libgphoto2port-dev, libgphoto2-dev
+Replaces: libgphoto2port-dev, libgphoto2-dev, libgphoto2-port0 (<< 2.4.0-8), libgphoto2-2 (<< 2.4.0-8ubuntu1)
+Conflicts: libgphoto2port-dev, gphoto2-dev (<= 2.1.1), libgphoto2-port0 (<< 2.4.0-8)
+Depends: libgphoto2-2 (= ${binary:Version}), libexif-dev, libltdl3-dev, libusb-dev [!hurd-i386], libc6-dev, pkg-config
+Description: gphoto2 digital camera library (development files)
+ The gphoto2 library can be used by applications to access various
+ digital camera models, via standard protocols such as USB Mass Storage
+ and PTP, or vendor-specific protocols. 
+ .
+ This package contains the development files.
+
+Package: libgphoto2-port0
+Section: libs
+Architecture: any
+Provides: libgphoto2port
+Replaces: libgphoto2port
+Conflicts: libgphoto2port, gphoto2 (<= 2.1.1)
+Depends: ${shlibs:Depends}
+Suggests: gphoto2 (>> 2.1.0), gtkam
+Description: gphoto2 digital camera port library
+ The gphoto2 library can be used by applications to access various
+ digital camera models, via standard protocols such as USB Mass Storage
+ and PTP, or vendor-specific protocols. 
+ .
+ This package contains the runtime code for port access.
+
+Package: libgphoto2-2
+Section: libs
+Architecture: any
+Conflicts: gphoto2 (<= 2.1.1)
+Depends: ${shlibs:Depends}, adduser
+Recommends: hal (>= 0.5.10-5ubuntu1)
+Suggests: gphoto2 (>= 2.1.1)
+Description: gphoto2 digital camera library
+ The gphoto2 library can be used by applications to access various
+ digital camera models, via standard protocols such as USB Mass Storage
+ and PTP, or vendor-specific protocols. 
+ .
+ This package contains the library.
+ .
+ The gphoto2 command-line frontend is shipped separately, in the gphoto2
+ package.
+
--- libgphoto2-2.4.0.orig/debian/libgphoto2-port0.files
+++ libgphoto2-2.4.0/debian/libgphoto2-port0.files
@@ -0,0 +1,6 @@
+usr/share/locale/*/LC_MESSAGES/libgphoto2_port-0.mo
+usr/share/doc/libgphoto2_port/AUTHORS
+usr/share/doc/libgphoto2_port/README
+usr/share/doc/libgphoto2_port/NEWS
+usr/lib/libgphoto2_port.so*
+usr/lib/libgphoto2_port/*/{serial,usb,disk,ptpip}.so
--- libgphoto2-2.4.0.orig/debian/libgphoto2-2.files
+++ libgphoto2-2.4.0/debian/libgphoto2-2.files
@@ -0,0 +1,7 @@
+usr/share/locale/*/LC_MESSAGES/libgphoto2-2.mo
+usr/share/doc/libgphoto2/*
+usr/share/libgphoto2/*/konica/*
+usr/lib/libgphoto2/*/*.so
+usr/lib/libgphoto2.so.*
+usr/lib/libgphoto2/*/libgphoto2_*.so
+usr/lib/libgphoto2/print-camera-list
--- libgphoto2-2.4.0.orig/debian/rules
+++ libgphoto2-2.4.0/debian/rules
@@ -0,0 +1,126 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include /usr/share/dpatch/dpatch.make 
+
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+ifeq ($(DEB_HOST_ARCH_OS),)
+  DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM))
+  ifeq ($(DEB_HOST_ARCH_OS),gnu)
+      DEB_HOST_ARCH_OS := hurd
+  endif
+endif
+
+ifeq ($(DEB_HOST_ARCH_OS),hurd)
+  CONFIGURE_OPTIONS += --without-libusb
+endif
+
+major=2
+
+CFLAGS = -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+    CFLAGS += -O0
+else
+    CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+    INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp: patch
+	dh_testdir
+	CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --with-drivers=all --enable-static $(CONFIGURE_OPTIONS)
+	touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp 
+	dh_testdir
+	#$(MAKE) all-local  # necessary to get headers into gphoto2/
+	$(MAKE)
+	touch build-stamp
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+
+clean: unpatch-stamp
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	[ ! -f Makefile ] || $(MAKE) distclean
+	rm -f config.log config.status confdefs.h
+	rm -f libgphoto2_port/config.log libgphoto2_port/config.status
+	-rm -rf `pwd`/debian/tmp `pwd`/debian/libgphoto2 `pwd`/debian/libgphoto2-dev
+	rm -f po/stamp-po po/*.gmo
+
+	dh_clean
+
+unpatch: unpatch-stamp
+unpatch-stamp:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	export LIBRARY_PATH=`pwd`/debian/tmp/usr/lib; $(MAKE) install prefix=`pwd`/debian/tmp/usr
+
+	# remove upstream 0-byte files to make lintian happy
+	-find debian/tmp/ -size 0 -exec rm '{}' ';'
+
+	# Ok the GPL is already on the target system
+	rm debian/tmp/usr/share/doc/libgphoto2/COPYING
+
+	dh_movefiles
+
+	mv debian/libgphoto2-$(major)/usr/share/doc/libgphoto2 \
+		debian/libgphoto2-$(major)/usr/share/doc/libgphoto2-$(major)
+	mv debian/libgphoto2-port0/usr/share/doc/libgphoto2_port \
+		debian/libgphoto2-port0/usr/share/doc/libgphoto2-port0
+	install -D packaging/generic/check-ptp-camera debian/libgphoto2-$(major)/lib/udev/check-ptp-camera
+	rm debian/tmp/usr/lib/udev/check-ptp-camera
+	-test -e debian/tmp/usr/lib/udev/check-mtp-device && \
+		mkdir -p debian/libgphoto2-port0/lib/udev && \
+		mv debian/tmp/usr/lib/udev/check-mtp-device \
+			debian/libgphoto2-port0/lib/udev/check-mtp-device
+
+	-find debian/tmp -type d | sort -r | xargs rmdir 2>&1 > /dev/null
+	# debian/tmp should be empty here : if not fail:
+	test ! -d debian/tmp
+
+binary-indep: build install
+# We have nothing to do by default.
+
+binary-arch: build install
+	dh_testdir -a
+	dh_testroot -a
+	dh_installdocs doc/DAEMON
+	dh_installchangelogs ChangeLog
+	dh_link -a
+	dh_strip -a
+	dh_compress -a
+	dh_fixperms -a --exclude usbcam
+	dh_makeshlibs -a -V
+	dh_installdeb
+	dh_shlibdeps -ldebian/libgphoto2-$(major)/usr/lib/:debian/libgphoto2-port0/usr/lib/
+	dh_gencontrol -plibgphoto2-$(major)-dev
+	dh_gencontrol -plibgphoto2-port0
+ifeq (linux,$(DEB_HOST_ARCH_OS))
+	dh_gencontrol -plibgphoto2-$(major) -- -Vudev-hotplug="udev"
+else
+	dh_gencontrol -plibgphoto2-$(major)
+endif
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- libgphoto2-2.4.0.orig/debian/watch
+++ libgphoto2-2.4.0/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/gphoto/libgphoto2-([\d\.]*)\.tar\.gz
--- libgphoto2-2.4.0.orig/debian/libgphoto2-2.NEWS
+++ libgphoto2-2.4.0/debian/libgphoto2-2.NEWS
@@ -0,0 +1,25 @@
+libgphoto2 (2.2.1-9) unstable; urgency=low
+
+  libgphoto2 udev and hotplug scripts will now use the 'plugdev' group instead
+  of the 'camera' group.
+
+  Rationale is:
+
+  1) The convenience of using the plugdev group is that it is already
+     created by the installer for the first user, hence less work and
+     confusion for users.
+
+  2) Most users probably mentally group cameras with their other pluggable
+    devices, and I can't imagine a situation where the admin would grant
+    local access to cameras but not USB sticks, or vice versa. It's either
+    a desktop system or it isn't, and plugdev is the group for desktops.
+  
+  3) A lot of cameras (most?) are also USB mass storage devices, and thus
+    can be mounted by the user if he/she is in plugdev, so the separation
+    of plugdev and camera doesn't add anything security-wise.
+
+  (thanks to Christopher Martin for this rationale summary).
+
+  As a side effect this brings Debian and Ubuntu in sync on this matter.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 26 Oct 2006 20:11:37 +0200
--- libgphoto2-2.4.0.orig/debian/libgphoto2-2.dirs
+++ libgphoto2-2.4.0/debian/libgphoto2-2.dirs
@@ -0,0 +1,2 @@
+etc/udev/rules.d
+/usr/share/hal/fdi/information/10freedesktop
--- libgphoto2-2.4.0.orig/debian/libgphoto2-2-dev.files
+++ libgphoto2-2.4.0/debian/libgphoto2-2-dev.files
@@ -0,0 +1,14 @@
+usr/share/doc/libgphoto2/apidocs.html/
+usr/share/doc/libgphoto2/README.apidocs
+usr/share/man/man3/libgphoto2.3
+usr/share/man/man3/libgphoto2_port.3
+usr/lib/libgphoto2_port.{so,la,a}
+usr/lib/libgphoto2_port/*/{serial,usb,disk,ptpip}.{la,a}
+usr/lib/libgphoto2.{so,la,a}
+usr/lib/pkgconfig/libgphoto2.pc
+usr/lib/pkgconfig/libgphoto2_port.pc
+usr/lib/libgphoto2/*/*.{la,a}
+usr/include/gphoto2/*.h
+usr/include/gphoto2/gphoto2
+usr/bin/gphoto2-port-config
+usr/bin/gphoto2-config
--- libgphoto2-2.4.0.orig/debian/changelog
+++ libgphoto2-2.4.0/debian/changelog
@@ -0,0 +1,1227 @@
+libgphoto2 (2.4.0-8ubuntu7) hardy-proposed; urgency=low
+
+  * Add debian/patches/73_use_ptp_for_some_canon.dpatch:
+    Cherry-pick patch from upstream to use PTP mode for some Canon cameras:
+    - PowerShot SD200
+    - Digital IXUS 30
+    - IXY Digital 40
+    Thanks to Christoph Pegel for debugging the problem and finding the
+    patch. (LP: #228154)
+
+ -- James Westby <james.westby@canonical.com>  Sat, 10 May 2008 01:18:53 +0100
+
+libgphoto2 (2.4.0-8ubuntu6) hardy; urgency=low
+
+  * Add debian/patches/72_deprecated_hal_key.dpatch: Replace the deprecated
+    hal property "info.bus" with "info.subsystem" in the hal FDI generation
+    tool. This fixes cameras to work with current hal without using deprecated
+    keys. (LP: #205417)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 25 Mar 2008 16:32:03 +0100
+
+libgphoto2 (2.4.0-8ubuntu5) hardy; urgency=low
+
+  * debian/control:
+    - add missing replaces for libgphoto2-2-dev
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 17 Mar 2008 11:33:07 +0100
+
+libgphoto2 (2.4.0-8ubuntu4) hardy; urgency=low
+
+  * debian/control: Add appropriate Replaces/Conflicts for the serial.a
+    shuffling that we did close to gutsy's release and now has been reverted
+    to sanity. (LP: #175396)
+  * Add debian/patches/00svn-ptp2-ids.dpatch: Update PtP2 camera library ID
+    list to SVN head.
+    - Fixes Panasonic Lumix FZ20. (LP: #175156)
+    - Fixes quirks for Nikon cameras. (LP: #157782)
+    - Supersedes debian/patches/30_additional_camera_support.dpatch, dropped.
+  * Add debian/patches/71_sandisk_sansa_crash.dpatch:
+    - Fix crash for Sandisk Sansa e250 oddity.
+    - Patch taken from upstream bug tracker, see patch header.
+    - LP: #199027
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed, 12 Mar 2008 11:33:56 +0100
+
+libgphoto2 (2.4.0-8ubuntu3) hardy; urgency=low
+
+  * debian/control:
+    - libgphoto2-2-dev depends on libltdl3-dev since it's required
+
+ -- Sebastien Bacher <seb128@canonical.com>  Tue, 26 Feb 2008 02:14:24 +0100
+
+libgphoto2 (2.4.0-8ubuntu2) hardy; urgency=low
+
+  * debian/control: Re-add dependency to type-handling. It's in main now, a
+    harmless no-op for Ubuntu, and thus not worth keeping a delta for it.
+  * Hal now uses dynamic ACLs for users on local consoles, so stop using the
+    plugdev group (see hardy-hardware-detection spec):
+    - debian/libgphoto2-2.postinst: Do not create udev rules any more.
+    - debian/libgphoto2-2.postinst: Remove udev rules on upgrades. This must
+      be kept until after Hardy release.
+    - debian/control: Change udev dependency to hal (>= 0.5.10-5ubuntu1).
+    - Remove debian/libgphoto2-2.README.Debian, since it does not apply at all
+      any more.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed, 02 Jan 2008 15:18:13 +0100
+
+libgphoto2 (2.4.0-8ubuntu1) hardy; urgency=low
+
+  * Merge from debian unstable, remaining changes:
+    - debian/control: Drop type-handling.
+    - debian/libgphoto2-2.postinst, debian/libgphoto2-2.postrm: Ubuntu
+      specific udev rule handling. Fixed handling for older udev.
+  * Drop the moving of .la files from the -dev to the library package, since
+    kdelibs is fixed properly now.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 10 Dec 2007 17:17:35 +0100
+
+libgphoto2 (2.4.0-8) unstable; urgency=low
+
+  * debian/patches/45_increase_canon_timeout.dpatch Increase timeout wait for
+    an URB to come back on an interrupt endpoint  (closes: #453114)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 27 Nov 2007 15:15:11 +0100
+
+libgphoto2 (2.4.0-7) unstable; urgency=low
+
+  * debian/patches/30_additional_camera_support.dpatch: added Canon G9
+    (patch by Harald Dunkel, closes: #446237)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 11 Oct 2007 13:05:00 +0200
+
+libgphoto2 (2.4.0-6) unstable; urgency=low
+
+  * debian/patches/65_udev_usb_subsystem.dpatch: changed udev rules to go
+    through device listing for both subsystem usb and usb_device.
+    (closes: #445660)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 09 Oct 2007 17:12:27 +0200
+
+libgphoto2 (2.4.0-5) unstable; urgency=low
+
+  * debian/control: 
+    * improved libgphoto2-2 and libgphoto2-dev long descriptions to note
+      about PTP support (but not MTP since this is not what libgphoto2
+      is for) (closes: #347875)  (this got lost somewhere)
+    * removed gtkam suggestion
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 29 Sep 2007 22:47:08 +0200
+
+libgphoto2 (2.4.0-4) unstable; urgency=low
+
+  * debian/patches/60_udev_rules_are_autogenerated_notice.dpatch: adds a note
+    to udev rules file to explain that file is generated automatically and
+    that local changes will thus be lost on upgrades.  (closes: #341470)
+  * debian/patches/30_additional_camera_support.dpatch: added support for Fuji
+    FinePix A800 (closes: #421179) and Nikon Coolpix P5000 (closes: #427173)
+  * debian/patches/70_increase_max_entries.dpatch: increased max entries from
+    1024 to 8192 (closes: #425515, #427476)
+  * debian/control: updated ${Source-Version} to ${binary:Version}
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 28 Sep 2007 23:11:10 +0200
+
+libgphoto2 (2.4.0-3) unstable; urgency=low
+
+  * debian/libgphoto2-2.postinst: creates device nodes with 0664 mode so
+    productId, vendorId and such kind of details can be read (closes: #440763)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 12 Sep 2007 13:00:53 +0200
+
+libgphoto2 (2.4.0-2ubuntu2) gutsy; urgency=low
+
+  * debian/*.files: Move .la files from -dev package to libgphoto2-2
+    and libgphoto2-port0 packages. kdelibs dynaloader needs the .la files.
+    Closes: LP: 145239. Upstream bug report: http://bugs.kde.org/125696
+
+  * debian/control: add Replaces libgphoto2-2-dev (<= 2.4.0-2ubuntu1)
+    due to the plugins .la files moved from -dev package to libgphoto2-2
+    and libgphoto2-port0
+
+ -- Achim Bohnet <allee@kubuntu.org>  Wed, 03 Oct 2007 21:33:49 +0200
+
+libgphoto2 (2.4.0-2ubuntu1) gutsy; urgency=low
+
+  * Merge from debian unstable, remaining changes:
+    - debian/control: Drop type-handling.
+    - debian/libgphoto2-2.postinst, debian/libgphoto2-2.postrm: Ubuntu
+      specific udev rule handling. Fixed handling for older udev.
+  * Drop udev as dependancy: already in debian.
+  * Drop sed/type-handling from debian/rules: already removed in debian.
+  * Include bug fix for Canon reconnect problem (from SVN)
+    debian/patches/60_canon_reconnect_r10611.dpatch
+
+ -- Luka Renko <lure@ubuntu.com>  Wed, 05 Sep 2007 23:20:24 +0200
+
+libgphoto2 (2.4.0-2) unstable; urgency=low
+
+  * debian/patches/11_hurd_no_path_max_bsdsource.dpatch: new patch contributed
+    by Samuel Thibault, to fix compilation issues on the Hurd,(closes: #434568)
+    * description: Hurd has no such hard limit like PATH_MAX, and define
+      _BSD_SOURCE because code uses IXANY and O_NDELAY.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 15 Aug 2007 00:13:26 +0200
+
+libgphoto2 (2.4.0-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/patches/:
+    * 15_use_bash_in_ptp_camera_check.dpatch: disabled, applied upstream
+    * 20_fix-zero-vendor-ids.dpatch: disabled, upstream says it is wrong
+    * 40_disable_canon_fast_directory_retrieval_r10028.dpatch: disabled,
+      applied upstream
+    * 50_getenv_home_overflow.dpatch: disabled, applied upstream
+  * debian/control, debian/rules: removed suggests and recommends on hotplug
+    (closes: #436504)
+  * debian/libgphoto2-2.README.Debian: removed parts about hotplug and updated
+    parts about udev.
+  * debian/hotplug: removed as no longer useful
+  * debian/control{,.in}: removed control.in generation via sed, using
+    not+linux-gnu from typehandling instead
+  * debian/rules: installs new check-mtp-device into libgphoto2-port0
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 09 Aug 2007 16:02:30 +0200
+
+libgphoto2 (2.3.1-8) unstable; urgency=low
+
+  * 50_getenv_home_overflow.dpatch: fixed upstream typo, sprintf -> snprintf,
+    (upstream r10453) (closes: #434552, #434386)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 24 Jul 2007 22:22:14 +0200
+
+libgphoto2 (2.3.1-7) unstable; urgency=low
+
+  * 50_getenv_home_overflow.dpatch: load_settings/save_settings: updated as
+    applied by upstream.
+  * debian/rules: don't ignore potential make clean errors
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 21 Jul 2007 12:42:16 +0200
+
+libgphoto2 (2.3.1-6) unstable; urgency=low
+
+  * 50_getenv_home_overflow.dpatch: load_settings/save_settings: don't copy
+    more characters from $HOME than possible in buffer.
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 20 Jul 2007 13:21:55 +0200
+
+libgphoto2 (2.3.1-5ubuntu1) gutsy; urgency=low
+
+  * Merge from debian unstable, remaining changes:
+    - debian/control: Promote udev to a dependency.
+    - debian/control, debian/rules: Drop type-handling.
+    - debian/libgphoto2-2.postinst, debian/libgphoto2-2.postrm: Ubuntu
+      specific udev rule handling.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 14 May 2007 22:43:55 +0200
+
+libgphoto2 (2.3.1-5) unstable; urgency=low
+
+  * debian/patches/40_disable_canon_fast_directory_retrieval_r10028: disable
+    fast directory retrieval on Canon models since this is broken on some.
+    (closes: #422386).
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 07 May 2007 10:15:25 +0200
+
+libgphoto2 (2.3.1-4) unstable; urgency=low
+
+  * debian/patches/20_fix-zero-vendor-ids.dpatch: replaces old and broken
+    20_disable_generic_mtp_udev_rule, patch from upstream and Martin Pitt,
+    thanks.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 02 May 2007 19:38:17 +0200
+
+libgphoto2 (2.3.1-3ubuntu1) gutsy; urgency=low
+
+  * Merged with Debian unstable; remaining Ubuntu changes:
+    - debian/control: Promote udev to a dependency.
+    - debian/control, debian/rules: Drop type-handling.
+    - debian/libgphoto2-2.postinst, debian/libgphoto2-2.postrm: Ubuntu
+      specific udev rule handling.
+  * Dropped all our source patches, they are upstream now.
+  * Drop 20_disable_generic_mtp_udev_rule.dpatch; this is a wrong fix for
+    LP #76077 aka. Debian #408253 since it prevents the check-ptp-camera
+    script from getting into the udev rules. Upstream has this already fixed
+    in 2.3.1.
+  * Add debian/patches/20_fix-zero-vendor-ids.dpatch: Fix zero vendor/product
+    IDs in udev rules. (LP #76077)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 23 Apr 2007 19:40:28 +0200
+
+libgphoto2 (2.3.1-3) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 11 Apr 2007 10:09:10 +0200
+
+libgphoto2 (2.3.1-2) experimental; urgency=low
+
+  * debian/libgphoto2-2.{postinst,postrm}: check for /etc/init.d/udev script.
+  * debian/patches/15_use_bash_in_ptp_camera_check.dpatch: use bash since the
+    script has bashisms.
+  * debian/patches/20_disable_generic_mtp_rules.dpatch: do not generate udev
+    or fdi entries for devices with 0x0000 as idVendor (this affects generic
+    MTP devices) (closes: #408253)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 24 Jan 2007 19:18:31 +0100
+
+libgphoto2 (2.3.1-1) experimental; urgency=low
+
+  * New upstream version.
+    * removed debian/patches/20_udev_rules: shipped upstream
+  * debian/libgphoto2-2.files: print-usb-usermap is no longer shipped; no
+    more need to exclude it for kernels other than Linux
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 16 Jan 2007 11:25:42 +0100
+
+libgphoto2 (2.3.0-2) experimental; urgency=low
+
+  * debian/control.in: added libusb-dev as libgphoto2-dev dependency.
+    (closes: #407108)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 16 Jan 2007 10:22:58 +0100
+
+libgphoto2 (2.3.0-1) experimental; urgency=low
+
+  * New upstream version.
+    * Uploaded to experimental.
+    * (closes: #402875)
+  * Synced with Ubuntu packaging.
+    * debian/rules: Install check_ptp_camera to libgphoto2-2's lib/udev/
+    * debian/rules: Remove the 'make all-local' call, it does not work any more
+      and is not necessary any more either.
+    * debian/*.files{,.in}: Turn versions in paths into globs to match newer
+      versions.
+    * debian/libgphoto2-2.postinst: Call print-camera-list with mode and group
+      arguments (this replaces the former source code patch.)
+  * Moved to dpatch:
+    * 10_disable_cache: do not cache all downloaded files to plug a giant
+      memory hole
+    * 20_udev_rules: upstream SVN change 9562 to add and use an udev helper
+      script to detect whether a USB device has a PtP compatible interface.
+    * 30_additional_camera_support: USB IDs for new and supported camera models
+      (Sony DSC-W5, patch by Otavio Salvador, closes: #402687)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 13 Jan 2007 15:20:25 +0100
+
+libgphoto2 (2.3.0-0ubuntu4) feisty; urgency=low
+
+  * debian/libgphoto2-2.postinst:
+    - If udevinfo is present, check udev version. If it is smaller than 98,
+      ask print-camera-list to use the output format for older udev versions.
+    - This avoids a feisty-only versioned udev dependency. (LP: #90905)
+    - When this version gets an edgy backport, it will actually work again.
+      (LP: #91250).
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon,  2 Apr 2007 17:58:13 +0200
+
+libgphoto2 (2.3.0-0ubuntu3) feisty; urgency=low
+
+  * debian/control: Add missing libusb-dev dependency to libgphoto2-2-dev.
+    This will finally fix ghtumb's photo import for good. (LP: #78756)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue,  6 Mar 2007 09:04:26 +0100
+
+libgphoto2 (2.3.0-0ubuntu2) feisty; urgency=low
+
+  * packaging/generic/print-camera-list.c: Ignore zero vendor IDs, since they
+    will match on parent devices without a vendor/product ID (since we have to
+    use ATTRS, not just ATTR). This avoids messing up other device's
+    permissions. (LP: #76077)
+  * packaging/generic/check_ptp_camera: Run with bash, since the script has
+    some bashisms that avoid calling cat several times. This makes the script
+    work again. (LP: #67532)
+  * debian/control: Adapt maintainers for Ubuntu.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 13 Feb 2007 17:10:02 +0100
+
+libgphoto2 (2.3.0-0ubuntu1) feisty; urgency=low
+
+  * New upstream version 2.3.0. Closes: LP#74847, LP#61163
+  * Dropped almost all patches from the package diff.gz since they have been
+    adopted or obsoleted upstream. Only remaining change:
+    - libgphoto2/gphoto2-filesys.c: Do not cache all downloaded files to plug
+      a giant memory hole (see Debian bug #372166).
+  * packaging/generic/{print-camera-list.c,check_ptp_camera}: Applied upstream
+    SVN change 9562 to add and use an udev helper script to detect whether a
+    USB device has a PtP compatible interface. This cannot be matched with a
+    simple udev rule. Closes: LP#67532
+  * debian/rules: Install check_ptp_camera to libgphoto2-2's lib/udev/.
+  * debian/rules: Remove the 'make all-local' call, it does not work any more
+    and is not necessary any more either.
+  * debian/*.files{,.in}: Turn versions in paths into globs to match newer
+    versions.
+  * debian/libgphoto2-2.postinst: Call print-camera-list with mode and group
+    arguments (this replaces the former source code patch.)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri, 15 Dec 2006 16:12:18 +0100
+
+libgphoto2 (2.2.1-12ubuntu1) feisty; urgency=low
+
+  * Merge to Debian unstable. Remaining Ubuntu changes:
+    - debian/libgphoto2-2.postinst:
+      + Do not install hotplug script.
+      + Install direct udev rules file, not a symlink.
+    - debian/libgphoto2-2.postrm: Respective change for removing udev symlink.
+    - debian/control, debian/rules: Remove type-handling goo.
+    - debian/control: Promote udev to a dependency.
+  * debian/rules: Do not install Debians' generic udev rules for PtP cameras,
+    since it does not work.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri, 15 Dec 2006 13:40:44 +0100
+
+libgphoto2 (2.2.1-12) unstable; urgency=low
+
+  * debian/udev_generic_ptp_support.rules: create note earlier on for PTP
+    cameras, so they get correct membership and permissions.
+  * debian/control.in: added build-depends on libdbus-1-dev
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 27 Nov 2006 21:50:23 +0100
+
+libgphoto2 (2.2.1-11) unstable; urgency=low
+
+  * libgphoto2_port/disk/disk.c: removed call dbus_connection_close() (already
+    done in upstream svn) (closes: #398022)
+  * camlibs/ptp2/library.c: added USB id for Canon PowerShot G7
+    (closes: #399421)
+  * debian/libgphoto2-2.README.Debian: added explanation about udev user
+    rules; as long as generic capability is not handled by shipped udev rules.
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 19 Nov 2006 17:06:56 +0000
+
+libgphoto2 (2.2.1-10) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added USB id for Canon EOS 400D (already present
+    in upstream svn) (closes: #396581)
+  * camlibs/ptp2/library.c: added USB id for Canon Digital IXUS 850 IS.
+
+ -- Frederic Peters <fpeters@debian.org>  Sat,  4 Nov 2006 12:08:56 +0100
+
+libgphoto2 (2.2.1-9ubuntu1) feisty; urgency=low
+
+  * Merge to Debian unstable. Remaining Ubuntu changes:
+    - debian/libgphoto2-2.postinst:
+      + Do not install hotplug script.
+      + Install direct udev rules file, not a symlink.
+    - debian/libgphoto2-2.postrm: Respective change for removing udev symlink.
+    - debian/control, debian/rules: Remove type-handling goo.
+    - debian/control: Promote udev to a dependency.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri,  3 Nov 2006 17:18:54 +0100
+
+libgphoto2 (2.2.1-9) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added new USB id for Canon PowerShot A710 IS
+    (closes: #395380) (patch sent by Martin Pitt/Ubuntu, thanks).
+  * packaging/generic/print-camera-list.c, debian/hotplug: changed camera
+    group from 'camera' to 'plugdev'.
+  * debian/libgphoto2-2.README.Debian, debian/libgphoto2-2.NEWS: documented
+    this change.
+  * debian/libgphoto2-2.postinst: reload udev rules on install.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 26 Oct 2006 20:43:33 +0200
+
+libgphoto2 (2.2.1-8) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added new USB id for Nikon Coolpix 4600.
+    (closes: #394762) (thanks to Roberto Costa)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 23 Oct 2006 12:49:00 +0200
+
+libgphoto2 (2.2.1-7) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added Fuji F30, patch by Scott Zuk.
+    (closes: #392512)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 12 Oct 2006 08:58:47 +0200
+
+libgphoto2 (2.2.1-6) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added Canon Ixus 65, take from Ubuntu patch.
+  * debian/libgphoto2-2.postinst: merged FDI file code from Ubuntu postinst:
+    + Do not install a separate 10-camera-libgphoto2-device.fdi
+      10-camera-libgphoto2.fdi already has everything required.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  9 Oct 2006 22:20:57 +0200
+
+libgphoto2 (2.2.1-5) unstable; urgency=low
+
+  * debian/libgphoto2-2.postinst: fixed .fdi file extension.  (closes: #389601)
+  * debian/libgphoto2-2.postrm: remove generated files on purge and remove.
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 30 Sep 2006 22:21:04 +0200
+
+libgphoto2 (2.2.1-4) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added Kodak CD3 USB id.  (closes: #387998)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 18 Sep 2006 10:41:00 +0200
+
+libgphoto2 (2.2.1-3) unstable; urgency=low
+
+  * libgphoto2_port/disk/disk.c: dbus_connection_disconnect has been
+    deprecated, using dbus_connection_close instead.  Report and patch
+    by Sebastian Dröge, thanks.  (closes: #385379)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu,  7 Sep 2006 19:38:04 +0200
+
+libgphoto2 (2.2.1-2ubuntu4) edgy; urgency=low
+
+  * camlibs/ptp2/library.c: Add Canon IXUS 65. Closes: LP#64146
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon,  9 Oct 2006 12:13:52 +0200
+
+libgphoto2 (2.2.1-2ubuntu3) edgy; urgency=low
+
+  * Drop libhal-dev build dependency (Closes: Ubuntu #59166)
+
+ -- Andrew Mitchell <ajmitch@ubuntu.com>  Sun, 17 Sep 2006 22:29:54 +1200
+
+libgphoto2 (2.2.1-2ubuntu2) edgy; urgency=low
+
+  * Rebuild against dbus 0.90
+  * libgphoto2_port/disk/disk.c:
+    + s/dbus_connection_disconnect/dbus_connection_close/g
+
+ -- Sebastian Dröge <slomo@ubuntu.com>  Thu, 24 Aug 2006 17:59:25 +0200
+
+libgphoto2 (2.2.1-2ubuntu1) edgy; urgency=low
+
+  * Merge from debian unstable.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed,  5 Jul 2006 12:38:08 +0200
+
+libgphoto2 (2.2.1-2) unstable; urgency=low
+
+  * libgphoto2/gphoto2-filesys.c: Do not cache all downloaded files to plug
+    a giant memory hole (from Ubuntu patch). (closes: #372166)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  3 Jul 2006 14:09:28 +0200
+
+libgphoto2 (2.2.1-1ubuntu2) edgy; urgency=low
+
+  * debian/libgphoto2-2.postinst: Create directory
+    /usr/share/hal/fdi/preprobe/10osvendor/; it is shipped by hal, but that is
+    not a dependency.
+  * debian/control: Depend on udev instead of merely recommending it.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon,  3 Jul 2006 18:26:18 +0200
+
+libgphoto2 (2.2.1-1ubuntu1) edgy; urgency=low
+
+  * Synchronize to Debian. Most of our changes have been applied in Debian and
+    upstream, or are obsoleted by the new, quite flexible, print-camera-list
+    tool. Ported remaining changes:
+    - debian/control, debian/rules: Remove type-handling.
+    - debian/rules: Do not install hotplug script.
+    - packaging/generic/print-camera-list.c,
+      debian/libgphoto2-2.README.Debian: Fix group s/camera/plugdev/.
+    - debian/libgphoto2-2.postinst: 
+      + Use 'plugdev' as group instead of 'camera'.
+      + Do not create hotplug usermap (hotplug is obsolete).
+      + Install udev rules into /etc/udev/rules.d/ instead of Debian's symlink
+        structure.
+      + Do not install a separate 10-camera-libgphoto2-device.fdi,
+        10-camera-libgphoto2.fdi already has everything required.
+    - debian/libgphoto2-2.postrm: Corresponding changes to postinst script.
+    - libgphoto2/gphoto2-filesys.c: Do not cache all downloaded files to plug
+      a giant memory hole (LP#5039).
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri, 30 Jun 2006 14:04:46 +0200
+
+libgphoto2 (2.2.1-1) unstable; urgency=low
+
+  * New upstream version.
+    - merged GNU/kFreeBSD patch.
+  * added Dutch translation. (closes: #374852)
+  * packaging/linux-hotplug/: removed print-udev-rules which is no longer
+    used. 
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 22 Jun 2006 09:39:24 +0200
+
+libgphoto2 (2.2.0-5) unstable; urgency=low
+
+  * libgphoto2_port/serial/unix.c: GNU/kFreeBSD fix. (closes: #374468)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 19 Jun 2006 23:05:11 +0200
+
+libgphoto2 (2.2.0-4) unstable; urgency=low
+
+  * debian/control.in: do not build-depends on libhal-dev on kFreeBSD
+    (closes: #369577)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 19 Jun 2006 08:41:37 +0200
+
+libgphoto2 (2.2.0-3) unstable; urgency=low
+
+  * debian/libgphoto2-2.dirs: installs HAL FDI directory since hal is not a
+    dependency. (closes: #374285)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 18 Jun 2006 13:26:17 +0200
+
+libgphoto2 (2.2.0-2) unstable; urgency=low
+
+  * packaging/generic/Makefile.am: added INCLUDES variable so it builds even
+    without libgphoto2-2-dev already installed. (closes: #374259)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 18 Jun 2006 10:42:15 +0200
+
+libgphoto2 (2.2.0-1) unstable; urgency=low
+
+  * New upstream release, uploaded to unstable
+  * camlibs/ptp2/library.c: removed duplicate filename patch
+  * debian/changelog: merged parallel history from 2.1.6-7 -> 2.1.6-13
+  * debian/libgphoto2-2.postinst: now use print-camera-list
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 18 Jun 2006 01:08:15 +0200
+
+libgphoto2 (2.1.99-13) experimental; urgency=low
+
+  * print-udev-rules.c: reworked udev rules so they can work in more cases.
+  * removed Canon PowerShot A610 from cameras with Canon protocol; it only
+    has PTP.
+  * sync with 2.1.6-13
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 30 May 2006 16:22:33 +0200
+
+libgphoto2 (2.1.99-12) experimental; urgency=low
+
+  * print-udev-rules.c: fixed according to explanations in #368893, reinstate
+    BUS!="usb" line and specify SUBSYSTEM on generic PTP line.
+  * added Canon PowerShot A530 and A540.
+  * print-udev-rules.c: once again shooting in the dark (changed to matching
+    on SUBSYSTEM instead of BUS)
+  * synced with 2.1.6-12
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 29 May 2006 13:46:18 +0200
+
+libgphoto2 (2.1.99-11) experimental; urgency=low
+
+  * print-udev-rules.c: fixed according to tip by Marcus Meissner, so it will
+    match newer PTP cameras. (sync with 2.1.6-10)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 16 May 2006 09:09:30 +0200
+
+libgphoto2 (2.1.99-10) experimental; urgency=low
+
+  * camlibs/ptp2/library.c: added Kodak EasyShare Z740
+  * debian/rules: use DEB_HOST_ARCH_OS, not DEB_HOST_GNU_SYSTEM
+  * debian/control.in: *really* added build-depends on doxygen, graphviz.
+    (closes: #356942)
+  * debian/compat: bumped to 5
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 15 May 2006 13:00:55 +0200
+
+libgphoto2 (2.1.99-9) experimental; urgency=low
+
+  * packaging/linux-hotplug/print-udev-rules.c: removed BUS!=usb line since
+    BUS was not reported by udev.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  3 Apr 2006 11:28:36 +0200
+
+libgphoto2 (2.1.99-8) experimental; urgency=low
+
+  * packaging/linux-hotplug/print-udev-rules.c: splitted match line
+    (closes: #359796)
+  * packaging/linux-hotplug/print-udev-rules.c: always change device access
+    rights to 0660
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 29 Mar 2006 09:57:01 +0200
+
+libgphoto2 (2.1.99-7) experimental; urgency=low
+
+  * debian/control: libgphoto2-port0 doesn't depend on libgphoto2; only keep
+    it the other way, breaking circular depends. (closes: #357796)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 19 Mar 2006 17:08:36 +0100
+
+libgphoto2 (2.1.99-6) experimental; urgency=low
+
+  * debian/control: added build-depends on doxygen, graphviz.
+    (closes: #356942)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 14 Mar 2006 23:11:45 +0100
+
+libgphoto2 (2.1.99-5) experimental; urgency=low
+
+  * camlibs/ptp2/library.c: synced with patch from Ubuntu.
+
+ -- Frederic Peters <fpeters@debian.org>  Sat, 11 Mar 2006 10:47:51 +0100
+
+libgphoto2 (2.1.99-4) experimental; urgency=low
+
+  * debian/libgphoto2-2.prerm: clean udev/hotplug files from /etc/ on purge.
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  6 Mar 2006 20:52:35 +0100
+
+libgphoto2 (2.1.99-3) experimental; urgency=low
+
+  * debian/control: build-depends on libhal-dev so libgphoto2_port is built
+    with HAL support. (closes: #355212)
+
+ -- Frederic Peters <fpeters@debian.org>  Sat,  4 Mar 2006 12:45:33 +0100
+
+libgphoto2 (2.1.99-2) experimental; urgency=low
+
+  * debian/postinst: generate .fdi file.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 15 Feb 2006 12:46:03 +0100
+
+libgphoto2 (2.1.99-1) experimental; urgency=low
+
+  * New upstream release.
+    * Upload to experimental. (closes: #347873)
+    * Canon IXUS 750 is recognised. (closes: #346323)
+    * Don't cache everything, patch from 2.1.6-5.3 is thus removed.
+  * Forward ported:
+   * Derived print-udev-rules from print-usb-usermap to generate the udev
+     rules file.
+   * camlibs/ptp2/library.c: ported (kludgy) patch to work with HP
+     PhotoSmart 850 (as requested by user).
+  * debian/control:
+    * improved libgphoto2-2 and libgphoto2-dev long descriptions to note
+      about PTP support (but not MTP since this is not what libgphoto2
+      is for) (closes: #347875)
+    * added note about Disk support to libgphoto2-port long description.
+  * camlibs/ptp2/library.c: added support for Kodak EasyShare C360
+    (closes: #345016)
+  * packaging/linux-hotplug/print-udev-rules.c: changed to use new udev rule
+    (closes: #342279, #341151)
+  * debian/hotplug: this totally removes hotplug calls for newer udev
+    versions; hotplug script still installed for old hotplug installs.
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 15 Jan 2006 22:56:48 +0100
+
+libgphoto2 (2.1.6-13) unstable; urgency=low
+
+  * print-udev-rules.c: reworked rules file so it should work whatever udev
+    discrepancy happens. (closes: #369476)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 30 May 2006 14:24:43 +0200
+
+libgphoto2 (2.1.6-12) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added Canon PowerShot A540, thanks to David
+    Goodenough (closes: #369143)
+  * camlibs/ptp2/library.c: added Canon PowerShot A610.
+  * print-udev-rules.c: once again shooting in the dark (changed to matching
+    on SUBSYSTEM instead of BUS)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 29 May 2006 13:42:35 +0200
+
+libgphoto2 (2.1.6-11) unstable; urgency=low
+
+  * print-udev-rules.c: fixed according to explanations in #368893, reinstate
+    BUS!="usb" line and specify SUBSYSTEM on generic PTP line.
+  * camlibs/ptp2/library.c: added Canon PowerShot A530, thanks to Ales
+    Kozumplik (closes: #368893)
+
+ -- Frederic Peters <fpeters@debian.org>  Fri, 26 May 2006 10:51:03 +0200
+
+libgphoto2 (2.1.6-10) unstable; urgency=low
+
+  * print-udev-rules.c: fixed according to tip by Marcus Meissner, so it will
+    match newer PTP cameras.
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 16 May 2006 09:06:33 +0200
+
+libgphoto2 (2.1.6-9) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added Kodak EasyShare Z740 (closes: #367350)
+  * debian/rules: use DEB_HOST_ARCH_OS, not DEB_HOST_GNU_SYSTEM
+  * debian/control: removed circular dependency, libgphoto2-port0 no longer
+    depends upon libgphoto2-2 (closes: #357796)
+  * debian/compat: bumped to 5
+
+ -- Frederic Peters <fpeters@debian.org>  Mon, 15 May 2006 12:51:43 +0200
+
+libgphoto2 (2.1.6-8) unstable; urgency=low
+
+  * packaging/linux-hotplug/print-udev-rules.c: removed BUS!=usb line since
+    BUS was not reported by udev. (closes: #360526)
+
+ -- Frederic Peters <fpeters@debian.org>  Mon,  3 Apr 2006 11:26:47 +0200
+
+libgphoto2 (2.1.6-7) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: added a bunch of Kodak camera (closes: #359298)
+  * camlibs/ptp2/library.c: added Nikon DSC D70s (closes: #321629)
+  * packaging/linux-hotplug/print-udev-rules.c: splitted match line
+    (closes: #359796)
+  * packaging/linux-hotplug/print-udev-rules.c: use dev facilities to change
+    ownership and permissions. (closes: #359799)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 29 Mar 2006 10:39:11 +0200
+
+libgphoto2 (2.1.6-6) unstable; urgency=low
+
+  * Acknowledge NMUs, thanks to all.
+  * debian/hotplug: changed hotplug script to support new udev and kernel
+    versions (thanks to Aleksey Kliger) (closes: #341083, #342279, #342282)
+  * debian/libgphoto2-2.postinst: don't generate udev rules if udev directory
+    doesn't exist (closes: #334578)
+
+ -- Frederic Peters <fpeters@debian.org>  Thu,  8 Dec 2005 12:02:29 +0100
+
+libgphoto2 (2.1.6-5.3) unstable; urgency=low
+
+  * Non-Maintainer Upload.
+  * Disable cache - this reduces memory usage from 3Mb + ammount 
+    of all files downloaded (which could be several Gb) down to
+    3Mb + size of file that we currently download (Closes: #338880, #334581).
+
+ -- Aigars Mahinovs <aigarius@debian.org>  Sun, 27 Nov 2005 08:20:22 +0200
+
+libgphoto2 (2.1.6-5.2ubuntu8) dapper; urgency=low
+
+  * camlibs/canon/canon.c: Disable normal mode of some Canon cameras which
+    were found only to work in PTP mode. Thanks to Marcus Meissner for
+    providing the upstream patch. Closes: LP#27586
+  * camlibs/ptp2/library.c: Disable theme.dat special file handling; it's not
+    yet complete and just breaks (upstream svn has it disabled for now, too).
+    Closes: LP#43163
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed, 10 May 2006 14:03:58 +0200
+
+libgphoto2 (2.1.6-5.2ubuntu7) dapper; urgency=low
+
+  * Applied upstream patch to fix delete command handling of some Canon
+    cameras. Also added a few more Canon Vendor/Product IDs. Thanks to Marcus
+    Meissner and Hubert Figuiere! Closes: LP#2767
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue,  2 May 2006 16:30:16 +0200
+
+libgphoto2 (2.1.6-5.2ubuntu6) dapper; urgency=low
+
+  * camlibs/canon/canon.c: Remove normal mode for PowerShot S1 IS, since it's
+    broken. This will cause the camera to be accessed in PtP mode, which works
+    just well (and standard protocols are preferable anyway). Closes: LP#5911
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed,  5 Apr 2006 16:31:19 +0200
+
+libgphoto2 (2.1.6-5.2ubuntu5) dapper; urgency=low
+
+  * Repair non-PtP camera support (Malone #24655):
+    - Add debian/generate-hal-fdi (stolen from hal): This script produces an
+      FDI file which assigns the property camera.access_method="libgphoto2" to
+      all camera devices supported by libgphoto.
+    - debian/rules: Install script.
+    - debian/libgphoto2-2.postinst: Call script to generate
+      /usr/share/hal/fdi/preprobe/10osvendor/20-libgphoto2.fdi.
+    - debian/libgphoto2-2.postrm: Remove 20-libgphoto2.fdi on package removal.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 20 Mar 2006 14:37:15 +0100
+
+libgphoto2 (2.1.6-5.2ubuntu4) dapper; urgency=low
+
+  * libgphoto2/gphoto2-filesys.c: Disable file caching when downloading
+    pictures to plug a giant memory hole. Thanks to Aigars Mahinovs.
+    (Malone #5039)
+  * Add debian/check_ptp_camera: udev script to check whether a device is a
+    PTP (Photo Transfer Protocol) camera.
+  * packaging/linux-hotplug/print-udev-rules.c: Add rule for calling
+    check_ptp_camera to fix the currently broken one: just checking
+    SYSFS{bInterfaceClass} does not work, since this attribute only applies to
+    a subdevice of the camera. (Malone #31292)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 27 Feb 2006 16:46:03 +0100
+
+libgphoto2 (2.1.6-5.2ubuntu3) dapper; urgency=low
+
+  * packaging/linux-hotplug/print-udev-rules.c: s/Goto/GOTO/ in automatic udev
+    rules.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon,  5 Dec 2005 14:28:49 +0100
+
+libgphoto2 (2.1.6-5.2ubuntu2) dapper; urgency=low
+
+  * debian/libgphoto2-2.postinst:
+    - Install the udev file directly into /etc/udev/rulesd.
+    - Remove the old file and the symlink on upgrades.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Thu,  1 Dec 2005 16:53:11 +0100
+
+libgphoto2 (2.1.6-5.2ubuntu1) dapper; urgency=low
+
+  * Synchronize to Debian, manually apply Ubuntu changes.
+  * debian/control: Remove hotplug Recommends, raise udev to Depends.
+  * debian/libgphoto2-2.postinst:
+    - Install udev rules symlink with priority 45.
+    - Remove obsolete /etc/hotplug/usb stuff.
+  * camlibs/ptp2/library.c: Revert Debian's hp850-specific patch, we already
+    have a more generic and more elegant patch.
+  * Tweak packaging/linux-hotplug/print-udev-rules.c to generate more sensible
+    udev rules:
+    - Check for SUBSYSTEM!="usb_device" instead of BUS!="usb".
+    - Instead of calling a hotplug script, just set GROUP="plugdev" and
+      MODE="0660" right away.
+  * Remove obsolete debian/hotplug.
+  * debian/rules: Do not install debian/hotplug script any more.
+  * Add debian/libgphoto2-2.preinst:
+    - Remove obsolete /etc/hotplug/usb/libgphoto2{,.usermap} on upgrade.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Thu,  1 Dec 2005 08:37:40 +0100
+
+libgphoto2 (2.1.6-5.2) unstable; urgency=low
+
+  * Non-Maintainer Upload.
+  * Add /etc/udev/rules.d to libgphoto2-2.dirs (closes: #333678).
+
+ -- Julien BLACHE <jblache@debian.org>  Mon, 17 Oct 2005 18:50:22 +0200
+
+libgphoto2 (2.1.6-5.1) unstable; urgency=low
+
+   * Non-Maintainer Upload.
+   * Derived print-udev-rules from print-usb-usermap to generate the udev
+     rules file.
+   * debian/libgphoto2-2.postinst: call print-udev-rules, create the symlink
+     in /etc/udev/rules.d if needed (closes: #332936).
+   * debian/hotplug: use chown user:group instead of chown user.group.
+   * debian/control: libgphoto2-2 Recommends: udev | hotplug, do not conflict
+     with udev
+
+ -- Julien BLACHE <jblache@debian.org>  Mon, 10 Oct 2005 21:07:25 +0200
+
+libgphoto2 (2.1.6-5) unstable; urgency=low
+
+  * debian/control: conflicts with udev >= 0.070-3 since it would need a
+    linux 2.6.14 to get both working together.  Crappy.  (see: #332936)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun,  9 Oct 2005 19:55:34 +0200
+
+libgphoto2 (2.1.6-4) unstable; urgency=low
+
+  * camlibs/ptp2/library.c: ported (kludgy) patch to work with HP
+    PhotoSmart 850 (as requested by user).
+    Patch from https://bugzilla.ubuntu.com/show_bug.cgi?id=12132
+  * debian/copyright: updated FSF address
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 27 Sep 2005 20:18:31 +0200
+
+libgphoto2 (2.1.6-3) unstable; urgency=low
+
+  * debian/libgphoto2-2.postinst: print-usb-usermap location changed, use the
+    new location. (closes: #321031)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed,  3 Aug 2005 08:48:39 +0200
+
+libgphoto2 (2.1.6-2) unstable; urgency=low
+
+  * Rebuilt against new libexif12
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 27 Jul 2005 17:32:26 +0200
+
+libgphoto2 (2.1.6-1ubuntu6.1) breezy-updates; urgency=low
+
+  * Fix logic error in the check for duplicate file names that break the patch
+    and causes crash on powerpc. (Ubuntu #12132)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 17 Oct 2005 17:53:16 +0200
+
+libgphoto2 (2.1.6-1ubuntu6) breezy; urgency=low
+
+  * camlibs/ptp2/library.c: Check for duplicate filenames to circumvent bugs
+    in cameras like the HP photosmart 850. (Ubuntu #12132)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed, 28 Sep 2005 14:42:16 +0200
+
+libgphoto2 (2.1.6-1ubuntu5) breezy; urgency=low
+
+  * Revert the /etc/hotplug.d/usb conffile moving from 2.1.6-1ubuntu3;
+    /etc/hotplug/usb/ works again, uses the usermap (so that we do not change
+    the permissions of *all* USB devices) and is also coldplugged on boot.
+    (see Ubuntu #16232)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 27 Sep 2005 13:56:19 +0200
+
+libgphoto2 (2.1.6-1ubuntu4) breezy; urgency=low
+
+  * debian/libgphoto2-2.postinst: Create /etc/hotplug/usb if it does not
+    exist.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 13 Sep 2005 22:17:35 +0200
+
+libgphoto2 (2.1.6-1ubuntu3) breezy; urgency=low
+
+  * debian/rules: Install hotplug script in /etc/hotplug.d/usb to make it work
+    again. (Ubuntu #14191)
+  * Add debian/libgphoto2-2.preinst: Transition old hotplug conffile to new
+    location, avoid dpkg questions for unmodified file.
+  * debian/libgphoto2-2.postinst: Fix path in calling print-usb-usermap
+    (Debian #32103)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri,  9 Sep 2005 10:59:26 +0200
+
+libgphoto2 (2.1.6-1ubuntu2) breezy; urgency=low
+
+  * debian/control.in:
+    - updated the libexif-dev Build-Depends to the current version. 
+
+ -- Sebastien Bacher <seb128@canonical.com>  Tue,  2 Aug 2005 19:27:58 +0200
+
+libgphoto2 (2.1.6-1ubuntu1) breezy; urgency=low
+
+  * Sync with Debian.
+    - debian/control.in: don't use type-handling.
+    - debian/hotplug: put devices into the "plugdev" group instead of camera
+    - debian/libgphoto2-2.README.Debian: s/camera/plugdev/
+    - debian/libgphoto2-2.postinst: s/camera/plugdev/
+
+ -- Sebastien Bacher <seb128@canonical.com>  Fri,  8 Jul 2005 13:48:00 +0200
+
+libgphoto2 (2.1.6-1) unstable; urgency=low
+
+  * New upstream release. (closes: #316719)
+    * Removed Debian patches, applied upstream.
+
+ -- Frederic Peters <fpeters@debian.org>  Wed,  6 Jul 2005 10:46:20 +0200
+
+libgphoto2 (2.1.5-6) unstable; urgency=low
+
+  * Fixes issues with PTP, big files and libusb 0.10
+    http://sourceforge.net/tracker/index.php?func=detail&aid=1162373&group_id=8874&atid=108874
+    (closes: #301945)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 15 May 2005 16:00:45 +0200
+
+libgphoto2 (2.1.5-5) unstable; urgency=low
+
+  * Patched to fix FTBFS on kfreebsd-gnu; original patch by Robert Millan.
+    (closes: #297894)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue,  8 Mar 2005 20:49:17 +0100
+
+libgphoto2 (2.1.5-4) unstable; urgency=low
+
+  * Patched sierra driver to work with new libusb package; many thanks to
+    Aurelien Jarno. (closes: #296708)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 27 Feb 2005 20:05:00 +0100
+
+libgphoto2 (2.1.5-3) unstable; urgency=low
+
+  * debian/libgphoto2-2.postinst: overwrite USB usermap on package
+    installation. (closes: #291836)
+  * debian/libgphoto2-2.README.Debian: point user to /etc/hotplug/usb.usermap
+    for local customizations.
+  * debian/control: removed 'The' in front of description synopsis 
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 27 Jan 2005 20:26:21 +0100
+
+libgphoto2 (2.1.5-2) unstable; urgency=low
+
+  * debian/libgphoto2-2.README.Debian: fixed print-usb-usermap command line.
+    (closes: #286829)
+
+ -- Frederic Peters <fpeters@debian.org>  Wed, 22 Dec 2004 16:51:56 +0100
+
+libgphoto2 (2.1.5-1) unstable; urgency=low
+
+  * New upstream release.
+    * Removed Debian patches, applied upstream.
+  * debian/control: added pkg-config to libgphoto2-dev dependencies
+  * debian/libgphoto2-2.README.Debian: added a note about libgphoto2.usermap
+    file not being overwritten on upgrade.
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 21 Dec 2004 16:00:24 +0100
+
+libgphoto2 (2.1.4-10) unstable; urgency=low
+
+  * libgphoto2_port/configure.in: removed syntax error that caused ABOUT-NLS
+    to be executed (and a non-fatal error when running configure) and reran
+    autoconf.  (closes: #284351)
+  * debian/rules: fixed typo (2>&1, not 2>1)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun,  5 Dec 2004 21:23:36 +0100
+
+libgphoto2 (2.1.4-9) unstable; urgency=low
+
+  * debian/canon-ixus-500-ptp.patch: support for Canon Ixus 500 (PTP mode)
+
+ -- Frederic Peters <fpeters@debian.org>  Tue, 19 Oct 2004 11:09:47 +0200
+
+libgphoto2 (2.1.4-8) unstable; urgency=low
+
+  * debian/control: Depends on adduser (for addgroup) (closes: #273432)
+
+ -- Frederic Peters <fpeters@debian.org>  Sun, 26 Sep 2004 08:58:10 +0200
+
+libgphoto2 (2.1.4-7) unstable; urgency=low
+
+  * Adopted package; thanks Christophe for all that maintainership.
+  * Merged Ubuntu patches (group changed from 'plugdev' to 'camera'):
+    * Added hotplug script debian/hotplug and install it; this gives access
+      permissions to 'camera' group members, and does nothing if the group
+      does not exist. (closes: #175073, #272658)
+    * Added libgphoto2-2 postinst which creates USB usermap.
+    * Added libgphoto2-2 postrm which deletes USB usermap on purge.
+    * Updated libgphoto2-2.README.Debian to describe the changes.
+      * Martin Pitt <mpitt@debian.org> did those
+  * debian/control: slighlty reworded some descriptions.
+  * debian/canon-powershot-a75.patch: support for Canon Powershot A75
+    (closes: #260279)
+  * debian/libgphoto2-2.postinst: creates 'camera' group.
+  * debian/rules: keeps linux-hotplug scripts in /usr/share/doc/ but no longer
+    chmod +x them.
+
+ -- Frederic Peters <fpeters@debian.org>  Thu, 23 Sep 2004 11:07:08 +0200
+
+libgphoto2 (2.1.4-6) unstable; urgency=low
+
+  * Rebuilt against libexif10. 
+
+ -- christophe barbe <christophe@debian.org>  Fri, 28 May 2004 16:43:59 -0400
+
+libgphoto2 (2.1.4-5) unstable; urgency=low
+
+  * Make example scripts executable.
+  * Update README.Debian (Closes: #241327).
+
+ -- christophe barbe <christophe@debian.org>  Wed, 31 Mar 2004 20:35:16 -0500
+
+libgphoto2 (2.1.4-4) unstable; urgency=low
+
+  * Added missing libjpeg build dependency (Closes: #234668). 
+
+ -- christophe barbe <christophe@debian.org>  Fri, 27 Feb 2004 13:28:46 -0500
+
+libgphoto2 (2.1.4-3) unstable; urgency=low
+
+  * Dropped xmlto dependency.
+
+ -- christophe barbe <christophe@debian.org>  Mon, 16 Feb 2004 13:42:04 -0500
+
+libgphoto2 (2.1.4-2) unstable; urgency=low
+
+  * Build against newest libusb 0.1.8.
+  * Changed rules to ease debug builds.
+  * Fixed download of large AVI with Canon cams (Closes: #232453)
+    (+ support for Canon MV650i).
+
+ -- christophe barbe <christophe@debian.org>  Sun, 15 Feb 2004 18:50:48 -0500
+
+libgphoto2 (2.1.4-1) unstable; urgency=low
+
+  * New Upstream Release. 
+
+ -- christophe barbe <christophe@debian.org>  Sun, 18 Jan 2004 18:55:12 -0500
+
+libgphoto2 (2.1.3-2) unstable; urgency=low
+
+  * Added missing canon A300 and S50 cameras.
+  * Fixed broken hotplug example script (Closes: #218271).
+  * Updated sq905 driver from CVS HEAD.
+
+ -- christophe barbe <christophe@debian.org>  Sun,  2 Nov 2003 18:08:21 -0500
+
+libgphoto2 (2.1.3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- christophe barbe <christophe@debian.org>  Sun, 26 Oct 2003 17:40:53 -0500
+
+libgphoto2 (2.1.2-5) unstable; urgency=low
+
+  * Fix progress code in the ptp2 driver (Closes: #214164).
+
+ -- christophe barbe <christophe@debian.org>  Tue, 14 Oct 2003 19:32:40 -0400
+
+libgphoto2 (2.1.2-4) unstable; urgency=low
+
+  * Raise priority from extra to optional (Closes: #215459).
+  * Spelling fixes, thanks to Helge Kreutzmann (Closes: #214166).
+  * I will not run update-usb.usermap (intented to be used by the 
+    front-end application) during the post-installation of the library
+    (Closes: #214165).
+
+ -- christophe barbe <christophe@debian.org>  Mon, 13 Oct 2003 17:57:19 -0400
+
+libgphoto2 (2.1.2-3) unstable; urgency=low
+
+  * Fix Canon S45 usb IDs (Closes: #207092).
+
+ -- christophe barbe <christophe@debian.org>  Mon, 13 Oct 2003 17:57:17 -0400
+
+libgphoto2 (2.1.2-2) unstable; urgency=low
+
+  * Workaround m68k bug (free_mem.patch). 
+
+ -- christophe barbe <christophe@debian.org>  Tue, 12 Aug 2003 20:33:46 -0400
+
+libgphoto2 (2.1.2-1) unstable; urgency=low
+
+  * New upstream release. 
+
+ -- christophe barbe <christophe@debian.org>  Mon, 11 Aug 2003 18:03:02 -0400
+
+libgphoto2 (2.1.1-10) unstable; urgency=low
+
+  * Rebuild against libexif9 (Closes: #204184).
+    libgphoto2 2.1.2 is coming RSN.
+
+ -- christophe barbe <christophe@debian.org>  Tue,  5 Aug 2003 07:14:12 -0400
+
+libgphoto2 (2.1.1-9) unstable; urgency=low
+
+  * Compiled without libltld3 to make digikam stable (Closes: 185989).
+  * Updated to Debian Policy Standards-Version 3.5.9 (no change).
+
+ -- christophe barbe <christophe@debian.org>  Tue,  5 Aug 2003 07:14:09 -0400
+
+libgphoto2 (2.1.1-8) unstable; urgency=low
+
+  * Install libgphoto2-port0 AUTHORS in the correct directory 
+    (Closes: #180774). 
+
+ -- christophe barbe <christophe@debian.org>  Wed, 12 Feb 2003 13:40:11 -0500
+
+libgphoto2 (2.1.1-7) unstable; urgency=low
+
+  * Fix Kodak LS443 USB id (Closes: #180202). 
+
+ -- christophe barbe <christophe@debian.org>  Mon, 10 Feb 2003 18:24:24 -0500
+
+libgphoto2 (2.1.1-6) unstable; urgency=low
+
+  * No more need of gtk-doc-tools. 
+
+ -- christophe barbe <christophe@debian.org>  Wed, 22 Jan 2003 20:38:18 -0500
+
+libgphoto2 (2.1.1-5) unstable; urgency=low
+
+  * Make sure libgphoto2 and gphoto2 use the same libexif. 
+
+ -- christophe barbe <christophe@debian.org>  Wed, 22 Jan 2003 15:24:04 -0500
+
+libgphoto2 (2.1.1-4) unstable; urgency=low
+
+  * Rebuild against new libexif. 
+
+ -- christophe barbe <christophe@debian.org>  Mon, 20 Jan 2003 17:15:21 -0500
+
+libgphoto2 (2.1.1-3) unstable; urgency=low
+
+  * Add missing dependency libexif-dev (Closes: #174229).
+  * Fix path in README file (Closes: #172569). 
+
+ -- christophe barbe <christophe@debian.org>  Tue, 24 Dec 2002 22:46:46 -0500
+
+libgphoto2 (2.1.1-2) unstable; urgency=low
+
+  * Added a versioned dependency on libltdl3 (>= 1.4.3) so that impatient
+    testing users get a working package (Closes: #171934).
+    NOTE: This is a libltdl3 bug, see bug #171843.
+
+ -- christophe barbe <christophe@debian.org>  Thu,  5 Dec 2002 23:15:15 -0500
+
+libgphoto2 (2.1.1-1) unstable; urgency=low
+
+  * New Upstream release.
+
+ -- christophe barbe <christophe@debian.org>  Sun,  1 Dec 2002 18:38:22 -0500
+
+libgphoto2 (2.1.0.99-1) unstable; urgency=low
+
+  * First upload (Closes: #170809). 
+
+ -- christophe barbe <christophe@debian.org>  Tue, 26 Nov 2002 17:03:45 -0500
+
--- libgphoto2-2.4.0.orig/debian/libgphoto2-2.postrm
+++ libgphoto2-2.4.0/debian/libgphoto2-2.postrm
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+PACKAGE="libgphoto2"
+
+set -e
+
+case "$1" in
+    remove|purge)
+	rm -f /etc/hotplug/usb/$PACKAGE.usermap
+	rm -f /usr/share/hal/fdi/information/20thirdparty/$PACKAGE.fdi || /bin/true
+	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE.fdi || /bin/true
+	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE-device.fdi || /bin/true
+	rm -f /usr/share/hal/fdi/preprobe/10osvendor/20-$PACKAGE.fdi || /bin/true
+	;;
+    disappear|upgrade|failed-upgrade|abort-install|abort-upgrade)
+	;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+esac
+
+#DEBHELPER#
+
+exit 0
--- libgphoto2-2.4.0.orig/debian/compat
+++ libgphoto2-2.4.0/debian/compat
@@ -0,0 +1 @@
+5
--- libgphoto2-2.4.0.orig/debian/patches/00svn-ptp2-ids.dpatch
+++ libgphoto2-2.4.0/debian/patches/00svn-ptp2-ids.dpatch
@@ -0,0 +1,299 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 00svn-ptp2-ids.patch.dpatch by  <martin.pitt@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Update PTP2 library ID list to latest SVN
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/camlibs/ptp2/library.c libgphoto2-2.4.0/camlibs/ptp2/library.c
+--- libgphoto2-2.4.0~/camlibs/ptp2/library.c	2007-07-27 02:35:37.000000000 +0200
++++ libgphoto2-2.4.0/camlibs/ptp2/library.c	2008-03-12 11:32:22.000000000 +0100
+@@ -316,6 +316,8 @@
+ 	{"Kodak:Z612",   0x040a, 0x059d, 0},
+ 	/* David D. Huff Jr. <David.Huff@computer-critters.com> */
+ 	{"Kodak:Z650",   0x040a, 0x059e, 0},
++	/* Sonja Krause-Harder */
++	{"Kodak:M753",   0x040a, 0x059f, 0},
+ 	/* irc reporter */
+ 	{"Kodak:V603",   0x040a, 0x05a0, 0},
+ 	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1547142&group_id=8874&atid=358874 */
+@@ -330,18 +332,24 @@
+ 	{"Kodak:V705",   0x040a, 0x05ab, 0},
+ 	/* https://launchpad.net/bugs/67532 */
+ 	{"Kodak:V610",   0x040a, 0x05ac, 0},
++	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1861193&group_id=8874&atid=358874 */
++	{"Kodak:M883",   0x040a, 0x05ad, 0},
+ 	/* from Thomas <tomtechguy@gmail.com> */
+ 	{"Kodak:C743",   0x040a, 0x05ae, 0},
+ 	/* via IRC */
+ 	{"Kodak:C653",   0x040a, 0x05af, 0},
+ 	/* Nicolas Brodu <nicolas.brodu@free.fr> */
+ 	{"Kodak:Z712 IS",0x040a, 0x05b4, 0},
++	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1904224&group_id=8874&atid=358874 */
++	{"Kodak:Z812 IS",0x040a, 0x05b5, 0},
+ 	/* */
+ 	{"Kodak:C613",   0x040a, 0x05b7, 0},
+ 	/* via IRC */
+ 	{"Kodak:C633",   0x040a, 0x05ba, 0},
+ 
+ 	/* HP PTP cameras */
++	/* found in random web forum */
++	{"HP:PhotoSmart M407 (PTP mode)", 0x03f0, 0x4002, 0},
+ 	{"HP:PhotoSmart 812 (PTP mode)", 0x03f0, 0x4202, 0},
+ 	{"HP:PhotoSmart 850 (PTP mode)", 0x03f0, 0x4302, PTPBUG_DUPE_FILE},
+ 	/* HP PhotoSmart 935: T. Kaproncai, 25 Jul 2003*/
+@@ -392,6 +400,12 @@
+ 	{"HP:PhotoSmart E327 (PTP mode)", 0x03f0, 0x8b02, 0},
+ 	/* https://sourceforge.net/tracker/?func=detail&atid=358874&aid=1589879&group_id=8874  */
+ 	{"HP:PhotoSmart E427 (PTP mode)", 0x03f0, 0x8c02, 0},
++	/* Martin Laberge <mlsoft@videotron.ca> */
++	{"HP:PhotoSmart M737 (PTP mode)", 0x03f0, 0x9602, 0},
++	/* https://bugs.launchpad.net/bugs/178916 */
++	{"HP:PhotoSmart R742 (PTP mode)", 0x03f0, 0x9702, 0},
++	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1814147&group_id=8874&atid=358874 */
++	{"HP:PhotoSmart M547 (PTP mode)", 0x03f0, 0x9b02, 0},
+ 
+ 	/* Most Sony PTP cameras use the same product/vendor IDs. */
+ 	{"Sony:PTP",                  0x054c, 0x004e, 0},
+@@ -434,6 +448,7 @@
+ 	{"Sony:DSC-W1 (PTP mode)",    0x054c, 0x004e, 0},
+ 	{"Sony:DSC-W12 (PTP mode)",   0x054c, 0x004e, 0},
+ 	{"Sony:DSC-W35 (PTP mode)",   0x054c, 0x004e, 0},
++	{"Sony:DSC-W55 (PTP mode)",   0x054c, 0x004e, 0},
+ 	{"Sony:MVC-CD300 (PTP mode)", 0x054c, 0x004e, 0},
+ 	{"Sony:MVC-CD500 (PTP mode)", 0x054c, 0x004e, 0},
+ 	{"Sony:DSC-U10 (PTP mode)",   0x054c, 0x004e, 0},
+@@ -471,20 +486,29 @@
+ 	/* Nikon Coolpix SQ: M. Holzbauer, 07 Jul 2003 */
+ 	{"Nikon:Coolpix 4100 (PTP mode)", 0x04b0, 0x012d, 0},
+ 	/* Nikon Coolpix 5600: Andy Shevchenko, 11 Aug 2005 */
+-	{"Nikon:Coolpix 5600 (PTP mode)", 0x04b0, 0x012e, PTP_CAP},
++	{"Nikon:Coolpix 5600 (PTP mode)", 0x04b0, 0x012e, PTP_CAP|PTP_NIKON_BROKEN_CAP},
+ 	/* 4600: Martin Klaffenboeck <martin.klaffenboeck@gmx.at> */
+ 	{"Nikon:Coolpix 4600 (PTP mode)", 0x04b0, 0x0130, 0},
+ 	/* 4600: Roberto Costa <roberto.costa@ensta.org>, 22 Oct 2006 */
+ 	{"Nikon:Coolpix 4600a (PTP mode)", 0x04b0, 0x0131, 0},
+-	{"Nikon:Coolpix 5900 (PTP mode)", 0x04b0, 0x0135, PTP_CAP},
+-	{"Nikon:Coolpix P1 (PTP mode)",   0x04b0, 0x0140, PTP_CAP},
++	{"Nikon:Coolpix 5900 (PTP mode)", 0x04b0, 0x0135, PTP_CAP|PTP_NIKON_BROKEN_CAP},
++	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1846012&group_id=8874&atid=358874 */
++	{"Nikon:Coolpix 7900 (PTP mode)", 0x04b0, 0x0137, PTP_CAP|PTP_NIKON_BROKEN_CAP},
++	{"Nikon:Coolpix P1 (PTP mode)",   0x04b0, 0x0140, PTP_CAP|PTP_NIKON_BROKEN_CAP},
+ 	/* Marcus Meissner */
+-	{"Nikon:Coolpix P2 (PTP mode)",   0x04b0, 0x0142, PTP_CAP},
++	{"Nikon:Coolpix P2 (PTP mode)",   0x04b0, 0x0142, PTP_CAP|PTP_NIKON_BROKEN_CAP},
+ 	/* Richard SCHNEIDER <Richard.SCHNEIDER@tilak.at> */
+ 	{"Nikon:Coolpix S4 (PTP mode)",   0x04b0, 0x0144, 0},
+ 	/* Lowe, John Michael <jomlowe@iupui.edu> */
+ 	{"Nikon:Coolpix S2 (PTP mode)",   0x04b0, 0x014e, 0},
+ 	{"Nikon:Coolpix S6 (PTP mode)",   0x04b0, 0x014e, 0},
++	/* Ole Aamot <ole@gnome.org> */
++	{"Nikon:Coolpix P5000 (PTP mode)",0x04b0, 0x015b, PTP_CAP|PTP_NIKON_BROKEN_CAP},
++	/* Peter Pregler <Peter_Pregler@email.com> */
++	{"Nikon:Coolpix S500 (PTP mode)", 0x04b0, 0x015d, 0},
++	{"Nikon:Coolpix L12 (PTP mode)",  0x04b0, 0x015f, 0},
++	/* Marius Groeger <marius.groeger@web.de> */
++	{"Nikon:Coolpix S200 (PTP mode)", 0x04b0, 0x0161, PTP_CAP|PTP_NIKON_BROKEN_CAP},
+ 	{"Nikon:Coolpix SQ (PTP mode)",   0x04b0, 0x0202, 0},
+ 	/* lars marowski bree, 16.8.2004 */
+ 	{"Nikon:Coolpix 4200 (PTP mode)", 0x04b0, 0x0204, 0},
+@@ -495,9 +519,10 @@
+ 	{"Nikon:Coolpix P4 (PTP mode)",   0x04b0, 0x020c, 0},
+ 	/* Nikon Coolpix 2000 */
+ 	{"Nikon:Coolpix 2000 (PTP mode)", 0x04b0, 0x0302, 0},
+-
+ 	/* From IRC reporter. */
+ 	{"Nikon:Coolpix L4 (PTP mode)",   0x04b0, 0x0305, 0},
++	/* from Magnus Larsson */
++	{"Nikon:Coolpix L11 (PTP mode)",  0x04b0, 0x0309, 0},
+ 	/* From IRC reporter. */
+ 	{"Nikon:Coolpix L10 (PTP mode)",  0x04b0, 0x030b, 0},
+ 	/* Nikon D100 has a PTP mode: westin 2002.10.16 */
+@@ -505,13 +530,10 @@
+ 	/* D2H SLR in PTP mode from Steve Drew <stevedrew@gmail.com> */
+ 	{"Nikon:D2H SLR (PTP mode)",      0x04b0, 0x0404, 0},
+ 	{"Nikon:DSC D70 (PTP mode)",      0x04b0, 0x0406, PTP_CAP},
+-
+ 	/* Justin Case <justin_case@gmx.net> */
+ 	{"Nikon:D2X SLR (PTP mode)",      0x04b0, 0x0408, PTP_CAP},
+-
+ 	/* Niclas Gustafsson (nulleman @ sf) */
+ 	{"Nikon:D50 (PTP mode)",          0x04b0, 0x040a, PTP_CAP},
+-
+ 	{"Nikon:DSC D70s (PTP mode)",     0x04b0, 0x040e, PTP_CAP},
+ 	/* Jana Jaeger <jjaeger.suse.de> */
+ 	{"Nikon:DSC D200 (PTP mode)",     0x04b0, 0x0410, PTP_CAP},
+@@ -519,12 +541,18 @@
+ 	{"Nikon:DSC D80 (PTP mode)",      0x04b0, 0x0412, PTP_CAP},
+ 	/* Huy Hoang <hoang027@umn.edu> */
+ 	{"Nikon:DSC D40 (PTP mode)",      0x04b0, 0x0414, PTP_CAP},
+-
++	/* Luca Gervasi <luca.gervasi@gmail.com> */
++	{"Nikon:DSC D40x (PTP mode)",     0x04b0, 0x0418, PTP_CAP},
++	/* Andreas Jaeger <aj@suse.de> */
++	{"Nikon:DSC D300 (PTP mode)",	  0x04b0, 0x041a, PTP_CAP},
+ 	/* Sridharan Rengaswamy <sridhar@stsci.edu>, Coolpix L3 */
+ 	{"Nikon:Coolpix L3 (PTP mode)",   0x04b0, 0x041a, 0},
+ 
+ 	/* Thomas Luzat <thomas.luzat@gmx.net> */
++	/* this was reported as not working, mass storage only:
++	 * http://sourceforge.net/tracker/index.php?func=detail&aid=1847471&group_id=8874&atid=108874
+ 	{"Panasonic:DMC-FZ20 (alternate id)", 0x04da, 0x2372, 0},
++	*/
+ 	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1350226&group_id=8874&atid=208874 */
+ 	{"Panasonic:DMC-LZ2",             0x04da, 0x2372, 0},
+ 	/* https://sourceforge.net/tracker/index.php?func=detail&aid=1405541&group_id=8874&atid=358874 */
+@@ -537,6 +565,7 @@
+ 	{"Panasonic:Lumix FZ5",           0x04da, 0x2372, 0},
+ 
+ 	{"Panasonic:DMC-FZ20",            0x04da, 0x2374, 0},
++	{"Panasonic:DMC-FZ50",            0x04da, 0x2374, 0},
+ 	/* from Tomas Herrdin <tomas.herrdin@swipnet.se> */
+ 	{"Panasonic:DMC-LS3",             0x04da, 0x2374, 0},
+ 
+@@ -559,6 +588,8 @@
+ 
+ 	/* IRC report */
+ 	{"Casio:EX-Z120",                 0x07cf, 0x1042, 0},
++	/* Andrej Semen (at suse) */
++	{"Casio:EX-S770",                 0x07cf, 0x1049, 0},
+ 	/* https://launchpad.net/bugs/64146 */
+ 	{"Casio:EX-Z700",                 0x07cf, 0x104c, 0},
+ 
+@@ -585,6 +616,7 @@
+ 	{"Canon:PowerShot S50 (PTP mode)",      0x04a9, 0x3077, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:PowerShot G5 (PTP mode)",       0x04a9, 0x3085, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:Elura 50 (PTP mode)",           0x04a9, 0x3087, PTPBUG_DELETE_SENDS_EVENT},
++	{"Canon:MVX3i (PTP mode)",              0x04a9, 0x308d, PTPBUG_DELETE_SENDS_EVENT},
+ 		/* 0x3084 is the EOS 300D/Digital Rebel in normal (canon) mode */
+ 	{"Canon:EOS 300D (PTP mode)",           0x04a9, 0x3099, PTPBUG_DCIM_WRONG_PARENT},
+ 	{"Canon:EOS Digital Rebel (PTP mode)",  0x04a9, 0x3099, PTPBUG_DCIM_WRONG_PARENT},
+@@ -629,6 +661,8 @@
+ 	{"Canon:Digital IXUS Wireless (PTP mode)",0x04a9, 0x30f1, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW},
+ 	{"Canon:Digital IXUS 700 (PTP mode)",   0x04a9, 0x30f2, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:PowerShot SD500 (PTP mode)",    0x04a9, 0x30f2, PTPBUG_DELETE_SENDS_EVENT},
++	/* reported by Gilles Dartiguelongue <dartigug@esiee.fr> */
++	{"Canon:Digital IXUS iZ (PTP mode)",    0x04a9, 0x30f4, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* A340, Andreas Stempfhuber <andi@afulinux.de> */
+ 	{"Canon:PowerShot A430 (PTP mode)",     0x04a9, 0x30f8, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* Conan Colx, A410, gphoto-Feature Requests-1342538 */
+@@ -643,8 +677,8 @@
+ 	{"Canon:PowerShot SD630 (PTP mode)",	0x04a9, 0x30fe, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:Digital IXUS 65 (PTP mode)",	0x04a9, 0x30fe, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* Rob Lensen <rob@bsdfreaks.nl> */
+-	{"Canon:Digital IXUS 55 (PTP mode)",    0x04a9, 0x30ff, PTPBUG_DELETE_SENDS_EVENT},
+-	{"Canon:PowerShot SD450 (PTP mode)",    0x04a9, 0x30ff, PTPBUG_DELETE_SENDS_EVENT},
++	{"Canon:Digital IXUS 55 (PTP mode)",    0x04a9, 0x30ff, 0},
++	{"Canon:PowerShot SD450 (PTP mode)",    0x04a9, 0x30ff, 0},
+  	{"Canon:Optura 600 (PTP mode)",         0x04a9, 0x3105, 0},
+ 	/* Jeff Mock <jeff@mock.com> */
+  	{"Canon:EOS 5D (PTP mode)",             0x04a9, 0x3102, PTPBUG_DCIM_WRONG_PARENT},
+@@ -665,7 +699,7 @@
+ 	{"Canon:PowerShot SD700 (PTP mode)",    0x04a9, 0x3119, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:Digital IXUS 800 (PTP mode)",   0x04a9, 0x3119, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* Gert Vervoort <gert.vervoort@hccnet.nl> */
+-	{"Canon:PowerShot S3 IS (PTP mode)",    0x04a9, 0x311a, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW},
++	{"Canon:PowerShot S3 IS (PTP mode)",    0x04a9, 0x311a, PTP_CAP|PTP_CAP_PREVIEW},
+ 	/* David Goodenough <david.goodenough at linkchoose.co.uk> */
+ 	{"Canon:PowerShot A540 (PTP mode)",     0x04a9, 0x311b, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* Irc reporter */
+@@ -683,7 +717,13 @@
+ 	{"Canon:PowerShot A710 IS (PTP mode)",  0x04a9, 0x3138, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:PowerShot A640 (PTP mode)",     0x04a9, 0x3139, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW},
+ 	{"Canon:PowerShot A630 (PTP mode)",     0x04a9, 0x313a, PTPBUG_DELETE_SENDS_EVENT},
++	/* reported by Ferry Huberts */
++	{"Canon:EOS 40D (PTP mode)",    	0x04a9, 0x3146, 0}, /* user had it working without problem */
+ 	{"Canon:PowerShot S5 IS (PTP mode)",    0x04a9, 0x3148, PTP_CAP|PTP_CAP_PREVIEW},
++	/* AlannY <alanny@starlink.ru> */
++	{"Canon:PowerShot A460 (PTP mode)",	0x04a9, 0x3149, PTP_CAP|PTP_CAP_PREVIEW},
++	/* Tobias Blaser <tblaser@gmx.ch> */
++	{"Canon:Digital IXUS 950 IS (PTP mode)",0x04a9, 0x314b, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:PowerShot A570 IS (PTP mode)",  0x04a9, 0x314c, PTPBUG_DELETE_SENDS_EVENT},
+ 	{"Canon:PowerShot A560 (PTP mode)",  0x04a9, 0x314d, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* mailreport from sec@dschroeder.info */
+@@ -694,7 +734,16 @@
+ 	{"Canon:PowerShot A550 (PTP mode)",     0x04a9, 0x3150, PTPBUG_DELETE_SENDS_EVENT},
+ 	/* https://launchpad.net/bugs/64146 */
+ 	{"Canon:PowerShot A450 (PTP mode)",     0x04a9, 0x3155, PTPBUG_DELETE_SENDS_EVENT},
+-
++	/* Harald Dunkel <harald.dunkel@t-online.de> */                                                        
++	{"Canon:PowerShot G9 (PTP mode)",       0x04a9, 0x315a, PTPBUG_DELETE_SENDS_EVENT},
++	/* Roger Lynn <roger@rilynn.demon.co.uk> */
++	{"Canon:PowerShot A720 IS (PTP mode)",	0x04a9, 0x315d, PTPBUG_DELETE_SENDS_EVENT},
++	/* Mats Petersson <mats.petersson@ltu.se> */
++	{"Canon:Powershot SX100 IS (PTP mode)",	0x04a9, 0x315e, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW},
++	/* Ruben Vandamme <vandamme.ruben@belgacom.net> */
++	{"Canon:Digital IXUS 860 IS",		0x04a9, 0x3160, PTPBUG_DELETE_SENDS_EVENT},
++	/* https://sourceforge.net/tracker/?func=detail&atid=358874&aid=1910010&group_id=8874 */
++	{"Canon:Digital IXUS 80 IS",		0x04a9, 0x3184, PTPBUG_DELETE_SENDS_EVENT},
+ 
+ 
+ 	/* Konica-Minolta PTP cameras */
+@@ -702,6 +751,7 @@
+ 	{"Konica-Minolta:DiMAGE Z2 (PictBridge mode)", 0x132b, 0x0007, 0},
+ 	{"Konica-Minolta:DiMAGE X21 (PictBridge mode)",0x132b, 0x0009, 0},
+ 	{"Konica-Minolta:DiMAGE Z3 (PictBridge mode)", 0x132b, 0x0018, 0},
++	{"Konica-Minolta:DiMAGE A200 (PictBridge mode)",0x132b, 0x0019, 0},
+ 	{"Konica-Minolta:DiMAGE Z5 (PictBridge mode)", 0x132b, 0x0022, 0},
+ 
+ 	/* Fuji PTP cameras */
+@@ -717,11 +767,23 @@
+ 	{"Fuji:FinePix F20",			0x04cb, 0x01c0, 0},
+ 	/* launchpad 67532 */
+ 	{"Fuji:FinePix F31fd",			0x04cb, 0x01c1, 0},
+-	{"Fuji:FinePix F40fd", 0x04cb, 0x01c5, 0},
++	{"Fuji:FinePix S5700",			0x04cb, 0x01c4, 0},
++	{"Fuji:FinePix F40fd",			0x04cb, 0x01c5, 0},
++	/* http://sourceforge.net/tracker/index.php?func=detail&aid=1800289&group_id=8874&atid=358874 */
++	{"Fuji:FinePix A820",			0x04cb, 0x01c6, 0},
++	/* g4@catking.net */
++	{"Fuji:FinePix A800",			0x04cb, 0x01d2, 0},
++	/* Teppo Jalava <tjjalava@gmail.com> */
++	{"Fuji:FinePix F50fd",			0x04cb, 0x01d4, 0},
+ 
++	{"Ricoh:Caplio R5 (PTP mode)",          0x05ca, 0x0110, 0},
+ 	{"Ricoh:Caplio GX (PTP mode)",          0x05ca, 0x0325, 0},
++	{"Sea & Sea:5000G (PTP mode)",		0x05ca, 0x0327, 0},
++	/* Michael Steinhauser <mistr@online.de> */
++	{"Ricoh Caplio:R1v (PTP mode)",		0x05ca, 0x032b, 0},
+ 	{"Ricoh:Caplio R3 (PTP mode)",          0x05ca, 0x032f, 0},
+-	{"Ricoh:Caplio R5 (PTP mode)",          0x05ca, 0x0110, 0},
++	/* Arthur Butler <arthurbutler@otters.ndo.co.uk> */
++	{"Ricoh:Caplio RR750 (PTP mode)",	0x05ca, 0x033d, 0},
+ 
+ 	/* Rollei dr5  */
+ 	{"Rollei:dr5 (PTP mode)",               0x05ca, 0x220f, 0},
+@@ -1721,10 +1783,13 @@
+ 	 */
+ 
+ 	/* The Nikon way: Does not send AddObject event ... so try else */
+-	if (params->deviceinfo.VendorExtensionID==PTP_VENDOR_NIKON) {
++        if (params->deviceinfo.VendorExtensionID==PTP_VENDOR_NIKON&&
++            NIKON_BROKEN_CAP(camera->pl)) {
+ 		PTPObjectHandles	handles;
+ 		int tries = 5;
+ 
++		GP_DEBUG("PTPBUG_NIKON_BROKEN_CAPTURE bug workaround");
++
+ 		while (tries--) {
+ 			int i;
+ 			uint16_t ret = ptp_getobjecthandles (params, 0xffffffff, 0x000000, 0x000000, &handles);
+diff -urNad libgphoto2-2.4.0~/camlibs/ptp2/ptp-bugs.h libgphoto2-2.4.0/camlibs/ptp2/ptp-bugs.h
+--- libgphoto2-2.4.0~/camlibs/ptp2/ptp-bugs.h	2007-07-27 02:35:37.000000000 +0200
++++ libgphoto2-2.4.0/camlibs/ptp2/ptp-bugs.h	2008-03-12 11:33:37.000000000 +0100
+@@ -30,6 +30,7 @@
+ #define PTP_CAP				(1<<4)
+ #define PTP_CAP_PREVIEW			(1<<5)
+ #define PTP_MTP_PROPLIST_WORKS		(1<<6)
++#define PTP_NIKON_BROKEN_CAP            (1<<7)
+ 
+ #define DCIM_WRONG_PARENT_BUG(x) \
+   ((x)->bugs & PTPBUG_DCIM_WRONG_PARENT)
+@@ -37,5 +38,6 @@
+   ((x)->bugs & PTPBUG_DELETE_SENDS_EVENT)
+ #define CAN_HAVE_DUPE_FILE(x) \
+   ((x)->bugs & (PTPBUG_DUPE_FILE | PTP_MTP))
+-
++#define NIKON_BROKEN_CAP(x) \
++  ((x)->bugs & (PTP_NIKON_BROKEN_CAP))
+ #endif
--- libgphoto2-2.4.0.orig/debian/patches/50_getenv_home_overflow.dpatch
+++ libgphoto2-2.4.0/debian/patches/50_getenv_home_overflow.dpatch
@@ -0,0 +1,44 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_getenv_home_overflow.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: don't copy more characters from $HOME than possible in buffer
+## DP: (applied upstream as revision #10453)
+
+@DPATCH@
+diff -urNad libgphoto2-2.3.1~/libgphoto2/gphoto2-setting.c libgphoto2-2.3.1/libgphoto2/gphoto2-setting.c
+--- libgphoto2-2.3.1~/libgphoto2/gphoto2-setting.c	2007/07/20 13:45:00	10452
++++ libgphoto2-2.3.1/libgphoto2/gphoto2-setting.c	2007/07/20 17:01:57	10453
+@@ -172,19 +172,19 @@
+ 	/* Make sure the directories are created */
+ 	GP_DEBUG ("Creating $HOME/.gphoto");
+ #ifdef WIN32
+-	GetWindowsDirectory (buf, 1024);
++	GetWindowsDirectory (buf, sizeof(buf));
+ 	strcat (buf, "\\gphoto");
+ #else
+-	sprintf (buf, "%s/.gphoto", getenv ("HOME"));
++	snprintf (buf, sizeof(buf), "%s/.gphoto", getenv ("HOME"));
+ #endif
+ 	(void)gp_system_mkdir (buf);
+ 
+ 	glob_setting_count = 0;
+ #ifdef WIN32
+-	GetWindowsDirectory(buf, 1024);
++	GetWindowsDirectory(buf, sizeof(buf));
+ 	strcat(buf, "\\gphoto\\settings");
+ #else
+-	sprintf(buf, "%s/.gphoto/settings", getenv("HOME"));
++	snprintf(buf, sizeof(buf), "%s/.gphoto/settings", getenv("HOME"));
+ #endif
+ 
+ 	if (verify_settings(buf) != GP_OK)
+@@ -226,7 +226,7 @@
+ 	char buf[1024];
+ 	int x=0;
+ 
+-	sprintf (buf, "%s/.gphoto/settings", getenv ("HOME"));
++	snprintf (buf, 1024, "%s/.gphoto/settings", getenv ("HOME"));
+ 
+ 	gp_log (GP_LOG_DEBUG, "gphoto2-setting",
+ 		"Saving %i setting(s) to file \"%s\"",
--- libgphoto2-2.4.0.orig/debian/patches/11_hurd_no_path_max_bsdsource.dpatch
+++ libgphoto2-2.4.0/debian/patches/11_hurd_no_path_max_bsdsource.dpatch
@@ -0,0 +1,56 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11_hurd_no_path_max_bsdsource.dpatch by Samuel Thibault
+## <samuel.thibault@ens-lyon.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Hurd has no such hard limit like PATH_MAX, and define _BSD_SOURCE
+## DP: because code uses IXANY and O_NDELAY.
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/camlibs/digita/digita.c libgphoto2-2.4.0/camlibs/digita/digita.c
+--- libgphoto2-2.4.0~/camlibs/digita/digita.c	2007-07-27 02:35:51.000000000 +0200
++++ libgphoto2-2.4.0/camlibs/digita/digita.c	2007-08-15 00:08:35.993573985 +0200
+@@ -138,7 +138,6 @@
+ 	/* Walk through all of the pictures building a list of folders */
+ 	for (i = 0; i < camera->pl->num_pictures; i++) {
+ 		int found;
+-		char tmppath[PATH_MAX + 1];
+ 		char *path;
+ 
+ 		/* Check to make sure the path matches the folder we're */
+@@ -159,22 +158,19 @@
+ 		if (strchr(path, '/') != path + strlen(path) - 1)
+ 			continue;
+ 
+-		strncpy(tmppath, path, MIN(strlen(path) - 1, PATH_MAX));
+-		tmppath[strlen(path) - 1] = 0;
+-
+ 		found = 0;
+ 		for (i1 = 0; i1 < gp_list_count(list); i1++) {
+ 			const char *name;
+ 
+ 			gp_list_get_name(list, i1, &name);
+-			if (!strcmp(name, tmppath)) {
++			if (!strcmp(name, path)) {
+ 				found = 1;
+ 				break;
+ 			}
+ 		}
+ 
+ 		if (!found)
+-			gp_list_append(list, tmppath, NULL);
++			gp_list_append(list, path, NULL);
+ 	}
+ 
+ 	return GP_OK;
+diff -urNad libgphoto2-2.4.0~/libgphoto2_port/serial/unix.c libgphoto2-2.4.0/libgphoto2_port/serial/unix.c
+--- libgphoto2-2.4.0~/libgphoto2_port/serial/unix.c	2007-07-27 02:36:13.000000000 +0200
++++ libgphoto2-2.4.0/libgphoto2_port/serial/unix.c	2007-08-15 00:08:58.494856260 +0200
+@@ -27,6 +27,7 @@
+  * Boston, MA 02111-1307, USA.
+  */
+ 
++#define _BSD_SOURCE
+ #include "config.h"
+ #include <gphoto2/gphoto2-port-library.h>
+ 
--- libgphoto2-2.4.0.orig/debian/patches/65_udev_usb_subsystem.dpatch
+++ libgphoto2-2.4.0/debian/patches/65_udev_usb_subsystem.dpatch
@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 65_udev_usb_subsystem.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/packaging/generic/print-camera-list.c libgphoto2-2.4.0/packaging/generic/print-camera-list.c
+--- libgphoto2-2.4.0~/packaging/generic/print-camera-list.c	2007-10-09 17:07:54.136056850 +0200
++++ libgphoto2-2.4.0/packaging/generic/print-camera-list.c	2007-10-09 17:12:04.150304350 +0200
+@@ -444,8 +444,11 @@
+ 		"BUS!=\"usb_device\", GOTO=\"libgphoto2_rules_end\"\n"
+ 		"ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n",
+ 		/* UDEV_0_98 */
+-		"SUBSYSTEM!=\"usb_device\", GOTO=\"libgphoto2_rules_end\"\n"
+-		"ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"
++		"ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"
++		"SUBSYSTEM==\"usb_device\", GOTO=\"libgphoto2_rules_start\"\n"
++		"SUBSYSTEM!=\"usb\", GOTO=\"libgphoto2_rules_end\"\n"
++		"LABEL=\"libgphoto2_rules_start\"\n"
++		"\n"
+ 	};
+ 	static char *usbcam_strings[] = {
+ 		/* UDEV_PRE_0_98 */
--- libgphoto2-2.4.0.orig/debian/patches/40_disable_canon_fast_directory_retrieval_r10028.dpatch
+++ libgphoto2-2.4.0/debian/patches/40_disable_canon_fast_directory_retrieval_r10028.dpatch
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40_disable_canon_fast_directory_retrieval_r10028.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad libgphoto2-2.3.1~/camlibs/ptp2/library.c libgphoto2-2.3.1/camlibs/ptp2/library.c
+--- libgphoto2-2.3.1~/camlibs/ptp2/library.c	2007-05-07 10:07:33.559480640 +0200
++++ libgphoto2-2.3.1/camlibs/ptp2/library.c	2007-05-07 10:14:14.582333630 +0200
+@@ -3437,7 +3437,11 @@
+ 		return PTP_RC_OK;
+ 	}
+ 
++#if 0
+ 	/* CANON also has fast directory retrieval. And it is mostly complete, so we can use it as full replacement */
++	/* Unfortunately this fails on the PowerShot A430. 
++	 * And I don't want to whitelist everyone, because I just don't own all of them.
++	 * *sigh* -Marcus */
+ 	if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) &&
+ 	    ptp_operation_issupported(params,PTP_OC_CANON_GetDirectory))
+ 
+@@ -3453,6 +3457,7 @@
+ 		}
+ 		/* fallthrough */
+ 	}
++#endif
+ 
+ fallback:
+ 	/* Get file handles array for filesystem */
--- libgphoto2-2.4.0.orig/debian/patches/70_increase_max_entries.dpatch
+++ libgphoto2-2.4.0/debian/patches/70_increase_max_entries.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 70_increase_max_entries.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/libgphoto2/gphoto2-list.c libgphoto2-2.4.0/libgphoto2/gphoto2-list.c
+--- libgphoto2-2.4.0~/libgphoto2/gphoto2-list.c	2007-07-27 02:35:31.000000000 +0200
++++ libgphoto2-2.4.0/libgphoto2/gphoto2-list.c	2007-09-28 20:09:31.392540127 +0200
+@@ -72,7 +72,7 @@
+ 
+ #ifdef CAMERALIST_STRUCT_COMPATIBILITY
+ 
+-#define MAX_ENTRIES 1024
++#define MAX_ENTRIES 8192
+ #define MAX_LIST_STRING_LENGTH 128
+ struct _CameraList {
+ 	int  count;
--- libgphoto2-2.4.0.orig/debian/patches/73_use_ptp_for_some_canon.dpatch
+++ libgphoto2-2.4.0/debian/patches/73_use_ptp_for_some_canon.dpatch
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 73_use_ptp_for_some_canon.dpatch by  <james.westby@canonical.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Use PTP mode for some Canon cameras, cherry-picked from upstream
+## DP: http://gphoto.svn.sourceforge.net/viewvc/gphoto/trunk/libgphoto2/camlibs/canon/canon.c?view=diff&r1=10622&r2=10623
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/camlibs/canon/canon.c libgphoto2-2.4.0/camlibs/canon/canon.c
+--- libgphoto2-2.4.0~/camlibs/canon/canon.c	2007-07-27 01:35:50.000000000 +0100
++++ libgphoto2-2.4.0/camlibs/canon/canon.c	2008-05-10 01:17:55.000000000 +0100
+@@ -286,9 +286,11 @@
+ 
+         /* 0x30bf is PowerShot SD300/Digital IXUS 40 in PTP mode */
+         /* Another block of cameras that share the ID for PTP and Canon modes */
++#if 0 /* in ptp driver due to hangs :( */
+         {"Canon:PowerShot SD200 (normal mode)", CANON_CLASS_6,  0x04A9, 0x30c0, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
+         {"Canon:Digital IXUS 30 (normal mode)", CANON_CLASS_6,  0x04A9, 0x30c0, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
+         {"Canon:IXY Digital 40 (normal mode)",  CANON_CLASS_6,  0x04A9, 0x30c0, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
++#endif
+         {"Canon:PowerShot SD400 (normal mode)", CANON_CLASS_4,  0x04A9, 0x30c1, CAP_NON, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
+         {"Canon:Digital IXUS 50 (normal mode)", CANON_CLASS_4,  0x04A9, 0x30c1, CAP_NON, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
+         {"Canon:IXY Digital 55 (normal mode)",  CANON_CLASS_4,  0x04A9, 0x30c1, CAP_NON, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
--- libgphoto2-2.4.0.orig/debian/patches/60_canon_reconnect_r10611.dpatch
+++ libgphoto2-2.4.0/debian/patches/60_canon_reconnect_r10611.dpatch
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 60_canon_reconnect.dpatch by  <lure@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0-2ubuntu1~/libgphoto2_port/usb/libusb.c libgphoto2-2.4.0-2ubuntu1/libgphoto2_port/usb/libusb.c
+--- libgphoto2-2.4.0-2ubuntu1~/libgphoto2_port/usb/libusb.c	2007-08-15 12:16:37.000000000 +0200
++++ libgphoto2-2.4.0-2ubuntu1/libgphoto2_port/usb/libusb.c	2007-09-12 23:13:23.000000000 +0200
+@@ -290,6 +290,8 @@
+ 		return (GP_ERROR_IO);
+ 	}
+ 
++#if 0
++	/* This does break Canon EOS and some PowerShots ... -Marcus */
+ 	/* This is only for our very special Canon cameras which need a good
+ 	 * whack after close, otherwise they get timeouts on reconnect.
+ 	 */
+@@ -299,7 +301,7 @@
+ 			return (GP_ERROR_IO);
+ 		}
+ 	}
+-
++#endif
+ 	if (usb_close (port->pl->dh) < 0) {
+ 		gp_port_set_error (port, _("Could not close USB port (%m)."));
+ 		return (GP_ERROR_IO);
--- libgphoto2-2.4.0.orig/debian/patches/45_increase_canon_timeout.dpatch
+++ libgphoto2-2.4.0/debian/patches/45_increase_canon_timeout.dpatch
@@ -0,0 +1,38 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 45_increase_canon_timeout.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Increase timeout wait for an URB to come back on an interrupt endpoint
+##
+## Reported by Shai Berger <shai@platonix.com> as Bug#453114:
+##
+## Version 2.4.0 of libgphoto2 broke support for several Canon camares,
+## it seems, by using a parameter CANON_FAST_TIMEOUT whose value
+## seems to be set too low. The result is that libgphoto fails to
+## connect to the camera, reporting something like
+## 
+##   Error (-114: 'OS error in camera communication')
+## 
+## This is all reported in an upstream bug:
+## http://sourceforge.net/tracker/index.php?func=detail&aid=1790633&group_id=8874&atid=108874
+## 
+## The upstream bug includes a suggestion for a fix -- increase
+## the timeout constant. The fix seems to have helped the original
+## reporter, and he said so over two months ago; it seems to have
+## corrected the problem completely for me. So I'm filing this
+## bug, hoping to get the fix tested in debian as long as upstream
+## hesitates.
+##
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/camlibs/canon/usb.c libgphoto2-2.4.0/camlibs/canon/usb.c
+--- libgphoto2-2.4.0~/camlibs/canon/usb.c	2007-07-27 02:35:50.000000000 +0200
++++ libgphoto2-2.4.0/camlibs/canon/usb.c	2007-11-27 15:11:33.290924579 +0100
+@@ -72,7 +72,7 @@
+ 
+ /* CANON_FAST_TIMEOUT: how long (in milliseconds) we should wait for
+  * an URB to come back on an interrupt endpoint */
+-#define CANON_FAST_TIMEOUT 75
++#define CANON_FAST_TIMEOUT 750
+ 
+ /* WARNING: This destroys reentrancy of the code. Better to put this
+  * in the camera descriptor somewhere. */
--- libgphoto2-2.4.0.orig/debian/patches/00list
+++ libgphoto2-2.4.0/debian/patches/00list
@@ -0,0 +1,15 @@
+00svn-ptp2-ids
+10_disable_cache
+11_hurd_no_path_max_bsdsource
+#15_use_bash_in_ptp_camera_check
+#20_fix-zero-vendor-ids
+#40_disable_canon_fast_directory_retrieval_r10028
+45_increase_canon_timeout.dpatch
+#50_getenv_home_overflow
+60_udev_rules_are_autogenerated_notice
+65_udev_usb_subsystem
+70_increase_max_entries
+60_canon_reconnect_r10611
+71_sandisk_sansa_crash
+72_deprecated_hal_key
+73_use_ptp_for_some_canon
--- libgphoto2-2.4.0.orig/debian/patches/20_fix-zero-vendor-ids.dpatch
+++ libgphoto2-2.4.0/debian/patches/20_fix-zero-vendor-ids.dpatch
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_fix-zero-vendor-ids.dpatch by  <mpitt@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad libgphoto2-2.3.1~/packaging/generic/print-camera-list.c libgphoto2-2.3.1/packaging/generic/print-camera-list.c
+--- libgphoto2-2.3.1~/packaging/generic/print-camera-list.c	2006-12-24 16:16:19.000000000 +0100
++++ libgphoto2-2.3.1/packaging/generic/print-camera-list.c	2007-04-23 19:30:08.000000000 +0200
+@@ -333,7 +333,7 @@
+ 				 | GP_USB_HOTPLUG_MATCH_PRODUCT_ID);
+ 			usb_vendor = a->usb_vendor;
+ 			usb_product = a->usb_product;
+-		} else if ((a->usb_class) && (a->usb_class != 666)) {
++		} else if (a->usb_class) {
+ 			class = a->usb_class;
+ 			subclass = a->usb_subclass;
+ 			proto = a->usb_protocol;
+@@ -446,7 +446,7 @@
+ 				 | GP_USB_HOTPLUG_MATCH_PRODUCT_ID);
+ 			usb_vendor = a->usb_vendor;
+ 			usb_product = a->usb_product;
+-		} else if ((a->usb_class) && (a->usb_class != 666)) {
++		} else if (a->usb_class) {
+ 			class = a->usb_class;
+ 			subclass = a->usb_subclass;
+ 			proto = a->usb_protocol;
--- libgphoto2-2.4.0.orig/debian/patches/60_udev_rules_are_autogenerated_notice.dpatch
+++ libgphoto2-2.4.0/debian/patches/60_udev_rules_are_autogenerated_notice.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 60_udev_rules_are_autogenerated_notice.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Adds a note to udev rules file to explain that file is generated
+## DP: automatically and that local changes will thus be lost on upgrades
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/packaging/generic/print-camera-list.c libgphoto2-2.4.0/packaging/generic/print-camera-list.c
+--- libgphoto2-2.4.0~/packaging/generic/print-camera-list.c	2007-07-27 02:35:28.000000000 +0200
++++ libgphoto2-2.4.0/packaging/generic/print-camera-list.c	2007-09-28 19:38:45.287336587 +0200
+@@ -485,6 +485,7 @@
+ 		printf ("# udev rules file for libgphoto2 devices (for udev %s version)\n",
+ 			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);
+ 	}
+ 	return 0;
--- libgphoto2-2.4.0.orig/debian/patches/10_disable_cache.dpatch
+++ libgphoto2-2.4.0/debian/patches/10_disable_cache.dpatch
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_disable_cache.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Do not cache downloaded files in memory to plug a giant memory hole
+## DP: (see Debian bug #372166)
+
+@DPATCH@
+diff -urNad libgphoto2-2.3.0~/libgphoto2/gphoto2-filesys.c libgphoto2-2.3.0/libgphoto2/gphoto2-filesys.c
+--- libgphoto2-2.3.0~/libgphoto2/gphoto2-filesys.c	2006-11-25 15:47:20.000000000 +0100
++++ libgphoto2-2.3.0/libgphoto2/gphoto2-filesys.c	2007-01-13 15:04:47.733634516 +0100
+@@ -1576,9 +1576,6 @@
+ 	CR (gp_file_set_type (file, type));
+ 	CR (gp_file_set_name (file, filename));
+ 
+-	/* Cache this file */
+-	CR (gp_filesystem_set_file_noop (fs, folder, file, context));
+-
+ 	/*
+ 	 * Often, thumbnails are of a different mime type than the normal
+ 	 * picture. In this case, we should rename the file.
--- libgphoto2-2.4.0.orig/debian/patches/72_deprecated_hal_key.dpatch
+++ libgphoto2-2.4.0/debian/patches/72_deprecated_hal_key.dpatch
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 72_deprecated_hal_key.dpatch by  <martin.pitt@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: info.bus hal property is deprecated with 0.5.11, use info.subsystem;
+## DP: http://gphoto.svn.sourceforge.net/viewvc/gphoto/trunk/libgphoto2/packaging/generic/print-camera-list.c?r1=10735&r2=10967
+## DP: https://bugs.launchpad.net/205417
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/packaging/generic/print-camera-list.c libgphoto2-2.4.0/packaging/generic/print-camera-list.c
+--- libgphoto2-2.4.0~/packaging/generic/print-camera-list.c	2007-07-27 02:35:28.000000000 +0200
++++ libgphoto2-2.4.0/packaging/generic/print-camera-list.c	2008-03-25 16:29:31.000000000 +0100
+@@ -798,7 +798,7 @@
+ 	print_version_comment(stdout, "    | ", "\n", "<!--+\n", "    +-->\n");
+ 	printf("<deviceinfo version=\"0.2\">\n");
+ 	printf(" <device>\n");
+-	printf("  <match key=\"info.bus\" string=\"usb\">\n");
++	printf("  <match key=\"info.subsystem\" string=\"usb\">\n");
+ 	return 0;
+ }
+ 
+@@ -917,7 +917,7 @@
+ 	print_version_comment(stdout, "    | ", "\n", "<!--+\n", "    +-->\n");
+ 	printf("<deviceinfo version=\"0.2\">\n");
+ 	printf(" <device>\n");
+-	printf("  <match key=\"info.bus\" string=\"usb\">\n");
++	printf("  <match key=\"info.subsystem\" string=\"usb\">\n");
+ 	return 0;
+ }
+ 
--- libgphoto2-2.4.0.orig/debian/patches/15_use_bash_in_ptp_camera_check.dpatch
+++ libgphoto2-2.4.0/debian/patches/15_use_bash_in_ptp_camera_check.dpatch
@@ -0,0 +1,16 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 15_use_bash_in_ptp_camera_check.dpatch by  <fpeters@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Use bash since the script has bashisms
+
+@DPATCH@
+diff -urNad libgphoto2-2.3.1~/packaging/generic/check-ptp-camera libgphoto2-2.3.1/packaging/generic/check-ptp-camera
+--- libgphoto2-2.3.1~/packaging/generic/check-ptp-camera	2006-12-24 16:16:19.000000000 +0100
++++ libgphoto2-2.3.1/packaging/generic/check-ptp-camera	2007-01-24 19:19:56.528663969 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+  
+ # check if any interface of this device is a PTP camera interface (06)
+ INTERFACE="${1:-06/01/01}"
--- libgphoto2-2.4.0.orig/debian/patches/71_sandisk_sansa_crash.dpatch
+++ libgphoto2-2.4.0/debian/patches/71_sandisk_sansa_crash.dpatch
@@ -0,0 +1,37 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 71_sandisk_sansa_crash.dpatch by  <martin.pitt@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix crash with Sandisk Sansa e250.
+## DP: Taken from https://sourceforge.net/tracker/?func=detail&atid=108874&aid=1904443&group_id=8874
+
+@DPATCH@
+diff -urNad libgphoto2-2.4.0~/camlibs/ptp2/ptp.c libgphoto2-2.4.0/camlibs/ptp2/ptp.c
+--- libgphoto2-2.4.0~/camlibs/ptp2/ptp.c	2007-07-27 02:35:37.000000000 +0200
++++ libgphoto2-2.4.0/camlibs/ptp2/ptp.c	2008-03-12 11:06:02.000000000 +0100
+@@ -2775,13 +2775,23 @@
+ 	PTPContainer ptp;
+ 	uint16_t ret;
+ 	unsigned char* dpv=NULL;
++	unsigned int dpvlen = 0;
+ 
+ 	PTP_CNT_INIT(ptp);
+ 	ptp.Code=PTP_OC_MTP_GetObjectReferences;
+ 	ptp.Param1=handle;
+ 	ptp.Nparam=1;
+-	ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &dpv, NULL);
+-	if (ret == PTP_RC_OK) *arraylen = ptp_unpack_uint32_t_array(params, dpv, 0, ohArray);
++	ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &dpv, &dpvlen);
++	if (ret == PTP_RC_OK) {
++		/* Sandisk Sansa skips the DATA phase, but returns OK as response.
++		 * this will gives us a NULL here. Handle it. -Marcus */
++		if ((dpv == NULL) || (dpvlen == 0)) {
++			*arraylen = 0;
++			*ohArray = NULL;
++		} else {
++			*arraylen = ptp_unpack_uint32_t_array(params, dpv, 0, ohArray);
++		}
++	}
+ 	free(dpv);
+ 	return ret;
+ }
--- libgphoto2-2.4.0.orig/debian/copyright
+++ libgphoto2-2.4.0/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Christophe Barbe christophe@ufies.org on
+Mon Nov 4 11:07:49 CEST 2002.
+
+
+It was downloaded from http://prdownloads.sourceforge.net/gphoto/
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, 
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details. 
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+
+On Debian systems, the complete text of the GNU Lesser General Public 
+License can be found in `/usr/share/common-licenses/LGPL'.
+
--- libgphoto2-2.4.0.orig/debian/libgphoto2-2.postinst
+++ libgphoto2-2.4.0/debian/libgphoto2-2.postinst
@@ -0,0 +1,37 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+PACKAGE="libgphoto2"
+
+case "$1" in
+    configure)
+	# create FDI file
+	mkdir -p /usr/share/hal/fdi/preprobe/10osvendor/ || true
+	/usr/lib/$PACKAGE/print-camera-list hal-fdi > \
+		/usr/share/hal/fdi/preprobe/10osvendor/20-$PACKAGE.fdi
+	
+	# remove old fdi files
+	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE.fdi
+	rm -f /usr/share/hal/fdi/information/20thirdparty/$PACKAGE.fdi
+	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE-device.fdi
+
+        # remove obsolete udev rules
+        if dpkg --compare-versions "$2" lt-nl "2.4.0-8ubuntu2"; then
+            rm -f /etc/udev/rules.d/45-libgphoto2.rules
+        fi
+	;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+
+exit 0
+
