From 9600db33438dd032098ef9777963d1b88e728713 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Mon, 23 Jun 2008 18:06:40 +0000 Subject: [PATCH] - Drop resume switch patch, no longer required - Add support for config option style used by gnome-lirc-properties (#442341) --- lirc-add-resume-switch-to-irrecord.patch | 109 ----------------------- lirc.init | 33 ++++++- lirc.spec | 8 +- lirc.sysconfig | 16 +++- 4 files changed, 50 insertions(+), 116 deletions(-) delete mode 100644 lirc-add-resume-switch-to-irrecord.patch diff --git a/lirc-add-resume-switch-to-irrecord.patch b/lirc-add-resume-switch-to-irrecord.patch deleted file mode 100644 index fc234f4..0000000 --- a/lirc-add-resume-switch-to-irrecord.patch +++ /dev/null @@ -1,109 +0,0 @@ -From d5f3f9853d87c319c33ade71811c225db11855f7 Mon Sep 17 00:00:00 2001 -From: Mathias Hasselmann -Date: Wed, 13 Feb 2008 21:23:43 +0100 -Subject: Add --resume switch to irrecord. - -This switch asks irrecord to take hardware parameters from the provided -template file, instead of trying to interactively discover them. - -This change is needed for gnome-lirc-properties to allow it having a -self-contained key-code learning mode, that's consistent with -gnome-keybinding-properties. - -The 'remotes==NULL' check for LIRC_MODE_MODE2 seems to indicate, that its -author had a similar behaviour in mind. Still I prefer having that switch, -instead of silently switching to --resume behaviour when a templates file -was found, for backwards compability and for being able to detect that -feature. ---- - daemons/irrecord.c | 17 ++++++++++++----- - 1 files changed, 12 insertions(+), 5 deletions(-) - -diff --git a/daemons/irrecord.c b/daemons/irrecord.c -index df03c7b..a2420a8 100644 ---- a/daemons/irrecord.c -+++ b/daemons/irrecord.c -@@ -192,6 +192,7 @@ int main(int argc,char **argv) - lirc_t min_remaining_gap, max_remaining_gap; - int force; - int retries; -+ int resume; - struct ir_remote *remotes=NULL; - char *device=NULL; - #ifdef DEBUG -@@ -200,6 +201,7 @@ int main(int argc,char **argv) - - progname=argv[0]; - force=0; -+ resume=0; - hw_choose_driver(NULL); - while(1) - { -@@ -211,6 +213,7 @@ int main(int argc,char **argv) - {"device",required_argument,NULL,'d'}, - {"driver",required_argument,NULL,'H'}, - {"force",no_argument,NULL,'f'}, -+ {"resume",no_argument,NULL,'r'}, - #ifdef DEBUG - {"pre",no_argument,NULL,'p'}, - {"post",no_argument,NULL,'P'}, -@@ -221,9 +224,9 @@ int main(int argc,char **argv) - {0, 0, 0, 0} - }; - #ifdef DEBUG -- c = getopt_long(argc,argv,"hvd:H:fpPtiT",long_options,NULL); -+ c = getopt_long(argc,argv,"hvd:H:frpPtiT",long_options,NULL); - #else -- c = getopt_long(argc,argv,"hvd:H:f",long_options,NULL); -+ c = getopt_long(argc,argv,"hvd:H:fr",long_options,NULL); - #endif - if(c==-1) - break; -@@ -234,6 +237,7 @@ int main(int argc,char **argv) - printf("\t -h --help\t\tdisplay this message\n"); - printf("\t -v --version\t\tdisplay version\n"); - printf("\t -f --force\t\tforce raw mode\n"); -+ printf("\t -r --resume\t\tcontinue recording\n"); - printf("\t -H --driver=driver\tuse given driver\n"); - printf("\t -d --device=device\tread from given device\n"); - exit(EXIT_SUCCESS); -@@ -254,6 +258,9 @@ int main(int argc,char **argv) - case 'f': - force=1; - break; -+ case 'r': -+ resume=1; -+ break; - #ifdef DEBUG - case 'p': - get_pre=1; -@@ -460,7 +467,7 @@ int main(int argc,char **argv) - switch(hw.rec_mode) - { - case LIRC_MODE_MODE2: -- if(remotes==NULL && !get_lengths(&remote,force)) -+ if((!remotes || !resume) && !get_lengths(&remote,force)) - { - if(remote.gap==0) - { -@@ -494,7 +501,7 @@ int main(int argc,char **argv) - case LIRC_MODE_LIRCCODE: - if(hw.rec_mode==LIRC_MODE_CODE) remote.bits=CHAR_BIT; - else remote.bits=hw.code_length; -- if(!get_gap_length(&remote)) -+ if((!remotes || !resume) && !get_gap_length(&remote)) - { - fprintf(stderr,"%s: gap not found," - " can't continue\n",progname); -@@ -767,7 +774,7 @@ int main(int argc,char **argv) - exit(EXIT_FAILURE); - } - -- if(!has_toggle_bit_mask(remotes)) -+ if((!remotes || !resume) && !has_toggle_bit_mask(remotes)) - { - get_toggle_bit_mask(remotes); - } --- -1.5.3.7 - diff --git a/lirc.init b/lirc.init index 4946651..b68b6ad 100644 --- a/lirc.init +++ b/lirc.init @@ -30,9 +30,40 @@ prog2=$(basename $exec2) lockfile=/var/lock/subsys/lirc +build_lirc_args () +{ + local LIRC_ARGS="$*" + + # For remote only detection support, we need + # LIRC_DEVICE undefined + if [ -z "$LIRC_DEVICE" ] ; then + for dev in /dev/lirc0; do + if [ -c $dev ]; then + LIRC_DEVICE="$dev" + break + fi + done + fi + + # If we have a LIRC_DEVICE or LIRC_DRIVER defined (either because + # no devices were defined, OR if we explicitly did), then + # populate LIRC_ARGS + if [ ! -z "$LIRC_DEVICE" ] || [ ! -z "$LIRC_DRIVER" ]; then + if [ -n "$LIRC_DEVICE" ] && [ "$LIRC_DEVICE" != "none" ]; then + LIRC_ARGS="--device=$LIRC_DEVICE $LIRC_ARGS" + fi + if [ -n "$LIRC_DRIVER" ] && [ "$LIRC_DRIVER" != "none" ]; then + LIRC_ARGS="--driver=$LIRC_DRIVER $LIRC_ARGS" + fi + fi + echo $LIRC_ARGS +} + start() { + LIRC_ARGS=`build_lirc_args $LIRC_ARGS` + echo -n $"Starting infrared remote control daemon ($prog): " - daemon $exec $LIRCD_OPTIONS + daemon $exec $LIRC_ARGS $LIRCD_OPTIONS retval=$? echo status $prog >/dev/null 2>&1 diff --git a/lirc.spec b/lirc.spec index 9def1c4..30a95eb 100644 --- a/lirc.spec +++ b/lirc.spec @@ -18,7 +18,7 @@ Name: lirc Version: 0.8.3 -Release: 3%{?pre:.%{pre}}%{?dist} +Release: 4%{?pre:.%{pre}}%{?dist} Summary: The Linux Infrared Remote Control package Group: System Environment/Daemons @@ -31,7 +31,6 @@ Source2: %{name}.sysconfig Patch0: lirc-0.8.3-remote-includes-directive.patch Patch1: lirc-0.8.3-validate-transmit-buffer.patch Patch2: lirc-use-new-instead-of-conf-as-filename-suffix.patch -Patch3: lirc-add-resume-switch-to-irrecord.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: %{__perl} @@ -116,7 +115,6 @@ of remote control configuration files. %patch0 -p1 -b .incl %patch1 -p1 -b .xbuf %patch2 -p1 -b .suf -%patch3 -p1 -b .res chmod 644 contrib/* @@ -260,6 +258,10 @@ fi %changelog +* Mon Jun 23 2008 Jarod Wilson - 0.8.3-4 +- Drop resume switch patch, no longer required +- Add support for config option style used by gnome-lirc-properties (#442341) + * Mon Jun 02 2008 Jarod Wilson - 0.8.3-3 - Add additional required patches for gnome-lirc-properties (#442248) - Put remote definitions in their own sub-package (#442328) diff --git a/lirc.sysconfig b/lirc.sysconfig index 049e13f..a9ce795 100644 --- a/lirc.sysconfig +++ b/lirc.sysconfig @@ -1,13 +1,23 @@ # Note: in addition to these parameters, you need to have working -*- sh -*- # configuration file for lircd (and lircmd if enabled). -# Options to lircd(8). Typically, at least a remote controller driver -# ("-H foo") needs to be specified here. Run "/usr/sbin/lircd -H help" to get -# a listing of supported drivers. +# Options to lircd(8). Typically, this will be empty, as which driver to use +# should be specified using the LIRC_DRIVER variable below. LIRCD_OPTIONS="" +# The infrared receiver (and/or transmitter) driver to be used by lircd(8), +# similar to passing "-H driver" to lircd(8). +# Run "/usr/sbin/lircd -H help" to get a listing of supported drivers. +LIRC_DRIVER="" + +# Which lirc device will be used by lircd(8). +# This is the same as passing "-d device" to lircd. +# An empty value will use the default /dev/lirc device. +LIRC_DEVICE="" + # If "yes", the init script will try to start lircmd(8) too. ENABLE_LIRCMD="no" # Options to lircmd(8). LIRCMD_OPTIONS="" +