diff options
author | miwi <miwi@FreeBSD.org> | 2009-09-20 04:20:28 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2009-09-20 04:20:28 +0800 |
commit | 0e3757464cfe0a6e20faeba5e7107a966d05b299 (patch) | |
tree | ea825f4e4d2dcb48aa1ba24142eaa1615206fada | |
parent | 20a8c058b3f7f5cc2e50012fed6ef787481c9d86 (diff) | |
download | freebsd-ports-gnome-0e3757464cfe0a6e20faeba5e7107a966d05b299.tar.gz freebsd-ports-gnome-0e3757464cfe0a6e20faeba5e7107a966d05b299.tar.zst freebsd-ports-gnome-0e3757464cfe0a6e20faeba5e7107a966d05b299.zip |
uhidd is a userland driver/daemon for USB HID devices (e.g. mouse,
keyboard) using libusb20. The driver aims to support USB HID devices
with multiple Top-Level application collections in one interface, i.e,
HID devices with multiple logical device sharing one endpoint.
WWW: http://wiki.FreeBSD.org/uhidd
PR: ports/137793
Feature safe: yes
Submitted by: Kai Wang <kaiwang27 at gmail.com>
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/uhidd/Makefile | 64 | ||||
-rw-r--r-- | sysutils/uhidd/distinfo | 3 | ||||
-rw-r--r-- | sysutils/uhidd/files/pkg-message.in | 20 | ||||
-rw-r--r-- | sysutils/uhidd/files/uhidd.in | 49 | ||||
-rw-r--r-- | sysutils/uhidd/pkg-descr | 6 | ||||
-rw-r--r-- | sysutils/uhidd/pkg-plist | 9 |
7 files changed, 152 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index 31b557321f40..97c3d707632b 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -792,6 +792,7 @@ SUBDIR += udesc_dump SUBDIR += udfclient SUBDIR += ufs_copy + SUBDIR += uhidd SUBDIR += uif2iso SUBDIR += unieject SUBDIR += uniutils diff --git a/sysutils/uhidd/Makefile b/sysutils/uhidd/Makefile new file mode 100644 index 000000000000..653fd4d56183 --- /dev/null +++ b/sysutils/uhidd/Makefile @@ -0,0 +1,64 @@ +# New ports collection makefile for: uhidd +# Date created: 2009-08-07 +# Whom: Kai Wang <kaiwang27@gmail.com> +# +# $FreeBSD$ +# + +PORTNAME= uhidd +PORTVERSION= 0.1.4 +CATEGORIES= sysutils +MASTER_SITES= http://people.freebsd.org/~kaiw/distfiles/ + +MAINTAINER= kaiwang27@gmail.com +COMMENT= Userland USB HID device driver using libusb20 + +NO_PACKAGE= should be recompiled for a particular FreeBSD kernel + +OPTIONS= DEVD "Install devd files" on + +KMODDIR?= /boot/modules + +USE_RC_SUBR= uhidd + +MAN4= uvhid.4 +MAN8= uhidd.8 + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} < 800069 +BROKEN= Does not build with the old USB stack +.endif + +.if !exists(/usr/src/sys/Makefile) +IGNORE= requires kernel source files +.endif + +.if !defined(WITHOUT_DEVD) +PLIST_SUB+= PL_DEVD="" +.else +PLIST_SUB+= PL_DEVD="@comment " +.endif + +SUB_FILES+= pkg-message + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/uhidd/uhidd ${PREFIX}/sbin/uhidd + ${INSTALL_KLD} ${WRKSRC}/uvhid/uvhid.ko ${KMODDIR}/uvhid.ko + ${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.8 ${PREFIX}/man/man8/uhidd.8 + ${INSTALL_MAN} ${WRKSRC}/uvhid/uvhid.4 ${PREFIX}/man/man4/uvhid.4 +.if !defined(WITHOUT_DEVD) + ${MKDIR} ${PREFIX}/etc/devd + ${REINPLACE_CMD} -Ee \ + "s%/usr/local%${PREFIX}%" ${WRKSRC}/uhidd/uhidd-devd.conf.sample + ${INSTALL_DATA} ${WRKSRC}/uhidd/uhidd-devd.conf.sample ${PREFIX}/etc/devd/ + @if [ ! -f ${PREFIX}/etc/devd/uhidd-devd.conf ]; then \ + ${CP} -p ${PREFIX}/etc/devd/uhidd-devd.conf.sample \ + ${PREFIX}/etc/devd/uhidd-devd.conf; \ + fi +.endif + +post-install: + @${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD} + +.include <bsd.port.post.mk> diff --git a/sysutils/uhidd/distinfo b/sysutils/uhidd/distinfo new file mode 100644 index 000000000000..ea1c5cfddf2f --- /dev/null +++ b/sysutils/uhidd/distinfo @@ -0,0 +1,3 @@ +MD5 (uhidd-0.1.4.tar.gz) = 3e026f0b29b6b9b60766cb7c16a7bffb +SHA256 (uhidd-0.1.4.tar.gz) = 8c19ba127af58843b703a2b5fa91aa26817f179fb24bf20b4cb3c6c8dd40f022 +SIZE (uhidd-0.1.4.tar.gz) = 44160 diff --git a/sysutils/uhidd/files/pkg-message.in b/sysutils/uhidd/files/pkg-message.in new file mode 100644 index 000000000000..e97651d2bb89 --- /dev/null +++ b/sysutils/uhidd/files/pkg-message.in @@ -0,0 +1,20 @@ +============================================================================== + +To use uhidd daemon for USB hid devices, you need to remove 'device ums', +'device ukbd', and 'device uhid' from your kernel config file and recompile +the kernel. Or if these drivers are loaded as kernel modules, kldunload them. + +If you want to run uhidd deamon at the startup, add the following lines to +/etc/rc.conf: + + uhidd_flags="-kmhs" + uhidd_enable="YES" + +To manually start/stop uhidd daemon on certain device, run: + + %%PREFIX%%/etc/rc.d/uhidd [start|stop] /dev/ugen.X.Y + +See http://wiki.freebsd.org/uhidd for more details about how to install and +setup the daemon. + +============================================================================== diff --git a/sysutils/uhidd/files/uhidd.in b/sysutils/uhidd/files/uhidd.in new file mode 100644 index 000000000000..f6129e208724 --- /dev/null +++ b/sysutils/uhidd/files/uhidd.in @@ -0,0 +1,49 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: uhidd +# REQUIRE: DAEMON cleanvar +# KEYWORD: nojail shutdown + +. %%RC_SUBR%% + +# Usage: +# uhidd start ugenX.Y # start uhidd on device 'ugenX.Y' +# uhidd stop ugenX.Y # stop uhidd on device 'ugenX.Y' +# uhidd start # start uhidd on all ugen device. +# uhidd stop # stop all uhidd instances. + +name="uhidd" +rcvar=`set_rcvar` +command="%%PREFIX%%/sbin/${name}" +start_cmd="uhidd_start" +required_modules="uvhid vkbd" +pidprefix="/var/run/uhidd" + +load_rc_config $name + +if [ -n "$2" ]; then + pidfile="${pidprefix}.`basename $2`.pid" +else + pidfile= +fi + +uhidd_start() +{ + local dev pf + + if [ -n "$1" ]; then + ${command} ${uhidd_flags} $1 + else + for dev in /dev/ugen*; do + pf="${pidprefix}.`basename ${dev}`.pid" + if [ ! -f ${pf} ]; then + ${command} ${uhidd_flags} ${dev} + fi + done + fi +} + +run_rc_command $* diff --git a/sysutils/uhidd/pkg-descr b/sysutils/uhidd/pkg-descr new file mode 100644 index 000000000000..fa0fe68b0302 --- /dev/null +++ b/sysutils/uhidd/pkg-descr @@ -0,0 +1,6 @@ +uhidd is a userland driver/daemon for USB HID devices (e.g. mouse, +keyboard) using libusb20. The driver aims to support USB HID devices +with multiple Top-Level application collections in one interface, i.e, +HID devices with multiple logical device sharing one endpoint. + +WWW: http://wiki.FreeBSD.org/uhidd diff --git a/sysutils/uhidd/pkg-plist b/sysutils/uhidd/pkg-plist new file mode 100644 index 000000000000..6c55ba446755 --- /dev/null +++ b/sysutils/uhidd/pkg-plist @@ -0,0 +1,9 @@ +%%PL_DEVD%%@unexec if cmp -s %D/etc/devd/uhidd-devd.conf.sample %D/etc/devd/uhidd-devd.conf; then rm -f %D/etc/devd/uhidd-devd.conf; fi +%%PL_DEVD%%etc/devd/uhidd-devd.conf.sample +%%PL_DEVD%%@exec if [ ! -f %D/etc/devd/uhidd-devd.conf ]; then mkdir -p %B; cp -p %D/%F %B/uhidd-devd.conf; fi +%%PL_DEVD%%@dirrmtry etc/devd +sbin/uhidd +@cwd /boot/modules +uvhid.ko +@exec kldxref %D +@unexec kldxref %D |