From owner-svn-ports-all@freebsd.org Sat Feb 6 18:04:57 2021 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0994D53091B; Sat, 6 Feb 2021 18:04:57 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY0Yh6rYNz4tnn; Sat, 6 Feb 2021 18:04:56 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDA8B15DA7; Sat, 6 Feb 2021 18:04:56 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 116I4u3k019184; Sat, 6 Feb 2021 18:04:56 GMT (envelope-from jhale@FreeBSD.org) Received: (from jhale@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 116I4tQA019178; Sat, 6 Feb 2021 18:04:55 GMT (envelope-from jhale@FreeBSD.org) Message-Id: <202102061804.116I4tQA019178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhale set sender to jhale@FreeBSD.org using -f From: "Jason E. Hale" Date: Sat, 6 Feb 2021 18:04:55 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r564232 - in head: . comms/usbmuxd comms/usbmuxd/files X-SVN-Group: ports-head X-SVN-Commit-Author: jhale X-SVN-Commit-Paths: in head: . comms/usbmuxd comms/usbmuxd/files X-SVN-Commit-Revision: 564232 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 18:04:57 -0000 Author: jhale Date: Sat Feb 6 18:04:55 2021 New Revision: 564232 URL: https://svnweb.freebsd.org/changeset/ports/564232 Log: comms/usbmuxd: Add optional devd(8) configuration file to start and stop the daemon as devices are attached and detached, respectively. (On by default) Add GIDs/UIDs for usbmuxd to facilitate use with devd(8). Patch configure.ac instead of configure since we are using autoreconf. Merge post-patch target into this new patch for a cleaner Makefile. Added: head/comms/usbmuxd/files/patch-configure.ac (contents, props changed) head/comms/usbmuxd/files/usbmuxd.conf.in (contents, props changed) Deleted: head/comms/usbmuxd/files/patch-configure Modified: head/GIDs head/UIDs head/comms/usbmuxd/Makefile Modified: head/GIDs ============================================================================== --- head/GIDs Sat Feb 6 18:02:09 2021 (r564231) +++ head/GIDs Sat Feb 6 18:04:55 2021 (r564232) @@ -214,7 +214,7 @@ _rpki-client:*:270: signaling:*:271: gvm:*:272: seaweedfs:*:273: -# free: 274 +usbmuxd:*:274: haclient:*:275: frontbase:*:276: # free: 277 Modified: head/UIDs ============================================================================== --- head/UIDs Sat Feb 6 18:02:09 2021 (r564231) +++ head/UIDs Sat Feb 6 18:04:55 2021 (r564232) @@ -219,7 +219,7 @@ _rpki-client:*:270:270::0:0:rpki-client user:/nonexist signaling:*:271:271::0:0:Signaling server:/nonexistent:/usr/sbin/nologin gvm:*:272:272::0:0:Greenbone Vulnerability Management:/nonexistent:/usr/sbin/nologin seaweedfs:*:273:273::0:0:seaweedfs user:/var/db/seaweedfs:/usr/sbin/nologin -# free: 274 +usbmuxd:*:274:274::0:0:USB multiplexing daemon:/nonexistent:/usr/sbin/nologin hacluster:*:275:275::0:0:Heartbeat cluster user:/nonexistent:/usr/sbin/nologin frontbase:*:276:276::0:0:FrontBase Daemon:/usr/local/FrontBase/Databases:/bin/sh # free: 277 Modified: head/comms/usbmuxd/Makefile ============================================================================== --- head/comms/usbmuxd/Makefile Sat Feb 6 18:02:09 2021 (r564231) +++ head/comms/usbmuxd/Makefile Sat Feb 6 18:04:55 2021 (r564232) @@ -2,6 +2,7 @@ PORTNAME= usbmuxd DISTVERSION= 1.1.1 +PORTREVISION= 1 CATEGORIES= comms MASTER_SITES= https://github.com/libimobiledevice/${PORTNAME}/releases/download/${PORTVERSION}/ @@ -18,24 +19,32 @@ LIB_DEPENDS= libplist-2.0.so:devel/libplist \ USES= autoreconf cpe libtool localbase pathfix pkgconfig tar:bzip2 CPE_VENDOR= nikias_bassen + GNU_CONFIGURE= yes CONFIGURE_ARGS= --without-systemd -PLIST_FILES= man/man8/${PORTNAME}.8.gz \ - sbin/${PORTNAME} +SUB_LIST= USERS=${USERS} \ + GROUPS=${GROUPS} +USERS= ${PORTNAME} +GROUPS= ${PORTNAME} + +PLIST_FILES= man/man8/${PORTNAME}.8.gz \ + "@(${USERS},${GROUPS},) sbin/${PORTNAME}" PORTDOCS= AUTHORS NEWS README.md -OPTIONS_DEFINE= DOCS +OPTIONS_DEFINE= DEVD DOCS +OPTIONS_DEFAULT= DEVD -post-patch: -# TODO: add devd(8) rule. - @${REINPLACE_CMD} \ - -e '/darwin*/ s,),|dragonfly*|*bsd*),' \ - ${WRKSRC}/configure.ac +DEVD_SUB_FILES= ${PORTNAME}.conf +DEVD_PLIST_FILES= etc/devd/${PORTNAME}.conf post-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} + +post-install-DEVD-on: + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/devd + ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.conf ${STAGEDIR}${PREFIX}/etc/devd .include Added: head/comms/usbmuxd/files/patch-configure.ac ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/usbmuxd/files/patch-configure.ac Sat Feb 6 18:04:55 2021 (r564232) @@ -0,0 +1,24 @@ +Remove bash-ism from configure script. +Disable udev/systemd detection for *BSD as the catch-all assumes a Linux +system. A configuration file for devd(8) is provided by this port instead. + +--- configure.ac.orig 2020-06-09 02:57:16 UTC ++++ configure.ac +@@ -36,7 +36,7 @@ if test "x$have_limd" = "xyes"; then + AC_SUBST(libimobiledevice_CFLAGS) + AC_SUBST(libimobiledevice_LIBS) + CACHED_CFLAGS="$CFLAGS" +- CFLAGS+=" $libimobiledevice_CFLAGS" ++ CFLAGS="$CFLAGS $libimobiledevice_CFLAGS" + AC_CACHE_CHECK(for enum idevice_connection_type, ac_cv_enum_idevice_connection_type, + AC_TRY_COMPILE([ + #include +@@ -125,7 +125,7 @@ case ${host_os} in + AC_SUBST(WINDRES) + activation_method="manual" + ;; +- darwin*) ++ darwin*|dragonfly*|*bsd*) + win32=false + AC_MSG_RESULT([no]) + # No support for launchd yet Added: head/comms/usbmuxd/files/usbmuxd.conf.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/usbmuxd/files/usbmuxd.conf.in Sat Feb 6 18:04:55 2021 (r564232) @@ -0,0 +1,28 @@ +# $FreeBSD$ +# +# This entry starts the Apple mobile device muxer 'usbmuxd' upon device attach +# of a matching Apple product including iPhone, iPad, and iPod. It also allows +# members of the '%%GROUPS%%' group to access the devices. +# +# Multiple devices may be attached simultaneously. The muxer will stop upon +# detach of the last matching device. + +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x05ac"; + match "product" "(0x12[9a][0-9a-f]|0x8600)"; + action "chgrp %%GROUPS%% /dev/$cdev; chmod g+rw /dev/$cdev"; + action "%%PREFIX%%/sbin/usbmuxd -U %%USERS%% -z"; +}; + +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "DETACH"; + match "vendor" "0x05ac"; + match "product" "(0x12[9a][0-9a-f]|0x8600)"; + action "%%PREFIX%%/sbin/usbmuxd -x"; +}; +