aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2025-06-23 13:37:29 +0000
committerÄlven <alven@FreeBSD.org>2025-08-18 10:37:44 +0000
commit4161ac705809c2ead9bea811414311180f9063da (patch)
tree86b3b2240113b9f04e85b73d5fddb493c1f371d1
parent1b785309d4e6382071ae2db29516a8940dbc0386 (diff)
net-im/mautrix-whatsapp: [NEW PORT] Matrix-WhatsApp puppeting bridge
Mautrix-whatsapp bridges messages between WhatsApp and a Matrix server. PR: 283671 Approved by: yuri@ (Mentor)
-rw-r--r--GIDs2
-rw-r--r--UIDs2
-rw-r--r--net-im/Makefile1
-rw-r--r--net-im/mautrix-whatsapp/Makefile26
-rw-r--r--net-im/mautrix-whatsapp/distinfo5
-rw-r--r--net-im/mautrix-whatsapp/files/mautrix_whatsapp.in54
-rw-r--r--net-im/mautrix-whatsapp/pkg-descr3
-rw-r--r--net-im/mautrix-whatsapp/pkg-plist3
8 files changed, 94 insertions, 2 deletions
diff --git a/GIDs b/GIDs
index 119e457e06f1..115d53eaec2b 100644
--- a/GIDs
+++ b/GIDs
@@ -313,7 +313,7 @@ neo4j:*:369:
_wsdd:*:370:
reposilite:*:371:
beam:*:372:
-# free: 373
+mautrix-whatsapp:*:373:
# free: 374
# free: 375
# free: 376
diff --git a/UIDs b/UIDs
index 4f251d5de24f..2e28429e72cc 100644
--- a/UIDs
+++ b/UIDs
@@ -319,7 +319,7 @@ neo4j:*:369:369::0:0:neo4j Database Daemon:/nonexistent:/usr/sbin/nologin
_wsdd:*:370:370::0:0:Web Service Discovery Daemon:/nonexistent:/usr/sbin/nologin
reposilite:*:371:371::0:0:Reposilite user:/nonexistent:/usr/sbin/nologin
beam:*:372:372::0:0:Erlang BEAM VM user:/nonexistent:/usr/sbin/nologin
-# free: 373
+mautrix-whatsapp:*:373:373::0:0:Mautrix-Whatsapp Daemon:/nonexistent:/usr/sbin/nologin
# free: 374
# free: 375
# free: 376
diff --git a/net-im/Makefile b/net-im/Makefile
index be8959e48cda..ae70ce65d13d 100644
--- a/net-im/Makefile
+++ b/net-im/Makefile
@@ -60,6 +60,7 @@
SUBDIR += matterbridge
SUBDIR += matterhorn
SUBDIR += matterircd
+ SUBDIR += mautrix-whatsapp
SUBDIR += mbpurple
SUBDIR += mcabber
SUBDIR += meanwhile
diff --git a/net-im/mautrix-whatsapp/Makefile b/net-im/mautrix-whatsapp/Makefile
new file mode 100644
index 000000000000..b530b5511c90
--- /dev/null
+++ b/net-im/mautrix-whatsapp/Makefile
@@ -0,0 +1,26 @@
+PORTNAME= mautrix-whatsapp
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.12.4
+CATEGORIES= net-im
+
+MAINTAINER= juw@posteo.de
+COMMENT= Matrix-WhatsApp puppeting bridge
+WWW= https://maunium.net/go/mautrix-whatsapp/
+
+LICENSE= AGPLv3
+LICENSE_FILE= ${WRKSRC}/../../LICENSE
+
+LIB_DEPENDS= libolm.so:security/olm
+
+USES= go:modules
+USE_RC_SUBR= mautrix_whatsapp
+
+GO_MODULE= go.mau.fi/mautrix-whatsapp
+
+WRKSRC_SUBDIR= cmd/${PORTNAME}
+
+post-install:
+ ${MKDIR} ${STAGEDIR}/${ETCDIR}
+ ${MKDIR} ${STAGEDIR}/var/log/mautrix-whatsapp
+
+.include <bsd.port.mk>
diff --git a/net-im/mautrix-whatsapp/distinfo b/net-im/mautrix-whatsapp/distinfo
new file mode 100644
index 000000000000..c9cde8ff7a67
--- /dev/null
+++ b/net-im/mautrix-whatsapp/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1755441631
+SHA256 (go/net-im_mautrix-whatsapp/mautrix-whatsapp-v0.12.4/v0.12.4.mod) = e9bbcdc23e1db37815ec870fe4a8d227bd113509e21e3382d34dcf502b0759ca
+SIZE (go/net-im_mautrix-whatsapp/mautrix-whatsapp-v0.12.4/v0.12.4.mod) = 1737
+SHA256 (go/net-im_mautrix-whatsapp/mautrix-whatsapp-v0.12.4/v0.12.4.zip) = 340189c5a9f6559fd4b2e4ba447cb2cccf22bbeff82a04d01e7924a39034f792
+SIZE (go/net-im_mautrix-whatsapp/mautrix-whatsapp-v0.12.4/v0.12.4.zip) = 170704
diff --git a/net-im/mautrix-whatsapp/files/mautrix_whatsapp.in b/net-im/mautrix-whatsapp/files/mautrix_whatsapp.in
new file mode 100644
index 000000000000..36b5298ffb6f
--- /dev/null
+++ b/net-im/mautrix-whatsapp/files/mautrix_whatsapp.in
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# PROVIDE: mautrix_whatsapp
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# mautrix_whatsapp_enable (bool): Set to NO by default.
+# Set it to YES to enable mautrix_whatsapp.
+# mautrix_whatsapp_config (path): Set to %%ETCDIR%%/config.yaml
+# by default.
+# mautrix_whatsapp_logfile (path): Set to /var/log/mautrix-whatsapp/mautrix-whatsapp.log
+# by default.
+# mautrix_whatsapp_user (user): Set user to run mautrix-whatsapp.
+# Default is "mautrix-whatsapp".
+# mautrix_whatsapp_group (group): Set group to run mautrix-whatsapp.
+# Default is "mautrix-whatsapp".
+
+. /etc/rc.subr
+
+desc="Matrix-WhatsApp puppeting bridge"
+name=mautrix_whatsapp
+rcvar=mautrix_whatsapp_enable
+
+load_rc_config $name
+
+: ${mautrix_whatsapp_enable:=NO}
+: ${mautrix_whatsapp_config=%%ETCDIR%%/config.yaml}
+: ${mautrix_whatsapp_logfile=/var/log/mautrix-whatsapp/mautrix-whatsapp.log}
+: ${mautrix_whatsapp_user=mautrix-whatsapp}
+: ${mautrix_whatsapp_group=mautrix-whatsapp}
+
+command=/usr/sbin/daemon
+procname=/usr/local/bin/mautrix-whatsapp
+pidfile=/var/run/${name}.pid
+
+command_args="-cf -p ${pidfile} -o ${mautrix_whatsapp_logfile} -H ${procname} -c ${mautrix_whatsapp_config}"
+
+start_precmd=mautrix_whatsapp_startprecmd
+
+mautrix_whatsapp_startprecmd()
+{
+ if [ ! -e ${pidfile} ]; then
+ install -o ${mautrix_whatsapp_user} -g ${mautrix_whatsapp_group} /dev/null ${pidfile}
+ fi
+
+ if [ ! -e ${mautrix_whatsapp_logfile} ]; then
+ install -o ${mautrix_whatsapp_user} -g ${mautrix_whatsapp_group} /dev/null ${mautrix_whatsapp_logfile}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/net-im/mautrix-whatsapp/pkg-descr b/net-im/mautrix-whatsapp/pkg-descr
new file mode 100644
index 000000000000..44e25349c391
--- /dev/null
+++ b/net-im/mautrix-whatsapp/pkg-descr
@@ -0,0 +1,3 @@
+Mautrix-whatsapp is a Matrix-WhatsApp puppeting bridge, which means it runs
+along a Matrix server and relays messages between a WhatsApp account and a
+Matrix account.
diff --git a/net-im/mautrix-whatsapp/pkg-plist b/net-im/mautrix-whatsapp/pkg-plist
new file mode 100644
index 000000000000..0a55f7b240c4
--- /dev/null
+++ b/net-im/mautrix-whatsapp/pkg-plist
@@ -0,0 +1,3 @@
+bin/mautrix-whatsapp
+@dir(mautrix-whatsapp,mautrix-whatsapp) %%ETCDIR%%
+@dir(mautrix-whatsapp,mautrix-whatsapp) /var/log/mautrix-whatsapp