1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

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.
This commit is contained in:
Jason E. Hale 2021-02-06 18:04:55 +00:00
parent 8c7f10f9d5
commit 52457ab47a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=564232
6 changed files with 71 additions and 23 deletions

2
GIDs
View File

@ -214,7 +214,7 @@ _rpki-client:*:270:
signaling:*:271:
gvm:*:272:
seaweedfs:*:273:
# free: 274
usbmuxd:*:274:
haclient:*:275:
frontbase:*:276:
# free: 277

2
UIDs
View File

@ -219,7 +219,7 @@ _rpki-client:*:270:270::0:0:rpki-client user:/nonexistent:/usr/sbin/nologin
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

View File

@ -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 <bsd.port.mk>

View File

@ -1,13 +0,0 @@
Remove bash-ism from configure script
--- configure.orig 2021-01-21 13:11:33 UTC
+++ configure
@@ -16412,7 +16412,7 @@ $as_echo "#define HAVE_LIBIMOBILEDEVICE 1" >>confdefs.
CACHED_CFLAGS="$CFLAGS"
- CFLAGS+=" $libimobiledevice_CFLAGS"
+ CFLAGS="$CFLAGS $libimobiledevice_CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enum idevice_connection_type" >&5
$as_echo_n "checking for enum idevice_connection_type... " >&6; }
if ${ac_cv_enum_idevice_connection_type+:} false; then :

View File

@ -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 <libimobiledevice/libimobiledevice.h>
@@ -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

View File

@ -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";
};