summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-video')
-rw-r--r--media-video/unifi-video/Manifest1
-rw-r--r--media-video/unifi-video/files/commons-daemon-move.patch12
-rwxr-xr-xmedia-video/unifi-video/files/mongod-wrapper3
-rw-r--r--media-video/unifi-video/files/unifi-video.confd0
-rw-r--r--media-video/unifi-video/files/unifi-video.initd20
-rw-r--r--media-video/unifi-video/files/unifi-video.service11
-rw-r--r--media-video/unifi-video/metadata.xml9
-rw-r--r--media-video/unifi-video/unifi-video-3.9.7.ebuild83
8 files changed, 139 insertions, 0 deletions
diff --git a/media-video/unifi-video/Manifest b/media-video/unifi-video/Manifest
new file mode 100644
index 000000000000..db2ca191aa8b
--- /dev/null
+++ b/media-video/unifi-video/Manifest
@@ -0,0 +1 @@
+DIST unifi-video.Ubuntu16.04_amd64.v3.9.7.deb 117374890 BLAKE2B b0f274da3052471472cd2405ec0a5d79fd97cbc30f014ede42a004dcffc4d27b9b5ecc36f32b4f60f8c47ba73b85795d2851345f5472b85192cf836bfb929173 SHA512 9a0f48d81f3935baad4004681cabe2ff46f4f86f8770c260c98fbd724de2949427de8ec706d86d612a9ccbcda69ca227aa4a123c3208e0a4ab7c0a51540c06f8
diff --git a/media-video/unifi-video/files/commons-daemon-move.patch b/media-video/unifi-video/files/commons-daemon-move.patch
new file mode 100644
index 000000000000..448f77249e82
--- /dev/null
+++ b/media-video/unifi-video/files/commons-daemon-move.patch
@@ -0,0 +1,12 @@
+--- a/usr/sbin/unifi-video
++++ b/usr/sbin/unifi-video
+@@ -271,7 +271,7 @@
+ JSVC_OPTS="${JSVC_OPTS} \
+ -user ${PKGUSER} \
+ -home ${JAVA_HOME} \
+- -cp /usr/share/java/commons-daemon.jar:${MAINJAR} \
++ -cp /usr/share/commons-daemon/lib/commons-daemon.jar:${MAINJAR} \
+ -pidfile ${PIDFILE} \
+ -procname ${NAME} \
+ ${JSVC_EXTRA_OPTS} \
+
diff --git a/media-video/unifi-video/files/mongod-wrapper b/media-video/unifi-video/files/mongod-wrapper
new file mode 100755
index 000000000000..f2eb2a437520
--- /dev/null
+++ b/media-video/unifi-video/files/mongod-wrapper
@@ -0,0 +1,3 @@
+#!/bin/bash
+cleaned_args=$(echo $* | sed -e 's/--nohttpinterface//')
+/usr/bin/mongod ${cleaned_args}
diff --git a/media-video/unifi-video/files/unifi-video.confd b/media-video/unifi-video/files/unifi-video.confd
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/media-video/unifi-video/files/unifi-video.confd
diff --git a/media-video/unifi-video/files/unifi-video.initd b/media-video/unifi-video/files/unifi-video.initd
new file mode 100644
index 000000000000..55d6e805453d
--- /dev/null
+++ b/media-video/unifi-video/files/unifi-video.initd
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PID_FILE="/run/unifi-video.pid"
+
+start() {
+ ebegin "Starting unifi-video"
+ start-stop-daemon --start --quiet -b \
+ --pidfile "${PID_FILE}" -m \
+ --exec /usr/sbin/unifi-video start
+ eend $?
+ #--user nobody --group nobody \
+}
+
+stop() {
+ ebegin "Stopping unifi-video"
+ start-stop-daemon --quiet --stop -R 20 --pidfile "${PID_FILE}"
+ eend $?
+}
diff --git a/media-video/unifi-video/files/unifi-video.service b/media-video/unifi-video/files/unifi-video.service
new file mode 100644
index 000000000000..6587be4f1cac
--- /dev/null
+++ b/media-video/unifi-video/files/unifi-video.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=UniFi Video Server
+Requires=network.target
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/unifi-video -D start
+ExecStop=/usr/sbin/unifi-video -D stop
+
+[Install]
+WantedBy=network.target
diff --git a/media-video/unifi-video/metadata.xml b/media-video/unifi-video/metadata.xml
new file mode 100644
index 000000000000..ee9a82ac4170
--- /dev/null
+++ b/media-video/unifi-video/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bkohler@gentoo.org</email>
+ <name>Ben Kohler</name>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/media-video/unifi-video/unifi-video-3.9.7.ebuild b/media-video/unifi-video/unifi-video-3.9.7.ebuild
new file mode 100644
index 000000000000..be829f6a0a98
--- /dev/null
+++ b/media-video/unifi-video/unifi-video-3.9.7.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd user
+
+MY_PV="${PV/_beta/-beta.}"
+DESCRIPTION="UniFi Video Server"
+HOMEPAGE="https://www.ubnt.com/download/unifi-video/"
+SRC_URI="https://dl.ubnt.com/firmwares/ufv/v${MY_PV}/unifi-video.Ubuntu16.04_amd64.v${MY_PV}.deb"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+RESTRICT="mirror"
+
+DEPEND=""
+RDEPEND="dev-db/mongodb
+ dev-java/commons-daemon
+ sys-apps/lsb-release
+ sys-libs/libcap
+ virtual/jre"
+
+S=${WORKDIR}
+QA_PREBUILT="/usr/lib*/${PN}/lib/*.so /usr/lib*/${PN}/bin/*"
+
+pkg_setup() {
+ enewuser ${PN}
+ enewgroup ${PN}
+}
+
+src_unpack() {
+ default
+ unpack "${WORKDIR}"/data.tar.gz
+}
+
+src_prepare() {
+ eapply "${FILESDIR}"/commons-daemon-move.patch
+ sed -i usr/sbin/${PN} \
+ -e '/require_root$/d' \
+ -e '/update_limits$/d' \
+ -e '/ulimit/d' \
+ -e '/coredump_filter/d' || die
+ default
+}
+
+src_install() {
+ static_dir="/usr/$(get_libdir)/${PN}"
+ #install static data
+ insinto ${static_dir}
+ doins -r usr/lib/${PN}/*
+ fperms -R +x ${static_dir}/bin
+
+ #wrapper to work around mongodb-3.6 compat issue
+ exeinto ${static_dir}/bin/
+ newexe "${FILESDIR}"/mongod-wrapper mongod
+
+ #prepare runtime-data dirs which live in /var but are symlinked from static
+ #data dir, and are writable by non-root user
+ dodir /var/log/${PN}
+ fowners ${PN}:${PN} /var/log/${PN}
+ dosym ../../../var/log/${PN} ${static_dir}/logs
+
+ dodir /var/lib/${PN}/work
+ fowners ${PN}:${PN} /var/lib/${PN}/work
+ dosym ../../../var/lib/${PN}/work ${static_dir}/work
+
+ keepdir /var/lib/${PN}/data
+ fowners ${PN}:${PN} /var/lib/${PN}/data
+ dosym ../../../var/lib/${PN}/data ${static_dir}/data
+
+ echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
+ doenvd "${T}"/99${PN}
+
+ into /usr
+ dosbin usr/sbin/${PN}
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}