rpms/libifp/devel libifp.hotplug, NONE, 1.1 libifp.usermap, NONE, 1.1 libifp.spec, 1.2, 1.3

Ignacio Vazquez-Abrams (ivazquez) fedora-extras-commits at redhat.com
Thu Jul 7 23:02:43 UTC 2005


Author: ivazquez

Update of /cvs/extras/rpms/libifp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10461/devel

Modified Files:
	libifp.spec 
Added Files:
	libifp.hotplug libifp.usermap 
Log Message:
Added Per Bjornsson's hotplug files


--- NEW FILE libifp.hotplug ---
#!/bin/bash
#
# /etc/hotplug/usb/libifp
# 
# Cloned off the usbcam hotplug script that is shipped by 
# Red Hat with gphoto2. In principle we could just call that one,
# but it's ugly to depend on a camera driver in order to talk
# to an audio player...
#
# Sets up newly plugged-in iRiver iFP device so that the user who owns
# the console according to pam_console can access it from user space
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/usb/libifp.usermap that corresponds 
#    to the iFP 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.
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# All of the above are expected to be true on recent Red Hat and Fedora
# distributions in the default install.
#
# In the usermap file, the first field "usb module" should be named 
# "libifp" like this script.
# 

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
    # New code, using lock files instead of copying /dev/console permissions
    # This also works with non-gdm logins (e.g. on a virtual terminal)
    # Idea and code from Nalin Dahyabhai <nalin at redhat.com>
    if [ -f /var/run/console/console.lock ]
    then
        CONSOLEOWNER=`cat /var/run/console/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}"
    fi
fi


--- NEW FILE libifp.usermap ---
# This file is shipped with libifp (based on a similar file in
# the libsane package as shipped by Red Hat).
#
# The entries below are used to detect an iRiver iFP portable music
# player when it is plugged in and then run the libifp hotplug script to 
# change the ownership and permissions on the "device node" used by
# libusb.
#
# The 0x0003 match flag means the device is matched by its vendor and
# product IDs.
#
# Sample entry (replace 0xVVVV and 0xPPPP with vendor ID and product ID respectively) :
# libifp             0x0003      0xVVVV   0xPPPP    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
#
# usb module         match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
#
#
# The following list already contains the known iRiver iFP devices, with the
# product IDs copied from the header file for libifp.
# If it doesn't work for yours, try adding an appropriate entry.

# iRiver iFP-1XX
libifp 0x0003 0x4102 0x1001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver iFP-3XX
libifp 0x0003 0x4102 0x1003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver iFP-5XX
libifp 0x0003 0x4102 0x1005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver iFP-7XX
libifp 0x0003 0x4102 0x1007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver iFP-8XX
libifp 0x0003 0x4102 0x1008 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver iFP-9XX
libifp 0x0003 0x4102 0x1009 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver iFP-10XX
libifp 0x0003 0x4102 0x1010 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#iRiver N10
libifp 0x0003 0x4102 0x1011 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000


Index: libifp.spec
===================================================================
RCS file: /cvs/extras/rpms/libifp/devel/libifp.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libifp.spec	7 Jul 2005 21:17:45 -0000	1.2
+++ libifp.spec	7 Jul 2005 23:02:41 -0000	1.3
@@ -7,6 +7,8 @@
 License:        GPL
 URL:            http://ifp-driver.sourceforge.net/
 Source0:        http://dl.sourceforge.net/ifp-driver/%{name}-%{version}.tar.gz
+Source1:        libifp.hotplug
+Source2:        libifp.usermap
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libusb-devel doxygen
@@ -37,6 +39,8 @@
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 find $RPM_BUILD_ROOT -name \*.la -exec rm {} \;
+install -D -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/hotplug/usb/libifp
+install -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/hotplug/usb/libifp.usermap
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -49,6 +53,7 @@
 %doc ChangeLog COPYING README TODO
 %{_bindir}/*
 %{_libdir}/*.so.*
+%{_sysconfdir}/hotplug/usb/*
 
 %files devel
 %defattr(-,root,root,-)
@@ -58,5 +63,8 @@
 %{_mandir}/man3/*
 
 %changelog
+* Thu Jul  7 2005 Ignacio Vazquez-Abrams <ivazquez at ivazquez.net>
+- Added Per Bjornsson's hotplug files
+
 * Wed Jun 29 2005 Ignacio Vazquez-Abrams <ivazquez at ivazquez.net> 1.0.0.1-1
 - Initial RPM release




More information about the fedora-extras-commits mailing list