aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2021-02-06 18:04:55 +0000
committerJason E. Hale <jhale@FreeBSD.org>2021-02-06 18:04:55 +0000
commit52457ab47a77a2d829c5172b33cce9e1b8df60e1 (patch)
tree60fc0dc0856caf22348c5d3f10d24ba2545733d8
parent8c7f10f9d5017a14e2ba0227568a745c1c086829 (diff)
downloadports-52457ab47a77a2d829c5172b33cce9e1b8df60e1.tar.gz
ports-52457ab47a77a2d829c5172b33cce9e1b8df60e1.zip
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.
Notes
Notes: svn path=/head/; revision=564232
-rw-r--r--GIDs2
-rw-r--r--UIDs2
-rw-r--r--comms/usbmuxd/Makefile25
-rw-r--r--comms/usbmuxd/files/patch-configure13
-rw-r--r--comms/usbmuxd/files/patch-configure.ac24
-rw-r--r--comms/usbmuxd/files/usbmuxd.conf.in28
6 files changed, 71 insertions, 23 deletions
diff --git a/GIDs b/GIDs
index 02bebab1d2df..53a4b6228ee5 100644
--- a/GIDs
+++ b/GIDs
@@ -214,7 +214,7 @@ _rpki-client:*:270:
signaling:*:271:
gvm:*:272:
seaweedfs:*:273:
-# free: 274
+usbmuxd:*:274:
haclient:*:275:
frontbase:*:276:
# free: 277
diff --git a/UIDs b/UIDs
index 39f5ae631f84..dcf981863b82 100644
--- a/UIDs
+++ b/UIDs
@@ -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
diff --git a/comms/usbmuxd/Makefile b/comms/usbmuxd/Makefile
index 1fcc16aca857..6de286deca15 100644
--- a/comms/usbmuxd/Makefile
+++ b/comms/usbmuxd/Makefile
@@ -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>
diff --git a/comms/usbmuxd/files/patch-configure b/comms/usbmuxd/files/patch-configure
deleted file mode 100644
index 524b2f746943..000000000000
--- a/comms/usbmuxd/files/patch-configure
+++ /dev/null
@@ -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 :
diff --git a/comms/usbmuxd/files/patch-configure.ac b/comms/usbmuxd/files/patch-configure.ac
new file mode 100644
index 000000000000..40c76ce88439
--- /dev/null
+++ b/comms/usbmuxd/files/patch-configure.ac
@@ -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
diff --git a/comms/usbmuxd/files/usbmuxd.conf.in b/comms/usbmuxd/files/usbmuxd.conf.in
new file mode 100644
index 000000000000..4c503ad2d9dc
--- /dev/null
+++ b/comms/usbmuxd/files/usbmuxd.conf.in
@@ -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";
+};
+