summaryrefslogtreecommitdiffstats
path: root/net-wireless/unifi
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-09-16 19:21:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-09-16 19:21:29 +0200
commitf0f677836809b06ccea9e9f9ec93cac71e8f1b24 (patch)
tree98961ef2315416ebe4ac9550a7fc935481bdb20e /net-wireless/unifi
parentRemove java (diff)
downloadportage-f0f677836809b06ccea9e9f9ec93cac71e8f1b24.tar.xz
portage-f0f677836809b06ccea9e9f9ec93cac71e8f1b24.zip
Add unifi
Diffstat (limited to 'net-wireless/unifi')
-rw-r--r--net-wireless/unifi/Manifest1
-rw-r--r--net-wireless/unifi/files/unifi.conf7
-rw-r--r--net-wireless/unifi/files/unifi.init28
-rw-r--r--net-wireless/unifi/files/unifi.service11
-rw-r--r--net-wireless/unifi/unifi-5.0.7.ebuild44
5 files changed, 91 insertions, 0 deletions
diff --git a/net-wireless/unifi/Manifest b/net-wireless/unifi/Manifest
new file mode 100644
index 0000000..f5a321f
--- /dev/null
+++ b/net-wireless/unifi/Manifest
@@ -0,0 +1 @@
+DIST unifi-5.0.7.zip 81114695 SHA256 d993c555532704f5f1a738316db8d7b7c34e478e63ff43e9beb16cd50a406f9c SHA512 1614344529e23a8bde88f608b4049b27e92ad7887e6f1dfd475f03fe1563ed8748901e1c3044de33e05b61c8fb4b23bb9184d373d46e2d0e3a760e4f9a094244 WHIRLPOOL b3d9e6fa2257dea6131ef99bfe8b0eec6280fe87de704c942c9eab467f909d31d13782a79d44164e4d13653d0fecf5a48b7d0fe8f5ae53134de6883ddd11b7a8
diff --git a/net-wireless/unifi/files/unifi.conf b/net-wireless/unifi/files/unifi.conf
new file mode 100644
index 0000000..3b8cd77
--- /dev/null
+++ b/net-wireless/unifi/files/unifi.conf
@@ -0,0 +1,7 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# /etc/conf.d/unifi.conf
+
+#JAVA_HOME="/usr"
diff --git a/net-wireless/unifi/files/unifi.init b/net-wireless/unifi/files/unifi.init
new file mode 100644
index 0000000..fc2e40d
--- /dev/null
+++ b/net-wireless/unifi/files/unifi.init
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+PID_FILE="/var/run/unifi.pid"
+DAEMON="${JAVA_HOME-/usr}"/bin/java
+UNIFI_PATH="/usr/lib/unifi"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting unifi"
+ cd "${UNIFI_PATH}"
+ start-stop-daemon --start --quiet -b \
+ --pidfile "${PID_FILE}" -m \
+ --exec ${DAEMON} -- -jar lib/ace.jar start
+ eend $?
+ #--user nobody --group nobody \
+}
+
+stop() {
+ ebegin "Stopping unifi"
+ start-stop-daemon --quiet --stop -R 20 --pidfile "${PID_FILE}"
+ eend $?
+}
diff --git a/net-wireless/unifi/files/unifi.service b/net-wireless/unifi/files/unifi.service
new file mode 100644
index 0000000..3f08f74
--- /dev/null
+++ b/net-wireless/unifi/files/unifi.service
@@ -0,0 +1,11 @@
+[Unit]
+Description = UniFi Controller
+Requires = network.target
+After = network.target
+
+[Service]
+ExecStart = /usr/bin/java -jar /usr/lib/unifi/lib/ace.jar start
+ExecStop = /usr/bin/java -jar /usr/lib/unifi/lib/ace.jar stop
+
+[Install]
+WantedBy = network.target
diff --git a/net-wireless/unifi/unifi-5.0.7.ebuild b/net-wireless/unifi/unifi-5.0.7.ebuild
new file mode 100644
index 0000000..9fb78d5
--- /dev/null
+++ b/net-wireless/unifi/unifi-5.0.7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-fonts/freefont-ttf/freefont-ttf-20090104.ebuild,v 1.4 2009/05/28 19:43:05 beandog Exp $
+
+EAPI=6
+inherit multilib systemd
+
+MY_PN="UniFi"
+
+DESCRIPTION="Management Controller for UniFi APs"
+HOMEPAGE="https://www.ubnt.com/download/unifi"
+SRC_URI="http://dl.ubnt.com/unifi/${PV}/${MY_PN}.unix.zip -> ${P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 ia64 ppc ppc64 sparc x86"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ >=dev-db/mongodb-2.0.0
+ virtual/jre"
+IUSE=""
+
+S="${WORKDIR}/UniFi"
+
+src_install() {
+ dodir /usr/$(get_libdir)/unifi
+ dodir /var/log/unifi
+ dodir /var/lib/unifi/work
+ keepdir /var/lib/unifi/data
+ cp -R "${S}"/* "${D}"/usr/$(get_libdir)/unifi
+ dosym /var/lib/unifi/data /usr/$(get_libdir)/unifi/data
+ dosym /var/lib/unifi/work /usr/$(get_libdir)/unifi/work
+ dosym /var/log/unifi /usr/$(get_libdir)/unifi/logs
+ echo "CONFIG_PROTECT=\"/var/lib/unifi/data/system.properties\"" > 99unifi
+ doenvd 99unifi
+
+ #Init scripts
+ newconfd "${FILESDIR}/${PN}.conf" "${PN}"
+ newinitd "${FILESDIR}/${PN}.init" "${PN}"
+
+ #systemd
+ systemd_dounit "${FILESDIR}"/"${PN}".service
+}