summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Webster2016-04-18 20:19:19 -0700
committerDonald Webster2016-04-18 20:19:19 -0700
commitd0ebc676734bf27e330811032290f72fc3d25b78 (patch)
tree95265c2fc212b7245dc41b7f5bb55a69f8323c43
downloadaur-d0ebc676734bf27e330811032290f72fc3d25b78.tar.gz
Initial commit, moving package to 'unifi-video' instead of 'unifi-video-bin'.
-rw-r--r--.SRCINFO25
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD46
-rw-r--r--unifi-video.install9
-rw-r--r--unifi-video.patch11
-rw-r--r--unifi-video.service13
-rw-r--r--unifi-video.sysusers1
7 files changed, 108 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..262435bc44e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+# Generated by mksrcinfo v8
+# Tue Apr 19 03:18:52 UTC 2016
+pkgbase = unifi-video
+ pkgdesc = Centralized management system for Ubiquiti UniFi Surveillance Cameras
+ pkgver = 3.2.2
+ pkgrel = 1
+ url = https://www.ubnt.com/
+ install = unifi-video.install
+ arch = x86_64
+ license = custom
+ depends = mongodb
+ depends = jre8-openjdk-headless
+ depends = java-jsvc
+ depends = lsb-release
+ source = http://dl.ubnt.com/firmwares/unifi-video/3.2.2/unifi-video_3.2.2~Ubuntu14.04_amd64.deb
+ source = unifi-video.service
+ source = unifi-video.sysusers
+ source = unifi-video.patch
+ sha256sums = 4dba35c7d948567f098f13f5ac1faff7e4601ae99bc6477b8817a69f0dcfaeb4
+ sha256sums = e0b26acb0d6c3c66e4b21d1f96db357532f2bc52c48acc7a5c3c9b6a21115819
+ sha256sums = 90fb2f826a70d3b7815cd6a2253c2af6754c17504be28ef92ee223bd02093730
+ sha256sums = 26a11592d01ead22dbf2c083aae5cec320917902b516cfc595c12d158876bddb
+
+pkgname = unifi-video
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..e536a896e02
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/*.xz
+/src/
+/pkg/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c5bb5035065
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Donald Webster (fryfrog@gmail.com)
+
+pkgname=unifi-video
+pkgver=3.2.2
+pkgrel=1
+pkgdesc="Centralized management system for Ubiquiti UniFi Surveillance Cameras"
+arch=('x86_64')
+url="https://www.ubnt.com/"
+license=('custom')
+depends=('mongodb' 'jre8-openjdk-headless' 'java-jsvc' 'lsb-release')
+install=unifi-video.install
+source=("http://dl.ubnt.com/firmwares/unifi-video/$pkgver/unifi-video_$pkgver~Ubuntu14.04_amd64.deb"
+ 'unifi-video.service'
+ 'unifi-video.sysusers'
+ 'unifi-video.patch')
+sha256sums=('4dba35c7d948567f098f13f5ac1faff7e4601ae99bc6477b8817a69f0dcfaeb4'
+ 'e0b26acb0d6c3c66e4b21d1f96db357532f2bc52c48acc7a5c3c9b6a21115819'
+ '90fb2f826a70d3b7815cd6a2253c2af6754c17504be28ef92ee223bd02093730'
+ '26a11592d01ead22dbf2c083aae5cec320917902b516cfc595c12d158876bddb')
+
+package() {
+ msg2 "Extracting unifi-video..."
+ tar xf "${srcdir}/data.tar.gz" -C "$pkgdir"/
+
+ msg2 "Removing unwanted /etc with init.d script and sudoers file..."
+ rm -r "${pkgdir}/etc"
+
+ msg2 "Moving /usr/sbin -> /usr/bin..."
+ mv "${pkgdir}/usr/sbin" "${pkgdir}/usr/bin"
+
+ msg2 "Making unifi-video executable..."
+ chmod +x "${pkgdir}/usr/bin/unifi-video"
+
+ msg2 "Patching java version check..."
+ cd "${pkgdir}/usr/bin"
+ patch -N < "${srcdir}/unifi-video.patch"
+
+ msg2 "Installing systemd files..."
+ install -D -m 644 "${srcdir}/unifi-video.service" "${pkgdir}/usr/lib/systemd/system/unifi-video.service"
+ install -D -m 644 "${srcdir}/unifi-video.sysusers" "${pkgdir}/usr/lib/sysusers.d/unifi-video.conf"
+
+ msg2 "Creating directories..."
+ mkdir -p "${pkgdir}/usr/lib/unifi-video/logs" "${pkgdir}/usr/lib/unifi-video/work"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/unifi-video.install b/unifi-video.install
new file mode 100644
index 00000000000..f77e77276f7
--- /dev/null
+++ b/unifi-video.install
@@ -0,0 +1,9 @@
+# arg 1: the new package version
+post_install() {
+ systemd-sysusers unifi-video.conf
+ chown -R unifi-video:unifi-video /usr/lib/unifi-video/work /usr/lib/unifi-video/logs /usr/lib/unifi-video/conf /usr/lib/unifi-video/webapps
+ ln -s $( which mongod) /usr/lib/unifi-video/bin/
+ :
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/unifi-video.patch b/unifi-video.patch
new file mode 100644
index 00000000000..8c7c23e0c70
--- /dev/null
+++ b/unifi-video.patch
@@ -0,0 +1,11 @@
+--- unifi-video.old 2016-04-18 14:14:21.249318503 -0700
++++ unifi-video 2016-04-18 14:18:30.525974270 -0700
+@@ -42,7 +42,7 @@
+ is_java7_compat() {
+ local J V
+ J=$1
+- V=$($J -version 2>&1 | sed -e 's/^java version "\([^"]*\)".*/\1/;tz;d;:z')
++ V=$($J -version 2>&1 | awk -F '"' '/version/ {print $2}')
+ case "$V" in
+ 1.7*|1.8*) return 0
+ ;;
diff --git a/unifi-video.service b/unifi-video.service
new file mode 100644
index 00000000000..b760d24e269
--- /dev/null
+++ b/unifi-video.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Ubiquiti UniFi Video Server
+After=network.target
+
+[Service]
+WorkingDirectory=/usr/lib/unifi-video
+TimeoutStartSec=300
+TimeoutStopSec=300
+ExecStart=/usr/bin/unifi-video --verbose --nodetach start
+ExecStop=/usr/bin/unifi-video --verbose --nodetach stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/unifi-video.sysusers b/unifi-video.sysusers
new file mode 100644
index 00000000000..eca4d4c7844
--- /dev/null
+++ b/unifi-video.sysusers
@@ -0,0 +1 @@
+u unifi-video - "Unifi Video Service" -