gpm: Add gpm init script
authorRaymond Danks <raymond@edanks.com>
Tue, 18 Apr 2006 01:33:13 +0000 (01:33 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Tue, 18 Apr 2006 01:33:13 +0000 (01:33 +0000)
packages/gpm/gpm-1.20.1/init [new file with mode: 0644]
packages/gpm/gpm_1.20.1.bb

diff --git a/packages/gpm/gpm-1.20.1/init b/packages/gpm/gpm-1.20.1/init
new file mode 100644 (file)
index 0000000..bb6e4a3
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh i-e 
+
+# Grab the common functions
+. /etc/init.d/functions
+
+# FIXME: 
+# Add a configuration file for GPM here
+
+test -x /bin/gpm || exit 0
+
+case "$1" in
+  start)
+    if [ ! -p /dev/gpmdata ]; then
+       mkfifo /dev/gpmdata
+    fi
+
+    action "Starting GPM:" start-stop-daemon -S -x /bin/gpm -- -R -m /dev/mouse -t imps2
+    ;;
+  stop)
+    action "Stopping GPM:" start-stop-daemon -K -x /bin/gpm
+    ;;
+  restart|force-reload) 
+    $0 stop
+    $0 start
+    ;;
+  *)
+    usage /etc/init.d/gpm
+esac
+
+exit 0
index 2ceea6f..5623ebb 100644 (file)
@@ -5,9 +5,13 @@ DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
 for the console and xterm, with sample clients included \
 (emacs, etc)."
 
+PR="r1"
+PARALLEL_MAKE=""
+
 SRC_URI = "ftp://arcana.linux.it/pub/gpm/gpm-${PV}.tar.bz2 \
           file://configure.patch;patch=1 \
-          file://no-docs.patch;patch=1"
+          file://no-docs.patch;patch=1 \
+          file://init"
 
 inherit autotools
 
@@ -23,4 +27,20 @@ do_stage () {
 
 do_install () {
        oe_runmake 'ROOT=${D}' install
+       install -d ${D}/${sysconfdir}/init.d
+       install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
+}
+
+pkg_postinst () {
+       if test -n "${D}"; then
+               D="-r $D"
+       fi
+       update-rc.d $D gpm defaults
+}
+
+pkg_prerm () {
+       if test -n "${D}"; then
+               D="-r $D"
+       fi
+       update-rc.d $D gpm remove
 }