[Pkg-kde-commits] rev 911 - in branches/kde-3.4.0/packages/kdebase/debian: . patches

Christopher Martin chrsmrtn-guest@costa.debian.org
Thu, 24 Mar 2005 14:52:24 +0000


Author: chrsmrtn-guest
Date: 2005-03-24 14:52:23 +0000 (Thu, 24 Mar 2005)
New Revision: 911

Added:
   branches/kde-3.4.0/packages/kdebase/debian/patches/17_logitechmouse.diff
Modified:
   branches/kde-3.4.0/packages/kdebase/debian/changelog
   branches/kde-3.4.0/packages/kdebase/debian/control
   branches/kde-3.4.0/packages/kdebase/debian/rules
Log:
Commit logitech mouse special support - patching the KDE provided files to
avoid the need for pam_console, and re-naming the script to something less
generic. User reports that this works.


Modified: branches/kde-3.4.0/packages/kdebase/debian/changelog
===================================================================
--- branches/kde-3.4.0/packages/kdebase/debian/changelog	2005-03-24 07:47:35 UTC (rev 910)
+++ branches/kde-3.4.0/packages/kdebase/debian/changelog	2005-03-24 14:52:23 UTC (rev 911)
@@ -23,6 +23,10 @@
   * KDM once again looks for window manager session definitions in
     /usr/share/apps/kdm/sessions. (Closes: #293645)
 
+  * USB usermap for Logitech mice is now installed, with device permissions
+    set so that members of the plugdev group can make use of the Logitech
+    KControl module (under Peripherals/Mouse).
+
   * New kdebase-doc-html package, containing doc-base registered HTML versions
     of application handbooks, for users without Konqueror or KHelpCenter.
 

Modified: branches/kde-3.4.0/packages/kdebase/debian/control
===================================================================
--- branches/kde-3.4.0/packages/kdebase/debian/control	2005-03-24 07:47:35 UTC (rev 910)
+++ branches/kde-3.4.0/packages/kdebase/debian/control	2005-03-24 14:52:23 UTC (rev 911)
@@ -70,6 +70,7 @@
 Section: kde
 Architecture: any
 Depends: ${shlibs:Depends}, kdebase-data
+Recommends: hotplug
 Suggests: khelpcenter
 Conflicts: kdebase-libs (<< 4:3.0.0)
 Replaces: kdebase (<< 4:3.0.0), kdebase-doc (<< 4:3.0.0), kdebase-libs (<< 4:3.0.0), konqueror (<< 4:3.0.0)
@@ -153,7 +154,7 @@
 Section: kde
 Architecture: any
 Depends: ${shlibs:Depends}, libsasl2-modules
-Recommends: hal, pmount, kamera, kdemultimedia-kio-plugins, eject
+Recommends: hal, pmount, kamera, kdemultimedia-kio-plugins
 Suggests: khelpcenter, mtools
 Conflicts: kdebase-libs (<< 4:3.0.0)
 Replaces: kdebase (<< 4:3.0.0), kdebase-doc (<< 4:3.0.0), kdebase-libs (<< 4:3.0.0), konqueror (<< 4:3.0.0)

Added: branches/kde-3.4.0/packages/kdebase/debian/patches/17_logitechmouse.diff
===================================================================
--- branches/kde-3.4.0/packages/kdebase/debian/patches/17_logitechmouse.diff	2005-03-24 07:47:35 UTC (rev 910)
+++ branches/kde-3.4.0/packages/kdebase/debian/patches/17_logitechmouse.diff	2005-03-24 14:52:23 UTC (rev 911)
@@ -0,0 +1,111 @@
+--- kde.orig/kcontrol/input/consoleUserPerms
++++ kde.patched/kcontrol/input/consoleUserPerms
+@@ -1,42 +1,27 @@
+ #!/bin/bash
+ #
+-# /etc/hotplug/usb/consoleUserPerms
++# /etc/hotplug/usb/logitechmouse
+ #
+-# Sets up newly plugged in USB device so that the user who owns
+-# the console according to pam_console can access it from user space
++# Sets up newly plugged-in USB device so that members of the plugdev
++# group can access it from userspace.
+ #
+ # Note that for this script to work, you'll need all of the following:
+ # a) a line in the file /etc/hotplug/usb.usermap or another usermap file
+ #    in /etc/hotplug/usb/ that corresponds to the device you are using.
+-# b) a setup using pam_console creates the respective lock files
+-#    containing the name of the respective user. You can check for that
+-#    by executing "echo `cat /var/{run,lock}/console.lock`" and
+-#    verifying the appropriate user is mentioned somewhere there.
++# b) membership in the plugdev group for all users who intend to use
++#    this setup.
+ # c) a Linux kernel supporting hotplug and usbdevfs
+ # d) the hotplug package (http://linux-hotplug.sourceforge.net/)
+ #
+ # In the usermap file, the first field "usb module" should be named
+-# "consoleUserPerms" to invoke this script.
+-#
++# "logitechmouse" to invoke this script.
++
++GROUP=plugdev
+ 
+ if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
+ then
+-    # New code, using lock files instead of copying /dev/console permissions
+-    # This also works with non-kdm logins (e.g. on a virtual terminal)
+-    # Idea and code from Nalin Dahyabhai <nalin@redhat.com>
+-    if [ -f /var/run/console.lock ]
+-    then
+-        CONSOLEOWNER=`cat /var/run/console.lock`
+-    elif [ -f /var/lock/console.lock ]
+-    then
+-        CONSOLEOWNER=`cat /var/lock/console.lock`
+-    else
+-        CONSOLEOWNER=
+-    fi
+-    if [ -n "$CONSOLEOWNER" ]
+-    then
+-        chmod 0000 "${DEVICE}"
+-        chown "$CONSOLEOWNER" "${DEVICE}"
+-        chmod 0600 "${DEVICE}"
++    if getent group $GROUP > /dev/null; then
++        chmod 660 "${DEVICE}"
++        chown root.$GROUP "${DEVICE}"
+     fi
+ fi
+--- kde.orig/kcontrol/input/logitechmouse.usermap
++++ kde.patched/kcontrol/input/logitechmouse.usermap
+@@ -1,35 +1,35 @@
+ # script           match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
+ # Wheel Mouse Optical
+-consoleUserPerms     0x0003      0x046d   0xc00e    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc00e    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MouseMan Traveler
+-consoleUserPerms     0x0003      0x046d   0xc00f    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc00f    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MouseMan Dual Optical
+-consoleUserPerms     0x0003      0x046d   0xc012    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc012    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MX310 Optical Mouse
+-consoleUserPerms     0x0003      0x046d   0xc01b    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc01b    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MX510 Optical Mouse
+-consoleUserPerms     0x0003      0x046d   0xc01d    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc01d    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MX300 Optical Mouse
+-consoleUserPerms     0x0003      0x046d   0xc024    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc024    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MX500 Optical Mouse
+-consoleUserPerms     0x0003      0x046d   0xc025    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc025    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # iFeel Mouse
+-consoleUserPerms     0x0003      0x046d   0xc031    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc031    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Mouse Receiver
+-consoleUserPerms     0x0003      0x046d   0xc501    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc501    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Dual Receiver
+-consoleUserPerms     0x0003      0x046d   0xc502    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc502    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Cordless Freedom Optical
+-consoleUserPerms     0x0003      0x046d   0xc504    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc504    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Cordless Elite Duo
+-consoleUserPerms     0x0003      0x046d   0xc505    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc505    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MX700 Optical Mouse
+-consoleUserPerms     0x0003      0x046d   0xc506    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc506    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Cordless Optical Trackman
+-consoleUserPerms     0x0003      0x046d   0xc508    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc508    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Cordless MX Duo Receiver
+-consoleUserPerms     0x0003      0x046d   0xc50b    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc50b    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # MX100 Laser Mouse
+-consoleUserPerms     0x0003      0x046d   0xc50e    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc50e    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+ # Receiver for Cordless Presenter
+-consoleUserPerms     0x0003      0x046d   0xc702    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
++logitechmouse     0x0003      0x046d   0xc702    0x0000       0xffff      0x00         0x00            0x00            0x00            0x00               0x00               0x00000000

Modified: branches/kde-3.4.0/packages/kdebase/debian/rules
===================================================================
--- branches/kde-3.4.0/packages/kdebase/debian/rules	2005-03-24 07:47:35 UTC (rev 910)
+++ branches/kde-3.4.0/packages/kdebase/debian/rules	2005-03-24 14:52:23 UTC (rev 911)
@@ -32,6 +32,10 @@
 binary-install/xfonts-konsole::
 	dh_installxfonts -pxfonts-konsole
 
+binary-install/kcontrol::
+	install -p -D -m644 kcontrol/input/logitechmouse.usermap debian/kcontrol/etc/hotplug/usb/logitechmouse.usermap
+	install -p -D -m755 kcontrol/input/consoleUserPerms debian/kcontrol/etc/hotplug/usb/logitechmouse
+
 binary-install/kdebase-doc-html::
 	for dir in kinfocenter ksplashml kcontrol khelpcenter kdesu knetattach kioslave kxkb kdebugdialog kdcop ; do \
 		rm -rf debian/kdebase-doc-html/usr/share/doc/kde/HTML/en/$$dir ; done