pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/chat/matrix-synapse matrix-synapse: Add SMF manifest.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aefe8789115b
branches:  trunk
changeset: 450383:aefe8789115b
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Thu Apr 15 15:54:00 2021 +0000

description:
matrix-synapse: Add SMF manifest.

While here use PKG_SYSCONFSUBDIR to simplify things.

diffstat:

 chat/matrix-synapse/MESSAGE                 |   6 +++---
 chat/matrix-synapse/Makefile                |   5 ++++-
 chat/matrix-synapse/files/matrix-synapse.sh |   2 +-
 chat/matrix-synapse/files/smf/manifest.xml  |  28 ++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 5 deletions(-)

diffs (90 lines):

diff -r 2e2e9db11763 -r aefe8789115b chat/matrix-synapse/MESSAGE
--- a/chat/matrix-synapse/MESSAGE       Thu Apr 15 15:29:03 2021 +0000
+++ b/chat/matrix-synapse/MESSAGE       Thu Apr 15 15:54:00 2021 +0000
@@ -1,13 +1,13 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.1 2020/09/04 20:34:11 js Exp $
+$NetBSD: MESSAGE,v 1.2 2021/04/15 15:54:00 jperkin Exp $
 
 To generate a Synapse configuration, run:
 
 cd ${SYNAPSE_DATA} &&
 ${PYTHONBIN} -m synapse.app.homeserver \
        --server-name my.domain.name \
-       --config-path ${PKG_SYSCONFDIR}/matrix-synapse/homeserver.yaml \
-       --config-directory ${PKG_SYSCONFDIR}/matrix-synapse \
+       --config-path ${PKG_SYSCONFDIR}/homeserver.yaml \
+       --config-directory ${PKG_SYSCONFDIR} \
        --generate-config \
        --report-stats=no
 
diff -r 2e2e9db11763 -r aefe8789115b chat/matrix-synapse/Makefile
--- a/chat/matrix-synapse/Makefile      Thu Apr 15 15:29:03 2021 +0000
+++ b/chat/matrix-synapse/Makefile      Thu Apr 15 15:54:00 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2021/03/14 21:21:13 js Exp $
+# $NetBSD: Makefile,v 1.20 2021/04/15 15:54:00 jperkin Exp $
 
 DISTNAME=      matrix-synapse-1.29.0
 CATEGORIES=    chat
@@ -49,6 +49,8 @@
 USE_TOOLS+=    perl:run
 REPLACE_PERL+= scripts/sync_room_to_group.pl
 
+PKG_SYSCONFSUBDIR=     matrix-synapse
+
 SYNAPSE_USER?= synapse
 SYNAPSE_GROUP?=        ${SYNAPSE_USER}
 SYNAPSE_DATA?= ${VARBASE}/db/matrix-synapse
@@ -68,6 +70,7 @@
 
 FILES_SUBST+=  SYNAPSE_DATA=${SYNAPSE_DATA:Q}
 FILES_SUBST+=  SYNAPSE_USER=${SYNAPSE_USER:Q}
+FILES_SUBST+=  SYNAPSE_GROUP=${SYNAPSE_GROUP:Q}
 MESSAGE_SUBST+=        PYTHONBIN=${PYTHONBIN:Q}
 MESSAGE_SUBST+=        SYNAPSE_DATA=${SYNAPSE_DATA:Q}
 
diff -r 2e2e9db11763 -r aefe8789115b chat/matrix-synapse/files/matrix-synapse.sh
--- a/chat/matrix-synapse/files/matrix-synapse.sh       Thu Apr 15 15:29:03 2021 +0000
+++ b/chat/matrix-synapse/files/matrix-synapse.sh       Thu Apr 15 15:54:00 2021 +0000
@@ -10,7 +10,7 @@
 name="matrix-synapse"
 rcvar="matrix_synapse"
 ctl_command="@PREFIX@/bin/synctl"
-conf_file="@PKG_SYSCONFDIR@/matrix-synapse/homeserver.yaml"
+conf_file="@PKG_SYSCONFDIR@/homeserver.yaml"
 required_files="$conf_file"
 pidfile="@SYNAPSE_DATA@/homeserver.pid"
 #start_precmd="ulimit -n 2048"
diff -r 2e2e9db11763 -r aefe8789115b chat/matrix-synapse/files/smf/manifest.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/matrix-synapse/files/smf/manifest.xml        Thu Apr 15 15:54:00 2021 +0000
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type='manifest' name='@SMF_NAME@'>
+  <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
+    <create_default_instance enabled='false' />
+    <single_instance />
+    <dependency name='network' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/milestone/network:default' />
+    </dependency>
+    <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/filesystem/local:default' />
+    </dependency>
+    <method_context>
+      <method_credential user='@SYNAPSE_USER@' group='@SYNAPSE_GROUP@' />
+    </method_context>
+    <exec_method type='method' name='start' exec='@PREFIX@/bin/synctl start @PKG_SYSCONFDIR@/homeserver.yaml' timeout_seconds="60" />
+    <exec_method type='method' name='stop' exec='@PREFIX@/bin/synctl stop @PKG_SYSCONFDIR@/homeserver.yaml' timeout_seconds="60" />
+    <exec_method type='method' name='restart' exec='@PREFIX@/bin/synctl restart @PKG_SYSCONFDIR@/homeserver.yaml' timeout_seconds="60" />
+    <template>
+      <common_name>
+        <loctext xml:lang='C'>Matrix Homeserver</loctext>
+      </common_name>
+      <documentation>
+        <doc_link name='homepage' uri='https://github.com/matrix-org/synapse/' />
+      </documentation>
+    </template>
+  </service>
+</service_bundle>



Home | Main Index | Thread Index | Old Index