From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CFDE3138334 for ; Tue, 26 Jun 2018 00:50:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C0B05E0953; Tue, 26 Jun 2018 00:50:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8824DE0953 for ; Tue, 26 Jun 2018 00:50:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 20B3B335C70 for ; Tue, 26 Jun 2018 00:50:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6D9C12DA for ; Tue, 26 Jun 2018 00:50:28 +0000 (UTC) From: "Ben Kohler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ben Kohler" Message-ID: <1529974181.0c5276e4940f2bbd352653c2e3efdeeb9b6cfc81.bkohler@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/unifi-video/files/, media-video/unifi-video/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/unifi-video/Manifest media-video/unifi-video/files/commons-daemon-move.patch media-video/unifi-video/files/mongod-wrapper media-video/unifi-video/files/unifi-video.confd media-video/unifi-video/files/unifi-video.initd media-video/unifi-video/files/unifi-video.service media-video/unifi-video/metadata.xml media-video/unifi-video/unifi-video-3.9.7.ebuild X-VCS-Directories: media-video/unifi-video/ media-video/unifi-video/files/ X-VCS-Committer: bkohler X-VCS-Committer-Name: Ben Kohler X-VCS-Revision: 0c5276e4940f2bbd352653c2e3efdeeb9b6cfc81 X-VCS-Branch: master Date: Tue, 26 Jun 2018 00:50:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9b6b10f7-4c34-48e2-b504-674453e85aa5 X-Archives-Hash: 8d4eff25796e292e841768a020131d0b commit: 0c5276e4940f2bbd352653c2e3efdeeb9b6cfc81 Author: Ben Kohler gentoo org> AuthorDate: Tue Jun 26 00:49:41 2018 +0000 Commit: Ben Kohler gentoo org> CommitDate: Tue Jun 26 00:49:41 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c5276e4 media-video/unifi-video: new package Package-Manager: Portage-2.3.40, Repoman-2.3.9 media-video/unifi-video/Manifest | 1 + .../unifi-video/files/commons-daemon-move.patch | 12 ++++ media-video/unifi-video/files/mongod-wrapper | 3 + media-video/unifi-video/files/unifi-video.confd | 0 media-video/unifi-video/files/unifi-video.initd | 20 ++++++ media-video/unifi-video/files/unifi-video.service | 11 +++ media-video/unifi-video/metadata.xml | 9 +++ media-video/unifi-video/unifi-video-3.9.7.ebuild | 83 ++++++++++++++++++++++ 8 files changed, 139 insertions(+) diff --git a/media-video/unifi-video/Manifest b/media-video/unifi-video/Manifest new file mode 100644 index 00000000000..db2ca191aa8 --- /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 00000000000..448f77249e8 --- /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 00000000000..f2eb2a43752 --- /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 00000000000..e69de29bb2d 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 00000000000..55d6e805453 --- /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 00000000000..6587be4f1ca --- /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 00000000000..ee9a82ac417 --- /dev/null +++ b/media-video/unifi-video/metadata.xml @@ -0,0 +1,9 @@ + + + + + bkohler@gentoo.org + Ben Kohler + + + 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 00000000000..be829f6a0a9 --- /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 +}