summaryrefslogtreecommitdiff
path: root/user/mistserver
diff options
context:
space:
mode:
authorSheila Aman <sheila@vulpine.house>2022-02-10 18:00:45 -0800
committerZach van Rijn <me@zv.io>2022-10-21 18:33:58 -0500
commite1de1097ca5a5f0c2bfa32565192f7978e263494 (patch)
treeefa69417d0da41d9fe9c3c8cfd554bfc262ef104 /user/mistserver
parent6b1074871b51c668e7cb02299fa046ecab149b77 (diff)
downloadpackages-e1de1097ca5a5f0c2bfa32565192f7978e263494.tar.gz
packages-e1de1097ca5a5f0c2bfa32565192f7978e263494.tar.bz2
packages-e1de1097ca5a5f0c2bfa32565192f7978e263494.tar.xz
packages-e1de1097ca5a5f0c2bfa32565192f7978e263494.zip
user/mistserver: new package.
Diffstat (limited to 'user/mistserver')
-rw-r--r--user/mistserver/APKBUILD53
-rw-r--r--user/mistserver/link-execinfo.patch11
-rw-r--r--user/mistserver/mistserver.confd7
-rwxr-xr-xuser/mistserver/mistserver.initd29
-rw-r--r--user/mistserver/mistserver.pre-install7
5 files changed, 107 insertions, 0 deletions
diff --git a/user/mistserver/APKBUILD b/user/mistserver/APKBUILD
new file mode 100644
index 000000000..19fbfa70b
--- /dev/null
+++ b/user/mistserver/APKBUILD
@@ -0,0 +1,53 @@
+# Contributor: Síle Ekaterin Liszka <sheila@vulpine.house>
+# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house>
+pkgname=mistserver
+pkgver=2.18.1
+pkgrel=0
+pkgdesc="Multimedia streaming services"
+url="https://mistserver.org"
+arch="all"
+license="Zlib AND AGPL-3.0-only"
+depends=""
+install="$pkgname.pre-install"
+makedepends="cmake libexecinfo-dev mbedtls-dev<3"
+pkgusers="mistserver"
+pkggroups="mistserver"
+subpackages="$pkgname-dev $pkgname-openrc"
+source="mistserver-$pkgver.tar.gz::https://github.com/DDVTECH/mistserver/archive/refs/tags/$pkgver.tar.gz
+ mistserver.confd
+ mistserver.initd
+ link-execinfo.patch"
+
+build() {
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=RelWithDebugInfo \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS -fPIC" \
+ -DCMAKE_C_FLAGS="$CFLAGS -fPIC" \
+ ${CMAKE_CROSSOPTS} \
+ .
+ make -j1
+}
+
+check() {
+ CTEST_OUTPUT_ON_FAILURE=TRUE ctest
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+
+ # OpenRC
+
+ install -Dm755 "$srcdir"/mistserver.initd "$pkgdir"/etc/init.d/mistserver
+ install -Dm644 "$srcdir"/mistserver.confd "$pkgdir"/etc/conf.d/mistserver
+}
+
+sha512sums="671574687ecabf9b8134f2eef033b66fd13cc4463e2edcf34fe69ff9221b30ddb7ce6a6db3d82708c21fad0910bd0225c483060d36058e0ba778eadd5b8c6e82 mistserver-2.18.1.tar.gz
+7288adab6589f2facc1cb794057b1c5d9ec94e12e60d6afc8f6f25c54a8e908cc9841b83b5a6e608fa799fd6aa11767e92a963004182d45f7be9ccd3b65097e7 mistserver.confd
+e0c7df42f4d486983ece1ea50ab8f3006ebab5386881c14c4b2ff1246b6dd38ace935dc54f8f8a7687edb7ca5975b8c26abd6e99957b8c892862732263d49eb9 mistserver.initd
+a27bac965078f7eafb339ae7be9e50519d5728ae4f5d725905d5eecbb3fdf048df3e150cfa881be4bab754ca674a11271343156d5d97758d2ca65bef5bff55a6 link-execinfo.patch"
diff --git a/user/mistserver/link-execinfo.patch b/user/mistserver/link-execinfo.patch
new file mode 100644
index 000000000..ed5c088bc
--- /dev/null
+++ b/user/mistserver/link-execinfo.patch
@@ -0,0 +1,11 @@
+diff -ur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2022-02-11 00:15:16.610459631 +0000
++++ b/CMakeLists.txt 2022-02-11 00:15:01.221072666 +0000
+@@ -191,6 +191,7 @@
+ endif()
+ target_link_libraries(mist
+ -lpthread
++ -lexecinfo
+ ${LIBRT}
+ )
+ if (NOT DEFINED NOSSL )
diff --git a/user/mistserver/mistserver.confd b/user/mistserver/mistserver.confd
new file mode 100644
index 000000000..e0c085d5f
--- /dev/null
+++ b/user/mistserver/mistserver.confd
@@ -0,0 +1,7 @@
+# Configuration for mistserver
+#
+# Config file location
+#MIST_CONFIG=/etc/mistserver.conf
+
+# Log file location
+#MIST_LOG=/var/log/mistserver.log
diff --git a/user/mistserver/mistserver.initd b/user/mistserver/mistserver.initd
new file mode 100755
index 000000000..9f2765c40
--- /dev/null
+++ b/user/mistserver/mistserver.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+
+description="MistServer multimedia streaming service"
+
+: ${MIST_CONFIG:=/etc/mistserver.conf}
+: ${MIST_LOG:=/var/log/mistserver.log}
+
+depend() {
+ need net
+ use logger dns
+ after sshd firewall
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec MistController \
+ -- -L ${MIST_LOG} -c ${MIST_CONFIG}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE} \
+ --exec MistController
+ eend $?
+}
diff --git a/user/mistserver/mistserver.pre-install b/user/mistserver/mistserver.pre-install
new file mode 100644
index 000000000..9ef5b5f2e
--- /dev/null
+++ b/user/mistserver/mistserver.pre-install
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+groupadd -r mistserver 2>/dev/null
+useradd -c mistserver -s /sbin/nologin -g mistserver \
+ -m -r mistserver 2>/dev/null
+
+exit 0