summaryrefslogtreecommitdiff
path: root/community/inputattach
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/inputattach
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/inputattach')
-rw-r--r--community/inputattach/PKGBUILD31
-rw-r--r--community/inputattach/inputattach.conf.d11
-rw-r--r--community/inputattach/inputattach.install9
-rw-r--r--community/inputattach/inputattach.rc.d63
4 files changed, 114 insertions, 0 deletions
diff --git a/community/inputattach/PKGBUILD b/community/inputattach/PKGBUILD
new file mode 100644
index 000000000..54b3af023
--- /dev/null
+++ b/community/inputattach/PKGBUILD
@@ -0,0 +1,31 @@
+# Contributor: Mark Smith <markzzzsmith@yahoo.com.au>
+
+pkgname=inputattach
+pkgver=1.24
+pkgrel=2
+pkgdesc="Attach serial mice, keyboards and other input devices to the kernel input system"
+arch=('i686' 'x86_64')
+url="http://linuxconsole.sourceforge.net/"
+license=('GPL')
+depends=('glibc' 'bash')
+makedepends=('gcc')
+backup=(etc/conf.d/inputattach.conf)
+install=inputattach.install
+source=('http://kernel.org/pub/linux/kernel/people/dtor/inputattach.c'
+ 'http://kernel.org/pub/linux/kernel/people/dtor/serio-ids.h'
+ 'inputattach.conf.d'
+ 'inputattach.rc.d')
+md5sums=('eb595a766ca363edb3b14c25404596ce'
+ '93d34d96cd3ad19ea1aeca7f68a66b4a'
+ 'ca36071f8384314c037e1e8b15c63afe'
+ 'd484778b0464e25b22cda89ac7fed156')
+
+build() {
+ cc $CFLAGS inputattach.c -o inputattach || return 1
+
+ install -D -m755 inputattach $startdir/pkg/usr/sbin/inputattach && \
+ install -D -m644 $startdir/src/inputattach.conf.d \
+ $startdir/pkg/etc/conf.d/inputattach.conf && \
+ install -D -m755 $startdir/src/inputattach.rc.d \
+ $startdir/pkg/etc/rc.d/inputattach
+}
diff --git a/community/inputattach/inputattach.conf.d b/community/inputattach/inputattach.conf.d
new file mode 100644
index 000000000..1e04240fa
--- /dev/null
+++ b/community/inputattach/inputattach.conf.d
@@ -0,0 +1,11 @@
+#
+# Configuration for inputattach
+#
+
+# inputattach mode - see 'inputattach --help' for list e.g. "--microsoft" for
+# 2 button Microsoft mouse
+IAMODE="--microsoft"
+
+# inputattach device - /dev file entry where device is attached e.g.
+# "/dev/ttyS0" for device attached to first system serial port
+IADEV="/dev/ttyS0"
diff --git a/community/inputattach/inputattach.install b/community/inputattach/inputattach.install
new file mode 100644
index 000000000..965958b6b
--- /dev/null
+++ b/community/inputattach/inputattach.install
@@ -0,0 +1,9 @@
+## arg 1: the new package version
+post_install() {
+ cat << EOF
+
+The correct device mode and /dev device file will need to be set in
+/etc/conf.d/inputattach.conf before starting /etc/rc.d/inputattach
+
+EOF
+}
diff --git a/community/inputattach/inputattach.rc.d b/community/inputattach/inputattach.rc.d
new file mode 100644
index 000000000..7f260f9f8
--- /dev/null
+++ b/community/inputattach/inputattach.rc.d
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+daemon_name=inputattach
+
+. /etc/rc.conf
+
+. /etc/conf.d/$daemon_name.conf
+
+. /etc/rc.d/functions
+
+get_pid() {
+ pidof $daemon_name
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting $daemon_name daemon"
+
+ PID=`get_pid`
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
+ # RUN
+ $daemon_name --daemon $IAMODE $IADEV
+ #
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ echo `get_pid` > /var/run/$daemon_name.pid
+ add_daemon $daemon_name
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping $daemon_name daemon"
+ PID=`get_pid`
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/$daemon_name.pid &> /dev/null
+ rm_daemon $daemon_name
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0