ports/147898: [patch] sysutils/uhidd: open /usr/local/etc/uhidd.conf failed: No such file or directory

Anonymous swell.k at gmail.com
Wed Jun 16 05:40:01 UTC 2010


>Number:         147898
>Category:       ports
>Synopsis:       [patch] sysutils/uhidd: open /usr/local/etc/uhidd.conf failed: No such file or directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 16 05:40:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
LOCALBASE=/usr/pkg
/usr/local does not exist here
>Description:
- 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
>How-To-Repeat:
  $ uhidd -dv /dev/ugen1.2
  uhidd[3559]: open /usr/local/etc/uhidd.conf failed: No such file or directory
  uhidd[3559]: proceed without configuration file
>Fix:
--- a.diff begins here ---
Index: sysutils/uhidd/Makefile
===================================================================
RCS file: /a/.cvsup/ports/sysutils/uhidd/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- sysutils/uhidd/Makefile	15 Mar 2010 15:49:15 -0000	1.3
+++ sysutils/uhidd/Makefile	16 Jun 2010 05:21:22 -0000
@@ -19,8 +19,11 @@ NO_PACKAGE=	should be recompiled for a p
 OPTIONS=	DEVD "Install devd files" on
 
 KMODDIR?=	/boot/modules
+SRC_BASE?=	/usr/src
 
 USE_RC_SUBR=	uhidd
+SUB_FILES=	pkg-message
+PLIST_SUB=	KMODDIR=${KMODDIR}
 
 MAN4=		uvhid.4
 MAN5=		uhidd.conf.5
@@ -28,11 +31,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 +49,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
Index: sysutils/uhidd/pkg-plist
===================================================================
RCS file: /a/.cvsup/ports/sysutils/uhidd/pkg-plist,v
retrieving revision 1.1
diff -u -p -r1.1 pkg-plist
--- sysutils/uhidd/pkg-plist	19 Sep 2009 20:20:28 -0000	1.1
+++ sysutils/uhidd/pkg-plist	16 Jun 2010 04:55:13 -0000
@@ -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
- at cwd /boot/modules
+ at cwd %%KMODDIR%%
 uvhid.ko
+ at rmtry uvhid.ko.symbols
 @exec kldxref %D
 @unexec kldxref %D
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list