[gnome-lirc-properties] Detect start-up style



commit bccf941c9ebbd647b77ee36f7c05c96f9f110dca
Author: Bastien Nocera <hadess hadess net>
Date:   Mon May 17 11:43:38 2010 +0100

    Detect start-up style
    
    Allow for 2 different code paths depending on whether the system
    uses chkconfig (Fedora), or requires hardware.conf changes (Debian)
    to get lircd to start up.

 configure.ac                       |   13 +++++++++++++
 gnome_lirc_properties/config.py.in |    2 ++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 84f91f8..cf4c033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,11 +92,13 @@ if test -f /etc/fedora-release ; then
 	remotes_database="/usr/share/lirc-remotes"
 	lircd_socket="/var/run/lirc/lircd"
 	lirc_hardware_conf="/etc/sysconfig/lirc"
+	startup_style="fedora"
 else
 	lirc_confdir="$sysconfdir/lirc"
 	remotes_database="$datadir/lirc/remotes"
 	lircd_socket="/dev/lircd"
 	lirc_hardware_conf="$lirc_confdir/hardware.conf"
+	startup_style="debian"
 fi
 
 AC_ARG_WITH([lirc_confdir],
@@ -119,10 +121,20 @@ AC_ARG_WITH([lirc_conf],
 			   [Path of the system's lirc configuration file, e.g. /etc/lirc/hardware.conf]),
             [], [with_lirc_hardware_conf=`expand_vars "$lirc_hardware_conf"`])
 
+AC_ARG_WITH([startup_style],
+            AS_HELP_STRING([--with-startup-style],
+			   [Whether to use Fedora or Debian style startup (either debian, or fedora)]),
+            [], [with_startup_style=`expand_vars "$startup_style"`])
+
+if test x$with_startup_style != xfedora -a x$startup_style != xdebian ; then
+	AC_MSG_ERROR([Startup style must be one of debian or fedora])
+fi
+
 AC_SUBST([with_lirc_confdir])
 AC_SUBST([with_remotes_database])
 AC_SUBST([with_lircd_socket])
 AC_SUBST([with_lirc_hardware_conf])
+AC_SUBST([with_startup_style])
 
 AC_MSG_CHECKING([configured LIRC configuration folder])
 
@@ -218,6 +230,7 @@ AC_MSG_NOTICE([  IR record tool: $LIRC_IRRECORD])
 AC_MSG_NOTICE([  LIRC configuration directory: $with_lirc_confdir])
 AC_MSG_NOTICE([  LIRC configuration file: $with_lirc_hardware_conf])
 AC_MSG_NOTICE([  LIRCd socket: $with_lircd_socket])
+AC_MSG_NOTICE([  Startup style: $with_startup_style])
 AC_MSG_NOTICE([  Download URI: $with_download_uri])
 AC_MSG_NOTICE([  Upload URI: $with_upload_uri])
 AC_MSG_NOTICE([=====================================================================])
diff --git a/gnome_lirc_properties/config.py.in b/gnome_lirc_properties/config.py.in
index d8a7b6f..f5e2445 100644
--- a/gnome_lirc_properties/config.py.in
+++ b/gnome_lirc_properties/config.py.in
@@ -26,5 +26,7 @@ LIRC_INPUT_DRIVER     = '@devinput_driver@'
 URI_UPLOADS           = '@with_upload_uri@'
 URI_UPDATES           = '@with_download_uri@'
 
+STARTUP_STYLE         = '@with_startup_style@'
+
 # remove temporary objects from namespace
 del path



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