rpms/libgphoto2/devel libgphoto2.udev-136.patch, NONE, 1.1 libgphoto2.spec, 1.22, 1.23
Jindrich Novy
jnovy at fedoraproject.org
Mon Aug 10 12:35:17 UTC 2009
Author: jnovy
Update of /cvs/pkgs/rpms/libgphoto2/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28866
Modified Files:
libgphoto2.spec
Added Files:
libgphoto2.udev-136.patch
Log Message:
* Sun Aug 09 2009 David Zeuthen <davidz at redhat.com> 2.4.6-3
- Add patch from http://sourceforge.net/tracker/?func=detail&aid=2801117&group_id=8874&atid=308874
and generate generic udev rules for device identification (ID_GPHOTO2* properties)
libgphoto2.udev-136.patch:
print-camera-list.c | 40 +++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
--- NEW FILE libgphoto2.udev-136.patch ---
--- libgphoto2-2.4.6/packaging/generic/print-camera-list.c 2009-03-23 08:56:56.000000000 +0100
+++ /home/martin/ubuntu/tmp/libgphoto2-2.4.6/packaging/generic/print-camera-list.c 2009-06-04 18:12:33.000000000 +0200
@@ -366,12 +366,14 @@
typedef enum {
UDEV_PRE_0_98 = 0,
- UDEV_0_98 = 1
+ UDEV_0_98 = 1,
+ UDEV_136 = 2
} udev_version_t;
static const StringFlagItem udev_version_t_map[] = {
{ "pre-0.98", UDEV_PRE_0_98 },
{ "0.98", UDEV_0_98 },
+ { "136", UDEV_136 },
{ NULL, 0 }
};
@@ -399,13 +401,20 @@
"ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n",
/* UDEV_0_98 */
"SUBSYSTEM!=\"usb|usb_device\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n",
+ /* UDEV_136 */
+ "SUBSYSTEM!=\"usb\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ENV{DEVTYPE}!=\"usb_device\", GOTO=\"libgphoto2_rules_end\"\n"
"ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"
+ "ENV{ID_USB_INTERFACES}==\"\", IMPORT{program}=\"usb_id --export %%p\"\n\n"
};
static const char * const usbcam_strings[] = {
/* UDEV_PRE_0_98 */
- "SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", ",
+ "SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\"",
/* UDEV_0_98 */
- "ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ",
+ "ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\"",
+ /* UDEV_136 */
+ "ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ENV{ID_GPHOTO2}=\"1\", ENV{GPHOTO2_DRIVER}=\"proprietary\""
};
udev_persistent_data_t *pdata;
pdata = calloc(1, sizeof(udev_persistent_data_t));
@@ -444,7 +453,8 @@
&& pdata->mode == NULL
&& pdata->group == NULL
&& pdata->owner == NULL
- && pdata->script == NULL) {
+ && pdata->script == NULL
+ && pdata->version <= UDEV_0_98) {
FATAL("Either <script> or <mode,group,owner> parameters must be given.");
}
if ((pdata->script != NULL) && (pdata->mode != NULL
@@ -547,7 +557,11 @@
if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) {
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);
+ if (pdata->version == UDEV_136) {
+ printf("ENV{ID_USB_INTERFACES}==\"*:%02d%02d%02d:*\", ENV{ID_GPHOTO2}=\"1\", ENV{GPHOTO2_DRIVER}=\"PTP\"", class, subclass, proto);
+ } else {
+ printf("PROGRAM=\"check-ptp-camera %02d/%02d/%02d\"", class, subclass, proto);
+ }
has_valid_rule = 1;
} else {
if (class == 666) {
@@ -568,6 +582,9 @@
}
}
if (has_valid_rule != 0) {
+ if (pdata->script != NULL || pdata->mode != NULL || pdata->owner != NULL || pdata->group != NULL)
+ printf(", ");
+
if (pdata->script != NULL) {
printf("RUN+=\"%s\"\n", pdata->script);
} else if (pdata->mode != NULL || pdata->owner != NULL || pdata->group != NULL) {
@@ -589,7 +606,8 @@
printf("\n");
} else {
printf("\n");
- FATAL("udev_camera_func(): illegal branch");
+ if (pdata->version < UDEV_136)
+ FATAL("udev_camera_func(): illegal branch");
}
}
return 0;
@@ -1118,12 +1136,16 @@
fdi_device_end_func
},
{"udev-rules",
- "udev rules file either for pre-0.98 or 0.98 and later",
- "Put it into /etc/udev/rules.d/90-libgphoto2.rules, set file mode, owner, group\n"
+ "udev rules file",
+ "For modes \"pre-0.98\" and \"0.98\" (and later), put it into\n"
+ " /etc/udev/rules.d/90-libgphoto2.rules, set file mode, owner, group\n"
" or add script to run. This rule files also uses the\n"
" check-ptp-camera script included in libgphoto2 source. Either put it to\n"
" /lib/udev/check-ptp-camera or adjust the path in the generated rules file.\n"
- " If you give a script parameter, the mode, owner, group parameters will be ignored.",
+ " If you give a script parameter, the mode, owner, group parameters will be ignored.\n"
+ " For mode \"136\" put it into /lib/udev/rules.d/40-libgphoto2.rules;\n"
+ " you can still use mode/owner/group, but the preferred mode of operation\n"
+ " is to use udev-extras for dynamic access permissions.\n",
"[script <PATH_TO_SCRIPT>|version <version>|mode <mode>|owner <owner>|group <group>]*",
udev_begin_func,
udev_camera_func,
Index: libgphoto2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libgphoto2/devel/libgphoto2.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- libgphoto2.spec 25 Jul 2009 05:49:09 -0000 1.22
+++ libgphoto2.spec 10 Aug 2009 12:35:17 -0000 1.23
@@ -1,7 +1,7 @@
Summary: Library for accessing digital cameras
Name: libgphoto2
Version: 2.4.6
-Release: 2%{?dist}
+Release: 3%{?dist}
# GPLV2+ for the main lib (due to exif.c) and most plugins, some plugins GPLv2
License: GPLv2+ and GPLv2
Group: Development/Libraries
@@ -11,6 +11,7 @@ Patch1: gphoto2-pkgcfg.patch
Patch2: gphoto2-storage.patch
Patch3: gphoto2-ixany.patch
Patch4: gphoto2-maxentries.patch
+Patch5: libgphoto2.udev-136.patch
Url: http://www.gphoto.org/
Requires: lockdev
BuildRequires: libusb-devel >= 0.1.5
@@ -54,6 +55,7 @@ use libgphoto2.
%patch2 -p1 -b .storage
%patch3 -p1 -b .ixany
%patch4 -p1 -b .maxentries
+%patch5 -p1 -b .udev136
for i in AUTHORS COPYING libgphoto2_port/AUTHORS libgphoto2_port/COPYING.LIB `find -name 'README.*'`; do
mv ${i} ${i}.old
@@ -107,6 +109,14 @@ export CAMLIBS=$RPM_BUILD_ROOT%{_libdir}
export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}
$RPM_BUILD_ROOT%{_libdir}/%{name}/print-camera-list hal-fdi | \
grep -v "<!-- This file was generated" > $RPM_BUILD_ROOT/%{_datadir}/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
+
+# Output udev rules for device identification; this is used by GVfs gphoto2
+# backend and others.
+#
+# Btw, since it's /lib/udev, never e.g. /lib64/udev, we hardcode the path
+#
+mkdir -p $RPM_BUILD_ROOT/lib/udev/rules.d
+$RPM_BUILD_ROOT%{_libdir}/%{name}/print-camera-list udev-rules version 136 > $RPM_BUILD_ROOT/lib/udev/rules.d/40-libgphoto2.rules
popd
rm -rf %{buildroot}%{_libdir}/libgphoto2/*/*a
@@ -132,6 +142,7 @@ rm -rf "${RPM_BUILD_ROOT}"
%{_libdir}/libgphoto2/*/*.so
%{_libdir}/*.so.*
%{_datadir}/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
+/lib/udev/rules.d/40-libgphoto2.rules
%{_libdir}/udev/check-ptp-camera
%{_libdir}/udev/check-mtp-device
@@ -151,6 +162,10 @@ rm -rf "${RPM_BUILD_ROOT}"
%{_mandir}/man3/*
%changelog
+* Sun Aug 09 2009 David Zeuthen <davidz at redhat.com> 2.4.6-3
+- Add patch from http://sourceforge.net/tracker/?func=detail&aid=2801117&group_id=8874&atid=308874
+ and generate generic udev rules for device identification (ID_GPHOTO2* properties)
+
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.4.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
More information about the fedora-extras-commits
mailing list