summaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2019-01-17 17:34:17 +0000
committerSteve Wills <swills@FreeBSD.org>2019-01-17 17:34:17 +0000
commit462d6e7219e548a36730d6932ee1175f3f5689fd (patch)
tree03d7c2c08716510a7e29d32dc0e447faf0919827 /net-im
parent7ca69563ec4e96ac47151510cf6ff1575e757889 (diff)
downloadfreebsd-ports-462d6e7219e548a36730d6932ee1175f3f5689fd.zip
net-im/matterbridge: create port
Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocket.chat,hipchat (via xmpp), steam, twitch, ssh-chat, zulip and matrix with REST API (mattermost not required!) WWW: https://github.com/42wim/matterbridge
Diffstat (limited to 'net-im')
-rw-r--r--net-im/Makefile1
-rw-r--r--net-im/matterbridge/Makefile41
-rw-r--r--net-im/matterbridge/distinfo3
-rw-r--r--net-im/matterbridge/files/matterbridge.in42
-rw-r--r--net-im/matterbridge/pkg-descr5
-rw-r--r--net-im/matterbridge/pkg-plist2
6 files changed, 94 insertions, 0 deletions
diff --git a/net-im/Makefile b/net-im/Makefile
index 89400d634594..075a240d0bf7 100644
--- a/net-im/Makefile
+++ b/net-im/Makefile
@@ -71,6 +71,7 @@
SUBDIR += licq-qt-gui
SUBDIR += linux-telegram-desktop
SUBDIR += loudmouth
+ SUBDIR += matterbridge
SUBDIR += matterircd
SUBDIR += mbpurple
SUBDIR += mcabber
diff --git a/net-im/matterbridge/Makefile b/net-im/matterbridge/Makefile
new file mode 100644
index 000000000000..d7232ccdb334
--- /dev/null
+++ b/net-im/matterbridge/Makefile
@@ -0,0 +1,41 @@
+# $FreeBSD$
+
+PORTNAME= matterbridge
+PORTVERSION= 1.12.3
+DISTVERSIONPREFIX= v
+CATEGORIES= net-im
+
+MAINTAINER= swills@FreeBSD.org
+COMMENT= Chat network bridge
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= go:lang/go
+
+USE_GITHUB= yes
+GH_ACCOUNT= 42wim
+GH_SUBDIR= src/github.com/42wim/matterbridge
+
+USE_RC_SUBR= matterbridge
+
+MATTERBRIDGE_USER?= mattermost
+MATTERBRIDGE_GROUP?= mattermost
+USERS= ${MATTERBRIDGE_USER}
+GROUPS= ${MATTERBRIDGE_GROUP}
+SUB_LIST= \
+ MATTERBRIDGE_USER=${MATTERBRIDGE_USER} \
+ MATTERBRIDGE_GROUP=${MATTERBRIDGE_GROUP}
+PLIST_SUB= \
+ MATTERBRIDGE_USER=${MATTERBRIDGE_USER} \
+ MATTERBRIDGE_GROUP=${MATTERBRIDGE_GROUP}
+
+do-build:
+ @cd ${WRKSRC}/src/github.com/42wim/matterbridge && \
+ ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build -o bin/${PORTNAME}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/matterbridge.toml.sample ${STAGEDIR}${PREFIX}/etc/matterbridge.toml.sample
+
+.include <bsd.port.mk>
diff --git a/net-im/matterbridge/distinfo b/net-im/matterbridge/distinfo
new file mode 100644
index 000000000000..f27ae820fb7d
--- /dev/null
+++ b/net-im/matterbridge/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1546657042
+SHA256 (42wim-matterbridge-v1.12.3_GH0.tar.gz) = 240a76ea0c6d1cd4e671edf2684a606d052236e1140ce3c45582831f01d3ae12
+SIZE (42wim-matterbridge-v1.12.3_GH0.tar.gz) = 4719145
diff --git a/net-im/matterbridge/files/matterbridge.in b/net-im/matterbridge/files/matterbridge.in
new file mode 100644
index 000000000000..61fdbd926c42
--- /dev/null
+++ b/net-im/matterbridge/files/matterbridge.in
@@ -0,0 +1,42 @@
+#!/bin/sh
+# PROVIDE: matterbridge
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable matterbridge:
+#
+# matterbridge_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable matterbridge
+# matterbridge_config (str): Set to "%%PREFIX%%/etc/matterbridge.toml" by default.
+# Set it to path to mattermost config file
+# matterbridge_user (str): Set to "%%MATTERBRIDGE_USER%%" by default.
+# Set it to user to run matterbridge under
+# matterbridge_group (str): Set to "%%MATTERBRIDGE_GROUP%%" by default.
+# Set it to group to run matterbridge under
+# matterbridge_syslogtag (str):Set to "matterbridge" by default.
+# Set it to tag to be used by syslog
+#
+
+. /etc/rc.subr
+
+name="matterbridge"
+rcvar="matterbridge_enable"
+
+load_rc_config $name
+
+: ${matterbridge_enable:="NO"}
+: ${matterbridge_config:="%%PREFIX%%/etc/matterbridge.toml"}
+: ${matterbridge_user:="%%MATTERBRIDGE_USER%%"}
+: ${matterbridge_group:="%%MATTERBRIDGE_GROUP%%"}
+: ${matterbridge_syslogtag:="matterbridge"}
+
+pidfile="/var/run/matterbridge/${name}.pid"
+
+command="/usr/sbin/daemon"
+command_args="-S -T ${matterbridge_syslogtag} -m 3 -c -p ${pidfile} env ${matterbridge_env} %%PREFIX%%/bin/matterbridge -conf ${matterbridge_config} ${matterbridge_args}"
+procname=%%PREFIX%%/bin/matterbridge
+
+start_precmd="install -d -m 775 -o ${matterbridge_user} -g ${matterbridge_group} /var/run/matterbridge"
+
+run_rc_command $1
diff --git a/net-im/matterbridge/pkg-descr b/net-im/matterbridge/pkg-descr
new file mode 100644
index 000000000000..5d664edad70f
--- /dev/null
+++ b/net-im/matterbridge/pkg-descr
@@ -0,0 +1,5 @@
+Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram,
+rocket.chat,hipchat (via xmpp), steam, twitch, ssh-chat, zulip and matrix with
+REST API (mattermost not required!)
+
+WWW: https://github.com/42wim/matterbridge
diff --git a/net-im/matterbridge/pkg-plist b/net-im/matterbridge/pkg-plist
new file mode 100644
index 000000000000..26b9ff0825b0
--- /dev/null
+++ b/net-im/matterbridge/pkg-plist
@@ -0,0 +1,2 @@
+bin/matterbridge
+@sample(%%MATTERBRIDGE_USER%%,%%MATTERBRIDGE_GROUP%%,440) etc/matterbridge.toml.sample