[arch-commits] Commit in libgphoto2/gnome-unstable (2 files)
Jan de Groot
jgc at archlinux.org
Wed Aug 12 10:28:11 UTC 2009
Date: Wednesday, August 12, 2009 @ 06:28:11
Author: jgc
Revision: 49553
Build without hal support completely. Otherwise the disk module doesn't work if hal is not installed. The disk module uses /etc/mtab instead now.
Add upstream patch for udev 136+ support.
Note: libgphoto has no way to disable hal other than not having it installed. Whoever updates or rebuilds this package on a system with hal outside a chroot will get shot.
Added:
libgphoto2/gnome-unstable/libgphoto2.udev-136.patch
Modified:
libgphoto2/gnome-unstable/PKGBUILD
---------------------------+
PKGBUILD | 20 +++-----
libgphoto2.udev-136.patch | 106 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 115 insertions(+), 11 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-08-12 09:51:51 UTC (rev 49552)
+++ PKGBUILD 2009-08-12 10:28:11 UTC (rev 49553)
@@ -9,24 +9,24 @@
arch=(i686 x86_64)
url="http://www.gphoto.org"
license=(LGPL)
-depends=('libexif>=0.6.17' 'libjpeg>=7' 'libtool>=2.2.6a')
-makedepends=('hal')
-optdepends=('hal')
+depends=('libexif>=0.6.17' 'libjpeg>=7' 'libtool>=2.2.6a' 'libusb')
install=(libgphoto2.install)
options=('libtool')
-source=(http://downloads.sourceforge.net/gphoto/${pkgname}-${pkgver}.tar.gz)
-md5sums=('3ad331acbe7e6ff4601705d504bdff94')
+source=(http://downloads.sourceforge.net/gphoto/${pkgname}-${pkgver}.tar.gz
+ libgphoto2.udev-136.patch)
+md5sums=('3ad331acbe7e6ff4601705d504bdff94' '24ed32c30477c95561fb9a146915791e')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
- ./configure --prefix=/usr --with-exif --disable-static || return 1
+ patch -Np1 -i "${srcdir}/libgphoto2.udev-136.patch" || return 1
+ udevscriptdir=/lib/udev ./configure --prefix=/usr --with-drivers=all --disable-static --disable-rpath || return 1
LD_PRELOAD="" make || return 1
make DESTDIR="${pkgdir}" install || return 1
rm -f ${pkgdir}/usr/lib/libgphoto2/${pkgver}/*.a
install -m755 -d "${pkgdir}/usr/share/hal/fdi/information/20thirdparty"
- install -m755 -d "${pkgdir}/etc/udev/rules.d"
+ install -m755 -d "${pkgdir}/lib/udev/rules.d"
LD_LIBRARY_PATH="${pkgdir}/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
CAMLIBS="${pkgdir}/usr/lib/libgphoto2/${pkgver}" \
"${pkgdir}/usr/lib/libgphoto2/print-camera-list" hal-fdi > \
@@ -34,10 +34,8 @@
LD_LIBRARY_PATH="${pkgdir}/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
CAMLIBS="${pkgdir}/usr/lib/libgphoto2/${pkgver}" \
- "${pkgdir}/usr/lib/libgphoto2/print-camera-list" udev-rules version 0.98 group camera mode 0660 > \
- "${pkgdir}/etc/udev/rules.d/54-gphoto.rules" || return 1
- install -m755 -d "${pkgdir}/lib"
- mv "${pkgdir}/usr/lib/udev" "${pkgdir}/lib/" || return 1
+ "${pkgdir}/usr/lib/libgphoto2/print-camera-list" udev-rules version 136 group camera mode 0660 > \
+ "${pkgdir}/lib/udev/rules.d/54-gphoto.rules" || return 1
# Remove recursive symlink
rm -f "${pkgdir}/usr/include/gphoto2/gphoto2" || return 1
Added: libgphoto2.udev-136.patch
===================================================================
--- libgphoto2.udev-136.patch (rev 0)
+++ libgphoto2.udev-136.patch 2009-08-12 10:28:11 UTC (rev 49553)
@@ -0,0 +1,106 @@
+--- 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,
+
+
More information about the arch-commits
mailing list