[Lunar-commits] <moonbase> lirc: major cleanup
Michael 'v4hn' Goerner
v4hn at lunar-linux.org
Sun May 27 17:28:17 CEST 2012
commit 811c12a27ea27a40ad62e383c9fa1a433882a6b4
Author: Michael 'v4hn' Goerner <v4hn at lunar-linux.org>
Date: Sun May 27 15:26:06 2012 +0200
lirc: major cleanup
Wow, we still had some junk from Sourcerer in here...
Someone should write a system.d file for this module.
---
utils/lirc/BUILD | 43 +++++--------------------------------------
utils/lirc/CONFIGURE | 1 -
utils/lirc/POST_INSTALL | 7 -------
utils/lirc/PRE_BUILD | 16 ++++++++++++++++
utils/lirc/PRE_REMOVE | 3 ---
utils/lirc/init.d/lirc | 25 +++++++++++++++++++++++++
utils/lirc/lirc.sh | 20 --------------------
7 files changed, 46 insertions(+), 69 deletions(-)
diff --git a/utils/lirc/BUILD b/utils/lirc/BUILD
index 3328b72..6e1ee53 100644
--- a/utils/lirc/BUILD
+++ b/utils/lirc/BUILD
@@ -1,46 +1,13 @@
-
- if [ -e $CONFIG_CACHE/.config-$SPELL-.setup.config ]; then
- cp $CONFIG_CACHE/.config-$SPELL-.setup.config .setup.config
- cp $CONFIG_CACHE/.config-$SPELL-configure.sh configure.sh
- if query "Re-Configure" n
- then ./setup.sh
- else true
- fi
- else
- ./setup.sh
- fi
-
- cp .setup.config $CONFIG_CACHE/.config-$SPELL-.setup.config
- cp configure.sh $CONFIG_CACHE/.config-$SPELL-configure.sh
-
(
./configure.sh --build=$BUILD \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
$OPTS &&
- default_make
- cp contrib/lircmd.conf /usr/share/doc/lirc/
- cp contrib/lircd.conf /usr/share/doc/lirc/
- cp contrib/lircrc /usr/share/doc/lirc/
-
-) > $C_FIFO 2>&1 && (
-
- case $LIRC_BOOT in
- y|Y|j|J) [ -f /etc/init.d/lirc.sh ] ||
- cp $SCRIPT_DIRECTORY/lirc.sh /etc/init.d
-
- ln -sf ../init.d/lirc.sh /etc/rc0.d/K51lirc
- ln -sf ../init.d/lirc.sh /etc/rc1.d/K51lirc
- ln -sf ../init.d/lirc.sh /etc/rc2.d/K51lirc
- ln -sf ../init.d/lirc.sh /etc/rc6.d/K51lirc
-
- ln -sf ../init.d/lirc.sh /etc/rc3.d/S51lirc
- ln -sf ../init.d/lirc.sh /etc/rc4.d/S51lirc
- ln -sf ../init.d/lirc.sh /etc/rc5.d/S51lirc
- ;;
+ default_make &&
- *) true ;;
- esac
+ install -D -m0644 contrib/lircmd.conf /usr/share/doc/lirc/lircmd.conf &&
+ install -D -m0644 contrib/lircd.conf /usr/share/doc/lirc/lircd.conf &&
+ install -D -m0644 contrib/lircrc /usr/share/doc/lirc/lircrc
-)
+) > $C_FIFO 2>&1
diff --git a/utils/lirc/CONFIGURE b/utils/lirc/CONFIGURE
deleted file mode 100644
index e8c21a6..0000000
--- a/utils/lirc/CONFIGURE
+++ /dev/null
@@ -1 +0,0 @@
-mquery LIRC_BOOT "Invoke Lirc during boot?" y
diff --git a/utils/lirc/POST_INSTALL b/utils/lirc/POST_INSTALL
deleted file mode 100644
index c744300..0000000
--- a/utils/lirc/POST_INSTALL
+++ /dev/null
@@ -1,7 +0,0 @@
-if [ -x /etc/init.d/lirc.sh ]; then
- if ! [ -x /var/run/lirc/lircd.pid ]; then
- /etc/init.d/lirc.sh start
- else
- /etc/init.d/lirc.sh restart
- fi
-fi
diff --git a/utils/lirc/PRE_BUILD b/utils/lirc/PRE_BUILD
new file mode 100644
index 0000000..47f50eb
--- /dev/null
+++ b/utils/lirc/PRE_BUILD
@@ -0,0 +1,16 @@
+default_pre_build &&
+
+cd $SOURCE_DIRECTORY &&
+
+if [ -e $CONFIG_CACHE/.config-$MODULE-.setup.config ]; then
+ cp $CONFIG_CACHE/.config-$MODULE-.setup.config .setup.config &&
+ cp $CONFIG_CACHE/.config-$MODULE-configure.sh configure.sh &&
+ if query "Re-Configure" n; then
+ ./setup.sh
+ fi
+else
+ ./setup.sh
+fi &&
+
+cp .setup.config $CONFIG_CACHE/.config-$MODULE-.setup.config &&
+cp configure.sh $CONFIG_CACHE/.config-$MODULE-configure.sh
diff --git a/utils/lirc/PRE_REMOVE b/utils/lirc/PRE_REMOVE
deleted file mode 100644
index 1484e87..0000000
--- a/utils/lirc/PRE_REMOVE
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ -x /etc/init.d/lirc.sh ]; then
- /etc/init.d/lirc.sh stop
-fi
diff --git a/utils/lirc/init.d/lirc b/utils/lirc/init.d/lirc
new file mode 100755
index 0000000..063fc8c
--- /dev/null
+++ b/utils/lirc/init.d/lirc
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# lircd lirc daemon
+#
+# chkconfig: 2345 80 20
+# description: Infra-red remote control daemon
+# processname: lircd
+## config: /etc/lircd.conf
+# pidfile: /var/run/lircd.pid
+
+
+case "$1" in
+ start|restart) echo "$1ing lircd deamon."
+ pkill "^lircmd$"
+ pkill "^lircd$"
+ /usr/sbin/lircd --device=/dev/lirc
+ /usr/sbin/lircmd
+ ;;
+ stop) echo "$1ing down lircd deamon."
+ pkill "^lircmd$"
+ pkill "^lircd$"
+ ;;
+ *) echo "Usage: $0 {start|restart|stop}"
+ ;;
+esac
diff --git a/utils/lirc/lirc.sh b/utils/lirc/lirc.sh
deleted file mode 100755
index d429af4..0000000
--- a/utils/lirc/lirc.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# /sin/init.d/lircd.sh
-#
-
-case "$1" in
- start|restart) echo "$1ing lircd deamon."
- pkill "^lircmd$"
- pkill "^lircd$"
- /usr/sbin/lircd --device=/dev/lirc
- /usr/sbin/lircmd
- ;;
- stop) echo "$1ing down lircd deamon."
- pkill "^lircmd$"
- pkill "^lircd$"
- ;;
- *) echo "Usage: $0 {start|restart|stop}"
- ;;
-esac
-
More information about the Lunar-commits
mailing list