Commit 20a54ee8 authored by pawel's avatar pawel
Browse files

- Add staging support

- Use options sub, @sample for config file
- Fix few spelling errors in pkg-message
parent 4cf61ea5
......@@ -16,18 +16,15 @@ LICENSE= BSD2CLAUSE
BUILD_DEPENDS= cuse4bsd-kmod>=0.1.24:${PORTSDIR}/multimedia/cuse4bsd-kmod
LIB_DEPENDS= libcuse4bsd.so:${PORTSDIR}/multimedia/cuse4bsd-kmod
OPTIONS_DEFINE= DEVD
OPTIONS_DEFAULT= DEVD
USE_RC_SUBR= uhidd
SUB_FILES= pkg-message
MAN5= uhidd.conf.5
MAN8= uhidd.8
LIBDIR= ${PREFIX}/lib
NO_STAGE= yes
OPTIONS_DEFINE= DEVD
OPTIONS_DEFAULT= DEVD
OPTIONS_SUB= yes
.include <bsd.port.pre.mk>
LIBCUSE= ${LIBDIR}/libcuse4bsd.so
......@@ -42,34 +39,22 @@ IGNORE= does not build with the old USB stack
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-uhidd-parser.y
.endif
.if ${PORT_OPTIONS:MDEVD}
PLIST_SUB+= PL_DEVD=""
.else
PLIST_SUB+= PL_DEVD="@comment "
.endif
post-patch: .SILENT
${FIND} ${WRKSRC}/uhidd -type f -not -name Makefile \
-exec ${REINPLACE_CMD} 's|/usr/local|${PREFIX}|g' {} +
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/uhidd/uhidd ${PREFIX}/sbin/uhidd
${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.8 ${PREFIX}/man/man8/uhidd.8
${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.conf.5 ${PREFIX}/man/man5/uhidd.conf.5
${INSTALL_PROGRAM} ${WRKSRC}/uhidd/uhidd ${STAGEDIR}${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.8 ${STAGEDIR}${PREFIX}/man/man8
${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.conf.5 ${STAGEDIR}${PREFIX}/man/man5
.if ${PORT_OPTIONS:MDEVD}
${MKDIR} ${PREFIX}/etc/devd
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/devd
${REINPLACE_CMD} -E \
-e "s|%%PREFIX%%|${PREFIX}|" \
-e "s|%%LIBCUSE%%|${LIBCUSE}|" \
${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
${INSTALL_DATA} ${WRKSRC}/uhidd/uhidd-devd.conf.sample \
${STAGEDIR}${PREFIX}/etc/devd
.endif
post-install:
@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
.include <bsd.port.post.mk>
==============================================================================
To use uhidd daemon for USB HID devices, depends on which sub class
driver you want to attach, to avoid confilicts between the daemon and
driver you want to attach, to avoid conflicts between the daemon and
the kernel drivers, you should either use the command line option '-u'
to instruct the daemon to detach active kernel drivers attached to
a device, or you should remove some of those entries 'device ums',
......@@ -13,7 +13,7 @@ you should also remove the relevant devd(8) rules in /etc/devd/usb.conf
config file, so those modules will not be loaded automatically by devd(8)
when devices are attached.
If you want to run uhidd deamon at the startup, add the following lines to
If you want to run uhidd daemon at the startup, add the following lines to
/etc/rc.conf:
uhidd_flags="-kmohsu"
......
%%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
%%DEVD%%@sample etc/devd/uhidd-devd.conf.sample
man/man5/uhidd.conf.5.gz
man/man8/uhidd.8.gz
sbin/uhidd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment