summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-19 23:00:44 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-19 23:00:44 +0200
commit8447a332a4936fa1f146f14a6aa82eae0b0d3c47 (patch)
tree1feb3dbfcc58d39d6fe01d7c724ab705cb87ee29
parent5418e29ee6237b490af3480ff8c4a33fc20497b4 (diff)
downloadlibgphoto2-8447a332a4936fa1f146f14a6aa82eae0b0d3c47.tar.gz
Remove linux-hotplug support
The linux-hotplug mechanism has been replaced by udev and hwdb for quite some time now, so we can remove the support for packaging libgphoto2 with linux-hotplug. For a rough idea of the timeline of linux-hotplug being replaced, the last release of hotplug appears to have been in March of 2004: https://sourceforge.net/projects/linux-hotplug/files/ and the Fedora 5 (released March 20, 2006) release notes mention the hotplug package having been removed.
-rw-r--r--configure.ac1
-rw-r--r--packaging/Makefile.am2
-rw-r--r--packaging/linux-hotplug/90-gphoto-camera-policy.fdi19
-rw-r--r--packaging/linux-hotplug/Makefile.am10
-rw-r--r--packaging/linux-hotplug/gphoto-set-procperm39
-rwxr-xr-xpackaging/linux-hotplug/usbcam.console62
-rwxr-xr-xpackaging/linux-hotplug/usbcam.group51
-rw-r--r--packaging/linux-hotplug/usbcam.user47
-rw-r--r--packaging/linux-hotplug/usbcam.x11-app76
9 files changed, 1 insertions, 306 deletions
diff --git a/configure.ac b/configure.ac
index b8f23f4f0..1c293f93e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -649,7 +649,6 @@ libgphoto2-uninstalled.pc
examples/Makefile
tests/Makefile
packaging/Makefile
-packaging/linux-hotplug/Makefile
packaging/generic/Makefile
po/Makefile.in
doc/Makefile
diff --git a/packaging/Makefile.am b/packaging/Makefile.am
index e917b6772..b564eeefd 100644
--- a/packaging/Makefile.am
+++ b/packaging/Makefile.am
@@ -1 +1 @@
-SUBDIRS = linux-hotplug generic
+SUBDIRS = generic
diff --git a/packaging/linux-hotplug/90-gphoto-camera-policy.fdi b/packaging/linux-hotplug/90-gphoto-camera-policy.fdi
deleted file mode 100644
index c063848e1..000000000
--- a/packaging/linux-hotplug/90-gphoto-camera-policy.fdi
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
-
-<deviceinfo version="0.2">
-
- <device>
- <match key="info.capabilities" contains="camera">
- <match key="camera.access_method" string="libgphoto2">
- <append key="info.callouts.add" type="strlist">/usr/libexec/gphoto-set-procperm</append>
- </match>
- <match key="camera.access_method" string="proprietary">
- <append key="info.callouts.add" type="strlist">/usr/libexec/gphoto-set-procperm</append>
- </match>
- <match key="camera.access_method" string="ptp">
- <append key="info.callouts.add" type="strlist">/usr/libexec/gphoto-set-procperm</append>
- </match>
- </match>
- </device>
-
-</deviceinfo>
diff --git a/packaging/linux-hotplug/Makefile.am b/packaging/linux-hotplug/Makefile.am
deleted file mode 100644
index 3a10245c6..000000000
--- a/packaging/linux-hotplug/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-EXTRA_DIST = usbcam.console usbcam.group usbcam.user usbcam.x11-app \
- 90-gphoto-camera-policy.fdi gphoto-set-procperm
-
-# FIXME: This should only be built if target system is linux - not if
-# the building system is linux.
-if HAVE_LINUX
-
-hotplugdoc_DATA = usbcam.console usbcam.group usbcam.user usbcam.x11-app
-
-endif
diff --git a/packaging/linux-hotplug/gphoto-set-procperm b/packaging/linux-hotplug/gphoto-set-procperm
deleted file mode 100644
index 977cbf5aa..000000000
--- a/packaging/linux-hotplug/gphoto-set-procperm
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-#
-# This is taken from Fedora Core gphoto2 package.
-# http://cvs.fedora.redhat.com/viewcvs/*checkout*/devel/gphoto2/gphoto-set-procperm
-
-console_user=$(cat /var/run/console/console.lock)
-
-if [ -z "$console_user" ] ; then
- exit 1
-fi
-
-if [ -z "$HAL_PROP_USB_BUS_NUMBER" ] || [ -z "$HAL_PROP_USB_LINUX_DEVICE_NUMBER" ] ; then
- exit 1
-fi
-
-if [ "$HAL_PROP_USB_BUS_NUMBER" -lt 0 ] || [ "$HAL_PROP_USB_LINUX_DEVICE_NUMBER" -lt 0 ] ; then
- exit 1
-fi
-
-
-bus_num=$(printf %.3u "$HAL_PROP_USB_BUS_NUMBER")
-dev_num=$(printf %.3u "$HAL_PROP_USB_LINUX_DEVICE_NUMBER")
-
-chown "$console_user" /proc/bus/usb/"$bus_num"/"$dev_num"
diff --git a/packaging/linux-hotplug/usbcam.console b/packaging/linux-hotplug/usbcam.console
deleted file mode 100755
index 7ac6dc5a6..000000000
--- a/packaging/linux-hotplug/usbcam.console
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-#
-# $Id$
-#
-# /etc/hotplug/usb/usbcam
-#
-# Sets up newly plugged in USB camera 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/usermap that corresponds to the
-# camera you are using. You can get the correct lines for all cameras
-# supported by libgphoto2 by running
-# $ print-camera-list usb-usermap usbcam
-# 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/)
-#
-# In the usermap file, the first field "usb module" should be named
-# "usbcam" 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@redhat.com>
- CONSOLEOWNER=""
- for conlock in \
- /var/run/console.lock \
- /var/run/console/console.lock \
- /var/lock/console.lock
- do
- if [ -f "$conlock" ]; then
- CONSOLEOWNER=$(cat $conlock)
- fi
- done
- if [ -n "$CONSOLEOWNER" ]
- then
- chmod 0000 "${DEVICE}"
- chown "$CONSOLEOWNER" "${DEVICE}"
- chmod 0600 "${DEVICE}"
- fi
-fi
diff --git a/packaging/linux-hotplug/usbcam.group b/packaging/linux-hotplug/usbcam.group
deleted file mode 100755
index 8761facc0..000000000
--- a/packaging/linux-hotplug/usbcam.group
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-#
-# $Id$
-#
-# /etc/hotplug/usb/usbcam
-#
-# Sets up newly plugged in USB camera so that only members of the
-# group
-
-GROUP=camera
-
-# can access it from user space. (Replace camera with the name of the
-# group you want to have access to the cameras.)
-#
-# 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 libgphoto2 by running
-# $ print-camera-list usb-usermap usbcam
-# 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.
-#
-
-[ -z "${DEVICE}" ] && DEVICE="${DEVNAME}"
-
-if [ "${ACTION}" = "add" ] && [ -e "${DEVICE}" ]
-then
- chmod o-rwx "${DEVICE}"
- chgrp "${GROUP}" "${DEVICE}"
- chmod g+rw "${DEVICE}"
-fi
diff --git a/packaging/linux-hotplug/usbcam.user b/packaging/linux-hotplug/usbcam.user
deleted file mode 100644
index a3ba71a7c..000000000
--- a/packaging/linux-hotplug/usbcam.user
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-#
-# $Id$
-#
-# /etc/hotplug/usb/usbcam
-#
-# Sets up newly plugged in USB camera so that just one certain user
-
-USER=root
-
-# can access it from user space. (Replace root with the user you want
-# to have access to the cameras.)
-#
-# 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 libgphoto2 by running
-# $ print-camera-list usb-usermap usbcam
-# b) run your camera software as the user given above
-# 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
- chmod a-rwx "${DEVICE}"
- chown "${USER}" "${DEVICE}"
- chmod u+rw "${DEVICE}"
-fi
diff --git a/packaging/linux-hotplug/usbcam.x11-app b/packaging/linux-hotplug/usbcam.x11-app
deleted file mode 100644
index 618e7dbd9..000000000
--- a/packaging/linux-hotplug/usbcam.x11-app
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-#
-# $Id$
-#
-# /etc/hotplug/usb/usbcam
-#
-# Sets up newly plugged in USB camera so that just one certain user
-
-USER=root
-
-# can access it from user space. (Replace root by the user you want
-# to have access to the cameras.)
-
-# It then runs the X11 application (gtkam is used as an example)
-
-X11_APP=/usr/bin/gtkam
-
-# on the X11 display (:0 should work on most single user workstations)
-
-DISPLAY=:0
-
-# in the directory (~$USER is just the user's home directory)
-
-DIRECTORY=~$USER
-
-#
-# 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 libgphoto2 by running
-# $ print-camera-list usb-usermap usbcam
-# b) run your camera software as the user given above
-# c) a Linux kernel supporting hotplug and usbdevfs
-# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
-# e) su
-# f) env
-# g) X11
-#
-# In the usermap file, the first field "usb module" should be named
-# "usbcam" like this script.
-#
-# Script written by Trevor Woerner but slightly adapted for inclusion
-# into libgphoto2.
-
-SU=/bin/su
-ENV=/usr/bin/env
-
-if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
-then
- chmod a-rwx "${DEVICE}"
- chown "${USER}" "${DEVICE}"
- chmod u+rw "${DEVICE}"
-
- if [ "${USER}" != "root" ]
- then
- # we don't want to run this as root. definitely not.
- cd "${DIRECTORY}" || exit 1
- usrhome=~${USER}
- "${SU}" "${USER}" -c "${ENV} DISPLAY=${DISPLAY} HOME=${usrhome} ${X11_APP}"
- fi
-fi