NetBSD Problem Report #53141

From www@NetBSD.org  Thu Mar 29 02:40:28 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C07B47A1C9
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 29 Mar 2018 02:40:27 +0000 (UTC)
Message-Id: <20180329024026.411F17A222@mollari.NetBSD.org>
Date: Thu, 29 Mar 2018 02:40:26 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: update sysutils/apcupsd to use new libusb framework?
X-Send-Pr-Version: www-1.0

>Number:         53141
>Category:       pkg
>Synopsis:       update sysutils/apcupsd to use new libusb framework?
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 29 02:45:00 +0000 2018
>Last-Modified:  Thu Mar 29 06:20:01 +0000 2018
>Originator:     John D. Baker
>Release:        NetBSD/amd64-8.0_BETA, pkgsrc-HEAD (pre-pkgsrc-2018Q1)
>Organization:
>Environment:
NetBSD plex760 8.99.14 NetBSD 8.99.14 (PLEX760) #55: Tue Mar 27 13:56:52 CDT 2018  sysop@yggdrasil.technoskunk.fur:/r0/build/current/obj/amd64/sys/arch/amd64/compile/PLEX760 amd64

>Description:
As of pkgsrc-HEAD, leading to pkgsrc-2018Q1, "sysutils/apcupsd" still
uses "devel/libusb" directly instead of using the
"mk/libusb.buildlink3.mk" framework (and thus the "libusb-compat"
shim to allow libusb-0.x users to use libusb1).

libusb-0.x and libusb-compat conflict so apcupsd can't coexist with
other packages which have converted to use the libusb-compat shim.

While simply changing the relevant buildlink3.mk inclusion allows
apcupsd to build, the resulting binary seems to send out repeated
"connection restored" messages on the monitoring host (but not to
apcupsd slaves on the network).

So, more investigation is needed.
>How-To-Repeat:
See above.
>Fix:

>Audit-Trail:
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53141: update sysutils/apcupsd to use new libusb framework?
Date: Wed, 28 Mar 2018 22:48:43 -0500 (CDT)

 Some confusion.  The 'uname -a' output posted in the original submission
 was the system on which "libusb-0.1.12" was to be installed to satisfy
 "apcupsd", but failed due to conflict with "libusb-compat".

 The UPS monitoring host is:

 NetBSD yggdrasil.technoskunk.fur 8.0_BETA NetBSD 8.0_BETA (YGGDRASIL) #207: Mon Mar 26 11:13:03 CDT 2018  sysop@yggdrasil.technoskunk.fur:/r0/build/netbsd-8/obj/amd64/sys/arch/amd64/compile/YGGDRASIL amd64

 and after restarting 'apcupsd' built with libusb1 and the libusb-compat
 shim, local users receive broadcast "Communications restored..." messages
 every 2 minutes or so.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53141: update sysutils/apcupsd to use new libusb framework?
Date: Thu, 29 Mar 2018 00:55:11 -0500 (CDT)

 Hmm.  Reverting to "devel/libusb" (0.1.12), the daemon no-longer spams
 local users on the monitoring host with "Communications restored..."
 messages.

 Said host has no other users of any libusb* packages, so libusb-0.1.12
 is fine for it.

 On apcupsd slave systems, it doesn't need USB support at all, so perhaps
 include an option to disable USB support entirely, if the libusb-compat
 shim can't be used.

 That way other packages which can use libusb-compat can coexist with
 apcupsd on said slave systems.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53141: update sysutils/apcupsd to use new libusb framework?
Date: Thu, 29 Mar 2018 01:16:31 -0500 (CDT)

 Below is a patch to make USB support optional for "apcupsd".

 +Index: sysutils/apcupsd/Makefile
 +===================================================================
 +RCS file: /cvsroot/pkgsrc/sysutils/apcupsd/Makefile,v
 +retrieving revision 1.85
 +diff -u -p -r1.85 Makefile
 +--- sysutils/apcupsd/Makefile	12 Mar 2018 11:17:31 -0000	1.85
 ++++ sysutils/apcupsd/Makefile	29 Mar 2018 06:13:18 -0000
 +@@ -36,7 +36,6 @@ WRKSRC=			${WRKDIR}/apcupsd
 + #CONFIGURE_ARGS+=	--with-upscable=${APCUPSD_UPS_TYPE}
 + 
 + CONFIGURE_ARGS+=	--enable-net		# enable NIS network driver
 +-CONFIGURE_ARGS+=	--enable-usb		# enable USB network driver
 + CONFIGURE_ARGS+=	--enable-snmp		# enable SNMP driver
 + CONFIGURE_ARGS+=	--with-lock-dir=${VARBASE}/spool/lock
 + # XXX is this supposed to be the full filename?
 +@@ -112,5 +111,4 @@ post-install:
 + .endfor
 + 
 + .include "../../devel/gettext-lib/buildlink3.mk"
 +-.include "../../devel/libusb/buildlink3.mk"
 + .include "../../mk/bsd.pkg.mk"
 +Index: sysutils/apcupsd/options.mk
 +===================================================================
 +RCS file: /cvsroot/pkgsrc/sysutils/apcupsd/options.mk,v
 +retrieving revision 1.3
 +diff -u -p -r1.3 options.mk
 +--- sysutils/apcupsd/options.mk	1 Aug 2011 14:54:51 -0000	1.3
 ++++ sysutils/apcupsd/options.mk	29 Mar 2018 06:13:42 -0000
 +@@ -1,8 +1,8 @@
 + # $NetBSD: options.mk,v 1.3 2011/08/01 14:54:51 bouyer Exp $
 + 
 + PKG_OPTIONS_VAR=		PKG_OPTIONS.apcupsd
 +-PKG_SUPPORTED_OPTIONS=		cgi
 +-PKG_SUGGESTED_OPTIONS=		cgi
 ++PKG_SUPPORTED_OPTIONS=		cgi usb
 ++PKG_SUGGESTED_OPTIONS=		cgi usb
 + 
 + .include "../../mk/bsd.options.mk"
 + 
 +@@ -13,3 +13,8 @@ CONFIGURE_ARGS+=	--enable-cgi		# include
 + CONFIGURE_ARGS+=	--with-cgi-bin=${PREFIX}/libexec/cgi-bin
 + PLIST.cgi=		yes
 + .endif
 ++
 ++.if !empty(PKG_OPTIONS:Musb)
 ++.  include "../../devel/libusb/buildlink3.mk"
 ++CONFIGURE_ARGS+=	--enable-usb		# include USB support
 ++.endif

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.