diff options
author | Jean-Yves Lefort <jylefort@FreeBSD.org> | 2006-03-21 16:03:50 +0000 |
---|---|---|
committer | Jean-Yves Lefort <jylefort@FreeBSD.org> | 2006-03-21 16:03:50 +0000 |
commit | cf569742410088cc644b46110fc28567a0cab7fc (patch) | |
tree | f0d22ac874daa63d16340284998343e5fa5448e8 /devel/linux-js | |
parent | e5e940a8f964562d5848e5352a9b4ebc6c674da8 (diff) | |
download | ports-cf569742410088cc644b46110fc28567a0cab7fc.tar.gz ports-cf569742410088cc644b46110fc28567a0cab7fc.zip |
Notes
Diffstat (limited to 'devel/linux-js')
-rw-r--r-- | devel/linux-js/Makefile | 25 | ||||
-rw-r--r-- | devel/linux-js/distinfo | 6 | ||||
-rw-r--r-- | devel/linux-js/files/jscal.sh.in | 19 | ||||
-rw-r--r-- | devel/linux-js/files/linux_js.sh.in | 29 | ||||
-rw-r--r-- | devel/linux-js/pkg-descr | 2 | ||||
-rw-r--r-- | devel/linux-js/pkg-message | 25 | ||||
-rw-r--r-- | devel/linux-js/pkg-plist | 2 |
7 files changed, 85 insertions, 23 deletions
diff --git a/devel/linux-js/Makefile b/devel/linux-js/Makefile index 0c396abeb130..960f3c82118a 100644 --- a/devel/linux-js/Makefile +++ b/devel/linux-js/Makefile @@ -6,7 +6,7 @@ # PORTNAME= linux-js -PORTVERSION= 1.0 +PORTVERSION= 2.0 CATEGORIES= devel emulators MASTER_SITES= ${MASTER_SITE_LOCAL} MASTER_SITE_SUBDIR= jylefort @@ -17,8 +17,14 @@ COMMENT= The Linux joystick interface ported to FreeBSD PROGRAMS= jscal jstest MAN1= ${PROGRAMS:S|$|.1|} +MAN4= linux_js.4 PORTDOCS= joystick-api.txt -USE_RC_SUBR= jscal.sh +USE_RCORDER= jscal.sh linux_js.sh + +OPTIONS= JOY "PC joystick support" on \ + UHID "USB joystick support" on + +MAKE_ENV= WITHOUT_DEBUG=yes .include <bsd.port.pre.mk> @@ -30,11 +36,24 @@ IGNORE= requires FreeBSD 5.3 or superior IGNORE= requires kernel source files .endif +.if defined(WITHOUT_JOY) +MAKE_ENV+= WITHOUT_JOY=yes +.endif + +.if defined(WITHOUT_UHID) +MAKE_ENV+= WITHOUT_UHID=yes +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/linux_js.4 + 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 +.for s in 1 4 + ${INSTALL_MAN} ${MAN${s}:S|^|${WRKSRC}/|} ${PREFIX}/man/man${s} +.endfor .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/joystick-api.txt ${DOCSDIR} diff --git a/devel/linux-js/distinfo b/devel/linux-js/distinfo index 15de6dd162da..2eb42ba94ae8 100644 --- a/devel/linux-js/distinfo +++ b/devel/linux-js/distinfo @@ -1,3 +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 +MD5 (linux-js-2.0.tar.gz) = f3270b11e3603b9cbee48fad51972208 +SHA256 (linux-js-2.0.tar.gz) = b9e12efd44a02aabb36077e4333faeede9c6fa959cb468eebf66ed5a3a6c95be +SIZE (linux-js-2.0.tar.gz) = 32725 diff --git a/devel/linux-js/files/jscal.sh.in b/devel/linux-js/files/jscal.sh.in index ebc4b5d8e77a..d9cf58f5fa4a 100644 --- a/devel/linux-js/files/jscal.sh.in +++ b/devel/linux-js/files/jscal.sh.in @@ -2,10 +2,11 @@ # $FreeBSD$ # PROVIDE: jscal +# REQUIRE: linux_js # KEYWORD: shutdown jscal_enable=${jscal_enable-"NO"} -jscal_device="/dev/input/js0" +jscal_devices="${jscal_devices:-/dev/input/js*}" jscal_state="${jscal_state:-/var/db/jscal-state}" . %%RC_SUBR%% @@ -18,13 +19,23 @@ stop_cmd="jscal_stop" jscal_start() { - [ -f "$jscal_state" ] && . "$jscal_state" 2>/dev/null + echo "Starting ${name}." + for d in $jscal_devices; do + [ "x$d" = "x$jscal_devices" ] && break + statefile="$jscal_state-`basename $d`" + [ -f "$statefile" ] && . "$statefile" 2>/dev/null + done } jscal_stop() { - cal=`"$command" -p "$jscal_device" 2>/dev/null` && \ - echo "$cal" | sed -e "s|^jscal|$command|" > $jscal_state + echo "Stopping ${name}." + for d in $jscal_devices; do + [ "x$d" = "x$jscal_devices" ] && break + statefile="$jscal_state-`basename $d`" + cal=`"$command" -p "$d" 2>/dev/null` && \ + echo "$cal" | sed -e "s|^jscal|$command|" > "$statefile" + done } load_rc_config $name diff --git a/devel/linux-js/files/linux_js.sh.in b/devel/linux-js/files/linux_js.sh.in new file mode 100644 index 000000000000..9768f1b3aa31 --- /dev/null +++ b/devel/linux-js/files/linux_js.sh.in @@ -0,0 +1,29 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: linux_js +# KEYWORD: shutdown + +linux_js_enable=${linux_js_enable-"NO"} + +. %%RC_SUBR%% + +name="linux_js" +rcvar=`set_rcvar` +start_cmd="linux_js_start" +stop_cmd="linux_js_stop" + +linux_js_start() +{ + echo "Starting ${name}." + kldload linux_js +} + +linux_js_stop() +{ + echo "Stopping ${name}." + kldunload linux_js +} + +load_rc_config $name +run_rc_command "$1" diff --git a/devel/linux-js/pkg-descr b/devel/linux-js/pkg-descr index 08f24416806e..2794b44d2a58 100644 --- a/devel/linux-js/pkg-descr +++ b/devel/linux-js/pkg-descr @@ -1,5 +1,5 @@ This port provides a FreeBSD kernel module implementing the Linux joystick -interface (/dev/input/js0), as well as calibration (jscal) and test (jstest) +interface (/dev/input/js?), as well as calibration (jscal) and test (jstest) utilities. - Jean-Yves Lefort diff --git a/devel/linux-js/pkg-message b/devel/linux-js/pkg-message index df5f8e490649..f1d363a2cadd 100644 --- a/devel/linux-js/pkg-message +++ b/devel/linux-js/pkg-message @@ -1,25 +1,28 @@ =============================================================================== -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: +To load the linux_js kernel module immediately, type the following commands: + kldload joy (if PC joystick support is desired) + kldload uhid (if USB joystick support is desired) kldload linux_js -To load the kernel module at boot, add the following line to +To load the linux_js kernel module at boot, add the following lines to /boot/loader.conf: - linux_js_load="YES" + joy_load="YES" (if PC joystick support is desired) + uhid_load="YES" (if USB joystick support is desired) + +and add the following line to /etc/rc.conf: + + linux_js_enable="YES" -To test your joystick(s), type the following command: +To test a joystick, type the following command: - jstest /dev/input/js0 + jstest /dev/input/jsXXX -To calibrate your joystick(s), type the following command: +To calibrate a joystick, type the following command: - jscal -c /dev/input/js0 + jscal -c /dev/input/jsXXX To save the calibration data at system shutdown and restore it at boot, add the following line to /etc/rc.conf: diff --git a/devel/linux-js/pkg-plist b/devel/linux-js/pkg-plist index 6b2caf146e7a..7c5346a88be1 100644 --- a/devel/linux-js/pkg-plist +++ b/devel/linux-js/pkg-plist @@ -1,7 +1,7 @@ bin/jscal bin/jstest include/linux/joystick.h -@dirrm include/linux +@dirrmtry include/linux @cwd /boot/modules linux_js.ko @exec kldxref %D |