summaryrefslogtreecommitdiff
path: root/media-video/unifi-video
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/unifi-video')
-rw-r--r--media-video/unifi-video/Manifest7
-rw-r--r--media-video/unifi-video/files/commons-daemon-move.patch12
-rw-r--r--media-video/unifi-video/files/mongod-wrapper3
-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.ebuild82
7 files changed, 144 insertions, 0 deletions
diff --git a/media-video/unifi-video/Manifest b/media-video/unifi-video/Manifest
new file mode 100644
index 000000000000..2663ff794b84
--- /dev/null
+++ b/media-video/unifi-video/Manifest
@@ -0,0 +1,7 @@
+AUX commons-daemon-move.patch 337 BLAKE2B 79e847ce6e1c32c3cfbe192d8dce33175e2c0ef87b658d5ec8a3e8071bb737e8ea5d67814078d3c7693660879fca1a6c9038a124f19713382b0ded337bbf09ee SHA512 da836d7010769a0a81a959db4bb279418efeac75e2e444471d800889a6f2ff06227a76f04de9857da619af549b76f145263ca4c106d5485edcae679f9cf92ec5
+AUX mongod-wrapper 101 BLAKE2B cc52f011b065322fb7ebec982c5d0b188f4c72859770dec98bf002d6bcc9c43d520e0845ceaf1458efc4ed07bbccfb5c723ece61298bf6f2bfdebd363bebe4e7 SHA512 5895a2113cc165275587e9683a2e3a7de20ac5db75fc26b00bf55a619bc8ff18ead3f5465cefe0a02bea996d2d178a4954cc7fba84df76e27ea699d2be9ecc96
+AUX unifi-video.initd 467 BLAKE2B c68d4b1efc3a2583e8624d306d667585022d27aa0ad4f2becd9569c8086b568e5c84508f2cc71c81605cc124bc17cd42c884d477b15181dba73544fc254610c1 SHA512 1cd4345daf09a27dcb8528abd076e920e30b6ff7a505acad74fdc291164c94569946cd493563331c5e52cb95c45e18522520aee47555db438fa87c46d07e35c5
+AUX unifi-video.service 209 BLAKE2B fd4d96fbd353c795621ec6ad2cb23d8c27132071ebee2843364283da712e46f8fb1d1fcb9ce7b3f042938a55cf3689c7976095ed2f5e72b71bb915ae8a32763d SHA512 ea6eb21bc15c887f4f5e27669bb72eb31db9d8af48d9efdfc32901f1eeff2fb1626ce161dab2bf636eabd4a49c16966cfc55dcd8e572f01a829f491248f7b474
+DIST unifi-video.Ubuntu16.04_amd64.v3.9.7.deb 117374890 BLAKE2B b0f274da3052471472cd2405ec0a5d79fd97cbc30f014ede42a004dcffc4d27b9b5ecc36f32b4f60f8c47ba73b85795d2851345f5472b85192cf836bfb929173 SHA512 9a0f48d81f3935baad4004681cabe2ff46f4f86f8770c260c98fbd724de2949427de8ec706d86d612a9ccbcda69ca227aa4a123c3208e0a4ab7c0a51540c06f8
+EBUILD unifi-video-3.9.7.ebuild 1915 BLAKE2B 8f5b52c6fcee9b79c2d26299df1a8b7e4c8db8b39d75355eb620e8bc96dba886f3a89b57ffbf42fbee444dda8151272fe0c6cfdd85f601bcc7507ae4837fba6e SHA512 1f55c2c3722a22fd36593b36460994938db7e1dc5b19f1dfeee6917152527863ee175076556583ab8273eb64e39e7e2c7111e4c88f76e4d654f872368d991d6c
+MISC metadata.xml 245 BLAKE2B 5323e1eec795a67d15f768c9c6dea0f5501b8f0350586558ad25708a6b13398fc55b6afa97e621e5895a879bdf1594b8323d98a31e39735e2338a6e938288668 SHA512 1b915771c263fd188289f5f3c0168e44a651d52d173dbd35f9dc94795a3227fd1133f2c08a0f30341b42a0cba6f5b0d0ce68dcd6dfc66ff3e225c98b443eb00c
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 100644
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.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..8526a98d1ea6
--- /dev/null
+++ b/media-video/unifi-video/unifi-video-3.9.7.ebuild
@@ -0,0 +1,82 @@
+# 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}
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}