File udev-rule.patch of Package midisport-firmware

From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Forwarded: yes (by mail to Clemens Ladisch)
Bug-Debian: http://bugs.debian.org/574180
Description: Fix broken udev rule
 fxload once used the DEVICE environment variable to determine the
 target device. However, with usbfs no longer in place, this variable
 points to the nonexistent file(s) in /proc/bus/usb instead of
 /dev/bus/usb. The udev rules need to be augmented to pass the right
 device path to fxload.
######
 this patch description is no longer completely valid, the patch
 was changed by Stefan Seyfried <seife+obs@b1-systems.de> for openSUSE 13.1+
 => change from "-D /dev/%P" to "-D %N" and from DEVPATH== to ENV{DEVTYPE}==

Index: b/42-midisport-firmware.rules.in
===================================================================
--- a/42-midisport-firmware.rules.in
+++ b/42-midisport-firmware.rules.in
@@ -1,18 +1,18 @@
 # midisport-firmware.rules - udev rules for loading firmware into MidiSport devices
 
-# DEVPATH=="/*.0" selects interface 0 only
-# (some udev versions don't work with SYSFS{bInterfaceNumber})
-
+#
+# added -D because DEVICE= seems to be no longer present with newer udev versions?
+#
 # MidiSport 2x2
-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1001/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport2x2.ihx"
+ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="763/1001/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport2x2.ihx -D %N"
 # MidiSport 1x1
-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1010/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport1x1.ihx"
+ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="763/1010/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport1x1.ihx -D %N"
 # KeyStation
-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1014/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSportKS.ihx"
+ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="763/1014/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSportKS.ihx -D %N"
 # MidiSport 4x4
-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1020/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport4x4.ihx"
+ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="763/1020/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport4x4.ihx -D %N"
 # MidiSport 8x8
-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1031/110", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.10.ihx"
-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1031/121", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.21.ihx"
+ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="763/1031/110", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.10.ihx -D %N"
+ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="763/1031/121", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.21.ihx -D %N"
 
 # vim: ft=conf