From 5a070609f7d2f650c34254fa72ad43e9ccb07c93 Mon Sep 17 00:00:00 2001 From: Matthias Schwarzott Date: Mon, 11 Dec 2006 16:20:03 +0000 Subject: [PATCH] Added installation of udev-103 compliant rules, solving Bug #153471. Correcting also installation of hal-file, Bug #147346. Package-Manager: portage-2.1.2_rc3-r2 --- media-libs/libgphoto2/ChangeLog | 8 +- media-libs/libgphoto2/Manifest | 28 ++-- ...ibgphoto2-2.2.1-backported-udev-fixes.diff | 125 ++++++++++++++++++ .../libgphoto2/libgphoto2-2.2.1-r1.ebuild | 30 ++++- 4 files changed, 173 insertions(+), 18 deletions(-) create mode 100644 media-libs/libgphoto2/files/libgphoto2-2.2.1-backported-udev-fixes.diff diff --git a/media-libs/libgphoto2/ChangeLog b/media-libs/libgphoto2/ChangeLog index 80f453e1037c..f4e5500e4b1d 100644 --- a/media-libs/libgphoto2/ChangeLog +++ b/media-libs/libgphoto2/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for media-libs/libgphoto2 # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/ChangeLog,v 1.73 2006/11/07 12:03:11 hanno Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/ChangeLog,v 1.74 2006/12/11 16:20:03 zzam Exp $ + + 11 Dec 2006; Matthias Schwarzott + +files/libgphoto2-2.2.1-backported-udev-fixes.diff, + libgphoto2-2.2.1-r1.ebuild: + Added installation of udev-103 compliant rules, solving Bug #153471. + Correcting also installation of hal-file, Bug #147346. 07 Nov 2006; Hanno Boeck +files/libgphoto-2.2.1-new-dbus-api.patch, libgphoto2-2.2.1-r1.ebuild: diff --git a/media-libs/libgphoto2/Manifest b/media-libs/libgphoto2/Manifest index 41177ce48890..578b617d11d4 100644 --- a/media-libs/libgphoto2/Manifest +++ b/media-libs/libgphoto2/Manifest @@ -21,6 +21,10 @@ AUX libgphoto2-2.2.0-includes.patch 591 RMD160 e379beaa15415fa2ed29af20b8e808212 MD5 29fdda8de011f7e177486aecfa410782 files/libgphoto2-2.2.0-includes.patch 591 RMD160 e379beaa15415fa2ed29af20b8e80821281cf9e4 files/libgphoto2-2.2.0-includes.patch 591 SHA256 10bca0dfd46833cad2e07ce2588a26e4f2d0a15d90c42588498652ae20216cb5 files/libgphoto2-2.2.0-includes.patch 591 +AUX libgphoto2-2.2.1-backported-udev-fixes.diff 4547 RMD160 f5a40d2e61209077a62eacb79df1f21564ad6772 SHA1 22caeca5d270dfd8ca4cbb4050b8c06801708574 SHA256 9cd7977cb2d84b9023269e14b2ed02c6589ae543d16ddcfc73bfe3f4c48fce07 +MD5 1b7f90a17048bb86962cb35935a74608 files/libgphoto2-2.2.1-backported-udev-fixes.diff 4547 +RMD160 f5a40d2e61209077a62eacb79df1f21564ad6772 files/libgphoto2-2.2.1-backported-udev-fixes.diff 4547 +SHA256 9cd7977cb2d84b9023269e14b2ed02c6589ae543d16ddcfc73bfe3f4c48fce07 files/libgphoto2-2.2.1-backported-udev-fixes.diff 4547 AUX libgphoto2-2.2.1-ngettext.patch 542 RMD160 04870c8dc64be5bd25885bd00b3e7a019239c82d SHA1 2c7d68ff3b27dd1de15940b56b7a1c6aa37c511e SHA256 4132274f809e3041de93c0e55d8b2f29d766b46a1eb11af37c7a404588d9208a MD5 346c47d1d96769c6d5a6070f2854ecd8 files/libgphoto2-2.2.1-ngettext.patch 542 RMD160 04870c8dc64be5bd25885bd00b3e7a019239c82d files/libgphoto2-2.2.1-ngettext.patch 542 @@ -31,14 +35,14 @@ EBUILD libgphoto2-2.1.6-r1.ebuild 4524 RMD160 a5235fcd950a6d330c179f503a59aa9601 MD5 79ede0c0b2257dfac58b8e403045736c libgphoto2-2.1.6-r1.ebuild 4524 RMD160 a5235fcd950a6d330c179f503a59aa9601c99b7a libgphoto2-2.1.6-r1.ebuild 4524 SHA256 953770195b493cd9835982922d71613c7bf8048b96be7c5c67fa9f6c5f72dd9a libgphoto2-2.1.6-r1.ebuild 4524 -EBUILD libgphoto2-2.2.1-r1.ebuild 4828 RMD160 46a949311cade607239f7538e23702bf6654bce0 SHA1 455fbff7cda0c3fdaabf64982fc62a2a57a0e77c SHA256 62ed127962b0329c4eeab846d515d9e338a75ee4b6779f4657be46966f39bf95 -MD5 04e79ddb32c030613dcb3179fe90ab1c libgphoto2-2.2.1-r1.ebuild 4828 -RMD160 46a949311cade607239f7538e23702bf6654bce0 libgphoto2-2.2.1-r1.ebuild 4828 -SHA256 62ed127962b0329c4eeab846d515d9e338a75ee4b6779f4657be46966f39bf95 libgphoto2-2.2.1-r1.ebuild 4828 -MISC ChangeLog 12071 RMD160 57be57591155204ca98a410ce5b6b86f77e24503 SHA1 6c17ed095d56fb00604184343e4bcdbab0203b60 SHA256 313b20b0bef900e6e2e7a918ee17dacd7f93e0d07da4f59b0467d5bd837fd8e6 -MD5 7028620ca46a69d012410443166739bd ChangeLog 12071 -RMD160 57be57591155204ca98a410ce5b6b86f77e24503 ChangeLog 12071 -SHA256 313b20b0bef900e6e2e7a918ee17dacd7f93e0d07da4f59b0467d5bd837fd8e6 ChangeLog 12071 +EBUILD libgphoto2-2.2.1-r1.ebuild 5604 RMD160 c75224e634aad18dfc8a31f310a44d32b54e3284 SHA1 1deef0c2da0785fc8563565bdeeb2dbf1dd7aa2e SHA256 4fd564fd2450d7694f2f5b1f79b7b991edcd60f055a3d561946a6258352eeef1 +MD5 bc4f351f3d0eb9c44ab8257ddb2db9d9 libgphoto2-2.2.1-r1.ebuild 5604 +RMD160 c75224e634aad18dfc8a31f310a44d32b54e3284 libgphoto2-2.2.1-r1.ebuild 5604 +SHA256 4fd564fd2450d7694f2f5b1f79b7b991edcd60f055a3d561946a6258352eeef1 libgphoto2-2.2.1-r1.ebuild 5604 +MISC ChangeLog 12336 RMD160 c9d72096eb30cc3f4c0211d9e413d12d97c9319c SHA1 7a48bc13264f7c851ea2d1c437f39d59f4795802 SHA256 c233d03990dc9604a2e718c0bf10177c15f29826d2b9a05c280d7438f03187e3 +MD5 d315bd40b3dea0b8ba5ac37d1b39a0fd ChangeLog 12336 +RMD160 c9d72096eb30cc3f4c0211d9e413d12d97c9319c ChangeLog 12336 +SHA256 c233d03990dc9604a2e718c0bf10177c15f29826d2b9a05c280d7438f03187e3 ChangeLog 12336 MISC metadata.xml 217 RMD160 bf13a92bfaf8b11a492e3925f700beb776405f79 SHA1 4e896159ae71f6294c983df1e31772404536478d SHA256 8d9b308751481891a748c6b43b222ef52999140d5c587ba5e7464d1a8414d30a MD5 80850151bae2bd61c4ac796f83656ef6 metadata.xml 217 RMD160 bf13a92bfaf8b11a492e3925f700beb776405f79 metadata.xml 217 @@ -50,9 +54,9 @@ MD5 2a6cbda61749e6fc014bfff5f25b1492 files/digest-libgphoto2-2.2.1-r1 253 RMD160 d40dc6a0d1b6b95af1baeb234ef117c241c0ef63 files/digest-libgphoto2-2.2.1-r1 253 SHA256 bce3c4c7a08f9d9a3e8627e4bab1d096c6736d7e96b3cfa4c5e8d3886d312724 files/digest-libgphoto2-2.2.1-r1 253 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.5 (GNU/Linux) +Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFFUHYgr2QksT29OyARAo+HAKCjKOT6NOs0f1Jnfb0SFqRXk+jgDQCfQGtX -026VmOC9Ikgj4Odmk5Y/MX8= -=4IpK +iD8DBQFFfYVAt2vP6XvVdOcRAlraAKDCfbQDqlkd+C0Xqsl1g2U/nAwlPgCfStFk +eiZhhD9IoiW2ckweRoCtxKc= +=3CmP -----END PGP SIGNATURE----- diff --git a/media-libs/libgphoto2/files/libgphoto2-2.2.1-backported-udev-fixes.diff b/media-libs/libgphoto2/files/libgphoto2-2.2.1-backported-udev-fixes.diff new file mode 100644 index 000000000000..ec797c830cf7 --- /dev/null +++ b/media-libs/libgphoto2/files/libgphoto2-2.2.1-backported-udev-fixes.diff @@ -0,0 +1,125 @@ +# Backported udev-rules-0.98 from libgphoto2-2.3.0 +# Backported PTP-Matching code from SVN (http://gphoto.svn.sourceforge.net/viewvc/gphoto/trunk/libgphoto2/packaging/generic/) + +diff -ruN libgphoto2-2.2.1-orig/packaging/generic/check_ptp_camera libgphoto2-2.2.1/packaging/generic/check_ptp_camera +--- libgphoto2-2.2.1-orig/packaging/generic/check_ptp_camera 1970-01-01 01:00:00.000000000 +0100 ++++ libgphoto2-2.2.1/packaging/generic/check_ptp_camera 2006-12-08 10:23:35.000000000 +0100 +@@ -0,0 +1,20 @@ ++#!/bin/sh ++ ++# check if any interface of this device is a PTP camera interface (06) ++INTERFACE="${1:-06/01/01}" ++ ++BASENAME=${PHYSDEVPATH##*/} ++for d in /sys/${PHYSDEVPATH}/${BASENAME}:*; do ++ [[ -d ${d} ]] || continue ++ INTERFACEID="$(< ${d}/bInterfaceClass)" ++ INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceSubClass)" ++ INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceProtocol)" ++ ++ #echo ${d}: ${INTERFACEID} ++ if [[ ${INTERFACE} == ${INTERFACEID} ]]; then ++ # Found interface ++ exit 0 ++ fi ++done ++ ++exit 1 +diff -ruN libgphoto2-2.2.1-orig/packaging/generic/Makefile.am libgphoto2-2.2.1/packaging/generic/Makefile.am +--- libgphoto2-2.2.1-orig/packaging/generic/Makefile.am 2006-12-08 10:04:43.000000000 +0100 ++++ libgphoto2-2.2.1/packaging/generic/Makefile.am 2006-12-08 10:24:29.000000000 +0100 +@@ -2,6 +2,7 @@ + # policies + utilsdir = $(libdir)/$(PACKAGE) + utils_PROGRAMS = print-camera-list ++EXTRA_DIST = check_ptp_camera + + # print_camera_list_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) + print_camera_list_SOURCE = print-camera-list.c +diff -ruN libgphoto2-2.2.1-orig/packaging/generic/print-camera-list.c libgphoto2-2.2.1/packaging/generic/print-camera-list.c +--- libgphoto2-2.2.1-orig/packaging/generic/print-camera-list.c 2006-12-08 10:04:43.000000000 +0100 ++++ libgphoto2-2.2.1/packaging/generic/print-camera-list.c 2006-12-08 13:40:57.000000000 +0100 +@@ -105,7 +105,6 @@ + } while (0) + #endif /* __GNUC__ */ + +- + /* print_usb_usermap + * + * Print out lines that can be included into usb.usermap +@@ -262,13 +261,14 @@ + + + static int +-udev_begin_func (const func_params_t *params) ++udev_098_begin_func (const func_params_t *params) + { +- printf ("# udev rules file for libgphoto2\n#\n"); +- printf ("BUS!=\"usb\", ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"); ++ printf ("# udev rules file for libgphoto2 devices (udev >= 0.98)\n#\n"); ++ printf ("ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"); ++ printf ("SUBSYSTEM!=\"usb*\", GOTO=\"libgphoto2_rules_end\"\n\n"); + return 0; + } +- ++ + static int + udev_end_func (const func_params_t *params) + { +@@ -280,7 +280,7 @@ + + + static int +-udev_camera_func (const func_params_t *params, ++udev_098_camera_func (const func_params_t *params, + const int i, + const CameraAbilities *a) + { +@@ -324,22 +324,18 @@ + } + + if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) { +- printf("SYSFS{bInterfaceClass}==\"%02x\", ", class); +- if (flags & GP_USB_HOTPLUG_MATCH_INT_SUBCLASS) { +- printf("SYSFS{bInterfaceSubClass}==\"%02x\", ", subclass); +- } +- if (flags & GP_USB_HOTPLUG_MATCH_INT_PROTOCOL) { +- printf("SYSFS{bInterfaceProtocol}==\"%02x\", ", proto); +- } ++ if ((flags & (GP_USB_HOTPLUG_MATCH_INT_CLASS|GP_USB_HOTPLUG_MATCH_INT_SUBCLASS|GP_USB_HOTPLUG_MATCH_INT_PROTOCOL)) == (GP_USB_HOTPLUG_MATCH_INT_CLASS|GP_USB_HOTPLUG_MATCH_INT_SUBCLASS|GP_USB_HOTPLUG_MATCH_INT_PROTOCOL)) ++ printf("PROGRAM=\"check_ptp_camera %02d/%02d/%02d\", ", class, subclass, proto); ++ else ++ fprintf(stderr,"unhandled interface match flags %x\n", flags); + } else { +- printf ("SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", ", ++ printf ("ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ", + a->usb_vendor, a->usb_product); + } +- printf("RUN+=\"%s\"\n", hotplug_script); ++ printf("MODE=\"660\", GROUP=\"plugdev\"\n"); + return 0; + } + +- + static int + empty_begin_func (const func_params_t *params) + { +@@ -647,12 +643,12 @@ + camera_func: fdi_device_camera_func, + end_func: fdi_device_end_func + }, +- {name: "udev-rules", +- descr: "udev rules file", +- help: "Put it into /etc/udev/libgphoto2.rules", +- paramdescr: "", +- begin_func: udev_begin_func, +- camera_func: udev_camera_func, ++ {name: "udev-rules-0.98", ++ descr: "udev >= 0.98 rules file", ++ help: "Put it into /etc/udev/libgphoto2.rules, for udev >= 0.98", ++ paramdescr: "( | [mode |owner |group ]* ) ", ++ begin_func: udev_098_begin_func, ++ camera_func: udev_098_camera_func, + end_func: udev_end_func + }, + {name: "idlist", diff --git a/media-libs/libgphoto2/libgphoto2-2.2.1-r1.ebuild b/media-libs/libgphoto2/libgphoto2-2.2.1-r1.ebuild index a7aa6aa19c00..3db8443a167f 100644 --- a/media-libs/libgphoto2/libgphoto2-2.2.1-r1.ebuild +++ b/media-libs/libgphoto2/libgphoto2-2.2.1-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/libgphoto2-2.2.1-r1.ebuild,v 1.6 2006/11/07 12:03:11 hanno Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/libgphoto2-2.2.1-r1.ebuild,v 1.7 2006/12/11 16:20:03 zzam Exp $ inherit libtool eutils autotools @@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/gphoto/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="nls doc exif usb hal" +IUSE="nls doc exif usb hal udev" RESTRICT="test confcache" # needs >usbutils-0.11-r2 to avoid /usr/lib/libusb* @@ -61,6 +61,9 @@ src_unpack() { # bug #139534: already merged into upstream SVN epatch ${FILESDIR}/${P}-ngettext.patch + # bug #153471: create udev-rules for udev >= 0.98 + epatch ${FILESDIR}/${P}-backported-udev-fixes.diff + # make default group 'plugdev', not camera sed -e 's:=camera:=plugdev:' -i packaging/linux-hotplug/usbcam.group @@ -118,20 +121,37 @@ src_install() { fi if [[ -x ${D}/usr/$(get_libdir)/libgphoto2/print-camera-list ]]; then + # Let print-camera-list find libgphoto2.so + export LD_LIBRARY_PATH="${D}/usr/$(get_libdir)" + # Let libgphoto2 find its camera-modules + export CAMLIBS="${D}/usr/$(get_libdir)/libgphoto2/${PV}" + HOTPLUG_USERMAP="/etc/hotplug/usb/usbcam-gphoto2.usermap" HAL_FDI="/usr/share/hal/fdi/information/10freedesktop/10-camera-libgphoto2.fdi" + UDEV_RULES="/etc/udev/rules.d/99-libgphoto2.rules" if use usb && use kernel_linux; then einfo "Generating usbcam-gphoto2.usermap ..." echo "# !!! DO NOT EDIT THIS FILE !!! This file is automatically generated." > ${D}/${HOTPLUG_USERMAP} echo "# Put your custom entries in /etc/hotplug/usb/usbcam.usermap" >> ${D}/${HOTPLUG_USERMAP} - ${D}/usr/$(get_libdir)/libgphoto2/print-camera-list usb-usermap >> ${D}/${HOTPLUG_USERMAP} - + ${D}/usr/$(get_libdir)/libgphoto2/print-camera-list usb-usermap >> ${D}/${HOTPLUG_USERMAP} \ + || die "failed to create usb-usermap" fi if use hal; then einfo "Generating HAL FDI files ..." - ${D}/usr/$(get_libdir)/libgphoto2/print-camera-list hal-fdi >> ${D}/${HAL_FDI} + mkdir -p ${D}/${HAL_FDI%/*} + ${D}/usr/$(get_libdir)/libgphoto2/print-camera-list hal-fdi >> ${D}/${HAL_FDI} \ + || die "failed to create hal-fdi" + fi + + if use udev; then + einfo "Generating UDEV-rules ..." + mkdir -p ${D}/${UDEV_RULES%/*} + ${D}/usr/$(get_libdir)/libgphoto2/print-camera-list udev-rules-0.98 >> ${D}/${UDEV_RULES} \ + || die "failed to create udev-rules" + exeinto /lib/udev + doexe ${S}/packaging/generic/check_ptp_camera fi else eerror "Unable to find ${ROOT}/usr/$(get_libdir)/libgphoto2/print-camera-list" -- 2.26.2