summaryrefslogtreecommitdiffstats
path: root/devel/linux-js/files
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2006-02-05 03:12:50 +0000
committerjylefort <jylefort@FreeBSD.org>2006-02-05 03:12:50 +0000
commit9560cd7d1aeb46d8d4112af478915ed0f361f035 (patch)
tree6f273430cae781b539c47049005087b1b9d49ef2 /devel/linux-js/files
parent44db02cf894e96d1e304508eae5814f0be346a49 (diff)
downloadFreeBSD-ports-9560cd7d1aeb46d8d4112af478915ed0f361f035.zip
FreeBSD-ports-9560cd7d1aeb46d8d4112af478915ed0f361f035.tar.gz
Add linux-js.
This port provides a FreeBSD kernel module implementing the Linux joystick interface (/dev/input/js0), as well as calibration (jscal) and test (jstest) utilities.
Diffstat (limited to 'devel/linux-js/files')
-rw-r--r--devel/linux-js/files/jscal.sh.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/devel/linux-js/files/jscal.sh.in b/devel/linux-js/files/jscal.sh.in
new file mode 100644
index 0000000..ebc4b5d
--- /dev/null
+++ b/devel/linux-js/files/jscal.sh.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: jscal
+# KEYWORD: shutdown
+
+jscal_enable=${jscal_enable-"NO"}
+jscal_device="/dev/input/js0"
+jscal_state="${jscal_state:-/var/db/jscal-state}"
+
+. %%RC_SUBR%%
+
+name="jscal"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/jscal"
+start_cmd="jscal_start"
+stop_cmd="jscal_stop"
+
+jscal_start()
+{
+ [ -f "$jscal_state" ] && . "$jscal_state" 2>/dev/null
+}
+
+jscal_stop()
+{
+ cal=`"$command" -p "$jscal_device" 2>/dev/null` && \
+ echo "$cal" | sed -e "s|^jscal|$command|" > $jscal_state
+}
+
+load_rc_config $name
+run_rc_command "$1"
OpenPOWER on IntegriCloud