1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-29 10:18:30 +00:00

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.
This commit is contained in:
Jean-Yves Lefort 2006-02-05 03:12:50 +00:00
parent d766afeb2f
commit f52cd3aa81
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=155238
7 changed files with 122 additions and 0 deletions

View File

@ -543,6 +543,7 @@
SUBDIR += lincvs
SUBDIR += linux-allegro
SUBDIR += linux-glib2
SUBDIR += linux-js
SUBDIR += linux-libglade
SUBDIR += linux-runrev
SUBDIR += linux-sdl12

44
devel/linux-js/Makefile Normal file
View File

@ -0,0 +1,44 @@
# New ports collection makefile for: linux-js
# Date created: 5 Feb 2006
# Whom: Jean-Yves Lefort <jylefort@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= linux-js
PORTVERSION= 1.0
CATEGORIES= devel emulators
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= jylefort
MAINTAINER= jylefort@FreeBSD.org
COMMENT= The Linux joystick interface ported to FreeBSD
PROGRAMS= jscal jstest
MAN1= ${PROGRAMS:S|$|.1|}
PORTDOCS= joystick-api.txt
USE_RC_SUBR= jscal.sh
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 503001
IGNORE= requires FreeBSD 5.3 or superior
.endif
.if !exists(/usr/src/sys/Makefile)
IGNORE= requires kernel source files
.endif
post-install:
${MKDIR} ${PREFIX}/include/linux
${INSTALL_DATA} ${WRKSRC}/joystick.h ${PREFIX}/include/linux
${INSTALL_PROGRAM} ${PROGRAMS:S|^|${WRKSRC}/|} ${PREFIX}/bin
${INSTALL_MAN} ${MAN1:S|^|${WRKSRC}/|} ${PREFIX}/man/man1
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/joystick-api.txt ${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

3
devel/linux-js/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (linux-js-1.0.tar.gz) = 8dd60e27c4b122b59fbcda3931626745
SHA256 (linux-js-1.0.tar.gz) = 463dbdc7efb79945728d4c5a9896ac6e7086527a5c39c2ae779e7d3df09e635e
SIZE (linux-js-1.0.tar.gz) = 20191

View File

@ -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"

6
devel/linux-js/pkg-descr Normal file
View File

@ -0,0 +1,6 @@
This port provides a FreeBSD kernel module implementing the Linux joystick
interface (/dev/input/js0), as well as calibration (jscal) and test (jstest)
utilities.
- Jean-Yves Lefort
jylefort@FreeBSD.org

View File

@ -0,0 +1,29 @@
===============================================================================
The linux_js kernel module supports analog joysticks through the
joy(4) driver, which must be loaded as a module or compiled into the
kernel. USB joysticks are not yet supported.
To load the kernel module immediately, type the following command:
kldload linux_js
To load the kernel module at boot, add the following line to
/boot/loader.conf:
linux_js_load="YES"
To test your joystick(s), type the following command:
jstest /dev/input/js0
To calibrate your joystick(s), type the following command:
jscal -c /dev/input/js0
To save the calibration data at system shutdown and restore it at
boot, add the following line to /etc/rc.conf:
jscal_enable="YES"
===============================================================================

8
devel/linux-js/pkg-plist Normal file
View File

@ -0,0 +1,8 @@
bin/jscal
bin/jstest
include/linux/joystick.h
@dirrm include/linux
@cwd /boot/modules
linux_js.ko
@exec kldxref %D
@unexec kldxref %D