[gnome-lirc-properties] Make lircd socket location configurable



commit d3119438fbe7b58862a9e9679c56ee3972e1ad79
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 14 14:51:54 2009 +0100

    Make lircd socket location configurable
    
    So that we can set it correctly for Fedora, where it
    doesn't live in /dev/ anymore.

 configure.ac                       |   11 +++++++++++
 gnome_lirc_properties/config.py.in |    1 +
 gnome_lirc_properties/lirc.py      |    2 +-
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 52e0387..c547067 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,9 +91,11 @@ expand_vars() {
 if test -f /etc/fedora-release ; then
 	lirc_confdir="/etc"
 	remotes_database="/usr/share/lirc-remotes"
+	lircd_socket="/var/run/lirc/lircd"
 else
 	lirc_confdir="$sysconfdir/lirc"
 	remotes_database="$datadir/lirc/remotes"
+	lircd_socket="/dev/lircd"
 fi
 
 AC_ARG_WITH([lirc_confdir],
@@ -106,8 +108,14 @@ AC_ARG_WITH([remotes_database],
                            [Path of the system's LIRC remote database, e.g. $datadir/lirc/remotes]),
             [], [with_remotes_database=`expand_vars "$remotes_database"`])
 
+AC_ARG_WITH([lircd_socket],
+            AS_HELP_STRING([--with-lircd-socket],
+                           [Path of the system's LIRCD socket, e.g. /dev/lircd]),
+            [], [with_lircd_socket=`expand_vars "$lircd_socket"`])
+
 AC_SUBST([with_lirc_confdir])
 AC_SUBST([with_remotes_database])
+AC_SUBST([with_lircd_socket])
 
 AC_MSG_CHECKING([configured LIRC configuration folder])
 
@@ -139,6 +147,9 @@ else
   AC_MSG_ERROR([Configured remotes database does not exist: $with_remotes_database])
 fi
 
+AC_MSG_CHECKING([configured LIRCD socket])
+AC_MSG_RESULT([$with_lircd_socket])
+
 dnl support custom upload and download locations ===
 
 AC_ARG_WITH([download_uri],
diff --git a/gnome_lirc_properties/config.py.in b/gnome_lirc_properties/config.py.in
index 69b232c..eeeda1c 100644
--- a/gnome_lirc_properties/config.py.in
+++ b/gnome_lirc_properties/config.py.in
@@ -11,6 +11,7 @@ POLICY_KIT_ACTION     = 'org.gnome.lirc-properties.mechanism.configure'
 PACKAGE_DIR           = path.join('@prefix@', 'share', '@PACKAGE@')
 
 LIRC_CONFDIR          = '@with_lirc_confdir@'
+LIRCD_SOCKET          = '@with_lircd_socket@'
 
 LIRC_HARDWARE_CONF    = path.join(LIRC_CONFDIR, 'hardware.conf')
 LIRC_REMOTE_CONF      = path.join(LIRC_CONFDIR, 'lircd.conf.gnome')
diff --git a/gnome_lirc_properties/lirc.py b/gnome_lirc_properties/lirc.py
index d7d0ca2..41150aa 100644
--- a/gnome_lirc_properties/lirc.py
+++ b/gnome_lirc_properties/lirc.py
@@ -846,7 +846,7 @@ class KeyListener(gobject.GObject):
             tuple()),
     }
 
-    def __init__(self, socket_name='/dev/lircd'):
+    def __init__(self, socket_name=config.LIRCD_SOCKET):
         # pylint: disable-msg=E1002
         super(KeyListener, self).__init__()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]