1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

- respect PREFIX for location of uhidd.conf

- use PTHREAD_LIBS instead of -lpthread
- try to guess kernel sources based on SYSDIR (used by bsd.kmod.mk)
  or SRC_BASE (used by ports like virtualbox and kqemu)
- use KMODDIR in plist, too
- I don't think SUB_FILES needs to be *after* bsd.port.pre.mk
- inherit DEBUG_FLAGS from make.conf, not only from command line
- mimic bsd.kmod.mk in installing .symbols file and add entry to plist

PR:		ports/147898
Submitted by:	Anonymous <swell.k@gmail.com>
Approved by:	Kai Wang <kaiwang27@gmail.com> (maintainer)
This commit is contained in:
Pav Lucistnik 2010-08-26 14:50:38 +00:00
parent 0a1c1c23e3
commit f519976002
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=260019
2 changed files with 19 additions and 3 deletions

View File

@ -18,9 +18,14 @@ NO_PACKAGE= should be recompiled for a particular FreeBSD kernel
OPTIONS= DEVD "Install devd files" on
MAKE_ENV+= SYSDIR=${SYSDIR}
KMODDIR?= /boot/modules
SRC_BASE?= /usr/src
SYSDIR?= ${SRC_BASE}/sys
USE_RC_SUBR= uhidd
SUB_FILES= pkg-message
PLIST_SUB= KMODDIR=${KMODDIR}
MAN4= uvhid.4
MAN5= uhidd.conf.5
@ -28,11 +33,15 @@ MAN8= uhidd.8
.include <bsd.port.pre.mk>
.if defined(DEBUG_FLAGS)
MAKE_ENV+= DEBUG_FLAGS='${DEBUG_FLAGS}'
.endif
.if ${OSVERSION} < 800069
IGNORE= does not build with the old USB stack
.endif
.if !exists(/usr/src/sys/Makefile)
.if !(exists(${SYSDIR}/Makefile) || exists(${SRC_BASE}/sys/Makefile))
IGNORE= requires kernel source files
.endif
@ -42,11 +51,17 @@ PLIST_SUB+= PL_DEVD=""
PLIST_SUB+= PL_DEVD="@comment "
.endif
SUB_FILES+= pkg-message
post-patch: .SILENT
${FIND} ${WRKSRC}/uhidd -type f -exec ${REINPLACE_CMD} \
's|/usr/local|${PREFIX}|g' {} +
${REINPLACE_CMD} 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/uhidd/Makefile
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/uhidd/uhidd ${PREFIX}/sbin/uhidd
${INSTALL_KLD} ${WRKSRC}/uvhid/uvhid.ko ${KMODDIR}/uvhid.ko
.if exists(${WRKSRC}/uvhid/uvhid.ko.symbols)
${INSTALL_KLD} ${WRKSRC}/uvhid/uvhid.ko.symbols ${KMODDIR}/uvhid.ko.symbols
.endif
${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_MAN} ${WRKSRC}/uvhid/uvhid.4 ${PREFIX}/man/man4/uvhid.4

View File

@ -3,7 +3,8 @@
%%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
@cwd %%KMODDIR%%
uvhid.ko
@rmtry uvhid.ko.symbols
@exec kldxref %D
@unexec kldxref %D