summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <gp@n-dimensional.de>2001-10-22 17:43:56 +0000
committerHans Ulrich Niedermann <gp@n-dimensional.de>2001-10-22 17:43:56 +0000
commit2170e995920a2fec60611617b2dd737ee711e3a9 (patch)
treed9388c3f550283f40c2dfdceaa34c36256e24067 /packaging
parentb1b9c3a7a51e7d1ed16bfd620c820cad43ac8573 (diff)
downloadlibgphoto2-2170e995920a2fec60611617b2dd737ee711e3a9.tar.gz
2001-10-21 Hans Ulrich Niedermann <gp@n-dimensional.de>
* packages/usbcam.group: added. linux-hotplug script * packages/usbcam.console: added. linux-hotplug script * packages/Makefile.am: added. * packages/.cvsignore: added. * gphoto.spec.in: simplified a bit (only gphoto and gphoto-devel, no lib* packages any more). added hotplug support. * configure.in: added packaging/ * Makefile.am: added packaging/, added .tar.bz2 dist support git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2695 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'packaging')
-rw-r--r--packaging/.cvsignore3
-rw-r--r--packaging/Makefile.am1
-rwxr-xr-xpackaging/usbcam.console27
-rwxr-xr-xpackaging/usbcam.group26
4 files changed, 57 insertions, 0 deletions
diff --git a/packaging/.cvsignore b/packaging/.cvsignore
new file mode 100644
index 000000000..a4dd7b842
--- /dev/null
+++ b/packaging/.cvsignore
@@ -0,0 +1,3 @@
+*~ .*~
+Makefile
+Makefile.in
diff --git a/packaging/Makefile.am b/packaging/Makefile.am
new file mode 100644
index 000000000..e81a744fb
--- /dev/null
+++ b/packaging/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = usbcam.console usbcam.group
diff --git a/packaging/usbcam.console b/packaging/usbcam.console
new file mode 100755
index 000000000..1b51fb703
--- /dev/null
+++ b/packaging/usbcam.console
@@ -0,0 +1,27 @@
+#!/bin/bash
+# $Id$
+#
+# /etc/hotplug/usb/usbcam
+#
+# Sets up newly plugged in USB camera so that the user who owns
+# /dev/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/usermap that corresponds to the
+# camera you are using. You can get the correct lines for all cameras
+# supported by gphoto2 by running "gphoto2 --print-usb-usermap".
+# b) a setup using pam_console that chown's /dev/console to the
+# user currently using the "console"
+# 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
+# "usbcam" like this script.
+#
+
+if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
+then
+ user="$(ls -l /dev/console | awk '/\/dev\/console$/ { print $3; }')"
+ chown "${user}" "${DEVICE}"
+ chmod 0600 "${DEVICE}"
+fi
diff --git a/packaging/usbcam.group b/packaging/usbcam.group
new file mode 100755
index 000000000..980a2fe12
--- /dev/null
+++ b/packaging/usbcam.group
@@ -0,0 +1,26 @@
+#!/bin/bash
+# $Id$
+#
+# /etc/hotplug/usb/usbcam
+#
+# Sets up newly plugged in USB camera so that group "camera"
+# 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/usermap that corresponds to the
+# camera you are using. You can get the correct lines for all cameras
+# supported by gphoto2 by running "gphoto2 --print-usb-usermap".
+# b) a group "camera" where all users allowed access to the
+# camera are listed
+# 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
+# "usbcam" like this script.
+#
+
+if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
+then
+ chgrp camera "${DEVICE}"
+ chmod g+rw "${DEVICE}"
+fi