mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
net-wireless/unifi: eBuilds reworked
Closes: https://bugs.gentoo.org/634518 Package-Manager: Portage-2.3.40, Repoman-2.3.9
This commit is contained in:
committed by
Ben Kohler
parent
303ce6ea47
commit
611a7f7c61
@@ -1,3 +1,6 @@
|
||||
#!/bin/bash
|
||||
cleaned_args=$(echo $* | sed -e 's/--nohttpinterface//')
|
||||
/usr/bin/mongod ${cleaned_args}
|
||||
#!/bin/sh
|
||||
|
||||
# Remove --nohttpinterface argument, since it does not exist on MongoDB >= 3.6.x anymore
|
||||
# See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
|
||||
remove_nohttpinterface_arg=$(echo $* | sed -e 's/--nohttpinterface//')
|
||||
/usr/bin/mongod ${remove_nohttpinterface_arg}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# /etc/conf.d/unifi.conf
|
||||
|
||||
#JAVA_HOME="/usr"
|
||||
# Specifies the path of an used Java runtime,
|
||||
# if it's not set, the system default is being used.
|
||||
# JAVA_HOME=""
|
||||
|
||||
@@ -2,22 +2,25 @@
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
PID_FILE="/run/unifi.pid"
|
||||
DAEMON="${JAVA_HOME-/usr}"/bin/java
|
||||
ACE_LIB="lib/ace.jar"
|
||||
DAEMON="${JAVA_HOME-/etc/java-config-2/current-system-vm}"/bin/java
|
||||
JAVA_OPTS="-Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp"
|
||||
UNIFI_GROUP="unifi"
|
||||
UNIFI_PATH="/usr/lib/unifi"
|
||||
UNIFI_USER="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
|
||||
ebegin "Starting UniFi Controller"
|
||||
cd "${UNIFI_PATH}" && start-stop-daemon --start --quiet --background --user ${UNIFI_USER} --group ${UNIFI_GROUP} --chdir ${UNIFI_PATH} --exec ${DAEMON} -- ${JAVA_OPTS} -jar ${ACE_LIB} start
|
||||
eend $?
|
||||
#--user nobody --group nobody \
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping unifi"
|
||||
start-stop-daemon --quiet --stop -R 20 --pidfile "${PID_FILE}"
|
||||
ebegin "Stopping UniFi Controller"
|
||||
start-stop-daemon --start --quiet --background --user ${UNIFI_USER} --group ${UNIFI_GROUP} --chdir ${UNIFI_PATH} --exec ${DAEMON} -- ${JAVA_OPTS} -jar ${ACE_LIB} stop
|
||||
eend $?
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[Unit]
|
||||
Description=UniFi Controller
|
||||
Requires=network.target
|
||||
After=network.target
|
||||
After=network-online.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
|
||||
Type=simple
|
||||
User=unifi
|
||||
Group=unifi
|
||||
WorkingDirectory=/usr/lib/unifi
|
||||
ExecStart=/usr/bin/java -Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp -jar /usr/lib/unifi/lib/ace.jar start
|
||||
ExecStop=/usr/bin/java -Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp -jar /usr/lib/unifi/lib/ace.jar stop
|
||||
|
||||
[Install]
|
||||
WantedBy=network.target
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[Service]
|
||||
RuntimeDirectory=unifi
|
||||
User=unifi
|
||||
Group=unifi
|
||||
@@ -5,5 +5,18 @@
|
||||
<email>bkohler@gentoo.org</email>
|
||||
<name>Ben Kohler</name>
|
||||
</maintainer>
|
||||
<maintainer type="person">
|
||||
<email>ck+gentoo@bl4ckb0x.de</email>
|
||||
<name>Conrad Kostecki</name>
|
||||
</maintainer>
|
||||
<maintainer type="project">
|
||||
<email>proxy-maint@gentoo.org</email>
|
||||
<name>Proxy Maintainers</name>
|
||||
</maintainer>
|
||||
<longdescription>
|
||||
UniFi is a management controller software for Ubiquiti UniFi APs.
|
||||
It's purpose is to configure and monitor all those APs.
|
||||
Also all kind of statistics are collected, which can be accessed through UniFi.
|
||||
There is also an internal RADIUS server, which can be used for WPA2-Enterprise.
|
||||
</longdescription>
|
||||
</pkgmetadata>
|
||||
|
||||
|
||||
@@ -3,56 +3,69 @@
|
||||
|
||||
EAPI=6
|
||||
|
||||
inherit systemd user
|
||||
|
||||
# for stable candidates set RC_SUFFIX="-xxxxxxxxxx"
|
||||
# Used, when it's an unstable, beta or release candidate
|
||||
RC_SUFFIX=""
|
||||
|
||||
DESCRIPTION="Management Controller for UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com/download/unifi"
|
||||
SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
inherit systemd user
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE=""
|
||||
RESTRICT="mirror"
|
||||
DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com"
|
||||
SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
LICENSE="Apache-1.0 Apache-2.0 BSD-1 BSD-2 BSD CDDL EPL-1.0 GPL-2 LGPL-2.1 LGPL-3 MIT ubiquiti"
|
||||
SLOT="0/5.6"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-db/mongodb
|
||||
virtual/jre"
|
||||
dev-java/tomcat-native
|
||||
virtual/jre:1.8"
|
||||
|
||||
S=${WORKDIR}/UniFi
|
||||
QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
|
||||
DEPEND="app-arch/unzip"
|
||||
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
S="${WORKDIR}/UniFi"
|
||||
|
||||
DOCS=( "readme.txt" )
|
||||
|
||||
QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
|
||||
|
||||
pkg_setup() {
|
||||
enewuser ${PN}
|
||||
enewgroup ${PN}
|
||||
enewgroup unifi
|
||||
enewuser unifi -1 -1 /var/lib/unifi unifi
|
||||
}
|
||||
|
||||
src_install(){
|
||||
static_dir="/usr/$(get_libdir)/${PN}"
|
||||
#install static data
|
||||
insinto ${static_dir}
|
||||
doins -r *
|
||||
#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
|
||||
src_prepare() {
|
||||
# Remove unneeded files Linux, Mac and Windows
|
||||
rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
|
||||
|
||||
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}
|
||||
|
||||
newinitd "${FILESDIR}"/${PN}.initd ${PN}
|
||||
newconfd "${FILESDIR}"/${PN}.confd ${PN}
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Install MongoDB wrapper script, to avoid problems with >= 3.6.0
|
||||
# See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
|
||||
exeinto /usr/lib/unifi/bin
|
||||
newexe "${FILESDIR}"/mongod-wrapper mongod
|
||||
|
||||
insinto /usr/lib/unifi
|
||||
doins -r dl lib webapps
|
||||
|
||||
diropts -o unifi -g unifi
|
||||
keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
|
||||
|
||||
for symlink in conf data run tmp work; do
|
||||
dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
|
||||
done
|
||||
dosym ../../../var/log/unifi /usr/lib/unifi/logs
|
||||
|
||||
newinitd "${FILESDIR}"/unifi.initd unifi
|
||||
systemd_dounit "${FILESDIR}"/unifi.service
|
||||
|
||||
newconfd "${FILESDIR}"/unifi.confd unifi
|
||||
|
||||
echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
|
||||
doenvd "${T}"/99unifi
|
||||
|
||||
einstalldocs
|
||||
}
|
||||
|
||||
@@ -3,56 +3,69 @@
|
||||
|
||||
EAPI=6
|
||||
|
||||
# Used, when it's an unstable, beta or release candidate
|
||||
RC_SUFFIX="5c442c6b54"
|
||||
|
||||
inherit systemd user
|
||||
|
||||
# for not-stable releases set RC_SUFFIX="-xxxxxxxxxx"
|
||||
RC_SUFFIX="-5c442c6b54"
|
||||
DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com"
|
||||
SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
|
||||
DESCRIPTION="Management Controller for UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com/download/unifi"
|
||||
SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
LICENSE="Apache-1.0 Apache-2.0 BSD-1 BSD-2 BSD CDDL EPL-1.0 GPL-2 LGPL-2.1 LGPL-3 MIT ubiquiti"
|
||||
SLOT="0/5.7"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE=""
|
||||
RESTRICT="mirror"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-db/mongodb
|
||||
virtual/jre"
|
||||
dev-java/tomcat-native
|
||||
virtual/jre:1.8"
|
||||
|
||||
S=${WORKDIR}/UniFi
|
||||
QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
|
||||
DEPEND="app-arch/unzip"
|
||||
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
S="${WORKDIR}/UniFi"
|
||||
|
||||
DOCS=( "readme.txt" )
|
||||
|
||||
QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
|
||||
|
||||
pkg_setup() {
|
||||
enewuser ${PN}
|
||||
enewgroup ${PN}
|
||||
enewgroup unifi
|
||||
enewuser unifi -1 -1 /var/lib/unifi unifi
|
||||
}
|
||||
|
||||
src_install(){
|
||||
static_dir="/usr/$(get_libdir)/${PN}"
|
||||
#install static data
|
||||
insinto ${static_dir}
|
||||
doins -r *
|
||||
#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
|
||||
src_prepare() {
|
||||
# Remove unneeded files Linux, Mac and Windows
|
||||
rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
|
||||
|
||||
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}
|
||||
|
||||
newinitd "${FILESDIR}"/${PN}.initd ${PN}
|
||||
newconfd "${FILESDIR}"/${PN}.confd ${PN}
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Install MongoDB wrapper script, to avoid problems with >= 3.6.0
|
||||
# See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
|
||||
exeinto /usr/lib/unifi/bin
|
||||
newexe "${FILESDIR}"/mongod-wrapper mongod
|
||||
|
||||
insinto /usr/lib/unifi
|
||||
doins -r dl lib webapps
|
||||
|
||||
diropts -o unifi -g unifi
|
||||
keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
|
||||
|
||||
for symlink in conf data run tmp work; do
|
||||
dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
|
||||
done
|
||||
dosym ../../../var/log/unifi /usr/lib/unifi/logs
|
||||
|
||||
newinitd "${FILESDIR}"/unifi.initd unifi
|
||||
systemd_dounit "${FILESDIR}"/unifi.service
|
||||
|
||||
newconfd "${FILESDIR}"/unifi.confd unifi
|
||||
|
||||
echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
|
||||
doenvd "${T}"/99unifi
|
||||
|
||||
einstalldocs
|
||||
}
|
||||
|
||||
@@ -3,61 +3,69 @@
|
||||
|
||||
EAPI=6
|
||||
|
||||
# Used, when it's an unstable, beta or release candidate
|
||||
RC_SUFFIX="d5a5bbfda4"
|
||||
|
||||
inherit systemd user
|
||||
|
||||
# for not-stable releases set RC_SUFFIX="-xxxxxxxxxx"
|
||||
RC_SUFFIX=""
|
||||
DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com"
|
||||
SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
|
||||
DESCRIPTION="Management Controller for UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com/download/unifi"
|
||||
SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
LICENSE="Apache-1.0 Apache-2.0 BSD-1 BSD-2 BSD CDDL EPL-1.0 GPL-2 LGPL-2.1 LGPL-3 MIT ubiquiti"
|
||||
SLOT="0/5.8"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE=""
|
||||
RESTRICT="mirror"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-db/mongodb
|
||||
virtual/jre"
|
||||
dev-java/tomcat-native
|
||||
virtual/jre:1.8"
|
||||
|
||||
S=${WORKDIR}/UniFi
|
||||
QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
|
||||
DEPEND="app-arch/unzip"
|
||||
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
S="${WORKDIR}/UniFi"
|
||||
|
||||
DOCS=( "readme.txt" )
|
||||
|
||||
QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
|
||||
|
||||
pkg_setup() {
|
||||
enewuser ${PN}
|
||||
enewgroup ${PN}
|
||||
enewgroup unifi
|
||||
enewuser unifi -1 -1 /var/lib/unifi unifi
|
||||
}
|
||||
|
||||
src_install(){
|
||||
static_dir="/usr/$(get_libdir)/${PN}"
|
||||
#install static data
|
||||
insinto ${static_dir}
|
||||
doins -r *
|
||||
src_prepare() {
|
||||
# Remove unneeded files Linux, Mac and Windows
|
||||
rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
|
||||
|
||||
#wrapper to work around mongodb-3.6 compat issue
|
||||
exeinto ${static_dir}/bin/
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Install MongoDB wrapper script, to avoid problems with >= 3.6.0
|
||||
# See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
|
||||
exeinto /usr/lib/unifi/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
|
||||
insinto /usr/lib/unifi
|
||||
doins -r dl lib webapps
|
||||
|
||||
dodir /var/lib/${PN}/work
|
||||
fowners ${PN}:${PN} /var/lib/${PN}/work
|
||||
dosym ../../../var/lib/${PN}/work ${static_dir}/work
|
||||
diropts -o unifi -g unifi
|
||||
keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
|
||||
|
||||
keepdir /var/lib/${PN}/data
|
||||
fowners ${PN}:${PN} /var/lib/${PN}/data
|
||||
dosym ../../../var/lib/${PN}/data ${static_dir}/data
|
||||
for symlink in conf data run tmp work; do
|
||||
dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
|
||||
done
|
||||
dosym ../../../var/log/unifi /usr/lib/unifi/logs
|
||||
|
||||
echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
|
||||
doenvd "${T}"/99${PN}
|
||||
newinitd "${FILESDIR}"/unifi.initd unifi
|
||||
systemd_dounit "${FILESDIR}"/unifi.service
|
||||
|
||||
newinitd "${FILESDIR}"/${PN}.initd ${PN}
|
||||
newconfd "${FILESDIR}"/${PN}.confd ${PN}
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
newconfd "${FILESDIR}"/unifi.confd unifi
|
||||
|
||||
echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
|
||||
doenvd "${T}"/99unifi
|
||||
|
||||
einstalldocs
|
||||
}
|
||||
|
||||
@@ -3,61 +3,68 @@
|
||||
|
||||
EAPI=6
|
||||
|
||||
# Used, when it's an unstable, beta or release candidate
|
||||
RC_SUFFIX="b647df56b7"
|
||||
|
||||
inherit systemd user
|
||||
|
||||
# for not-stable releases set RC_SUFFIX="-xxxxxxxxxx"
|
||||
RC_SUFFIX="-b647df56b7"
|
||||
DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com"
|
||||
SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
|
||||
DESCRIPTION="Management Controller for UniFi APs"
|
||||
HOMEPAGE="https://www.ubnt.com/download/unifi"
|
||||
SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
|
||||
LICENSE="Apache-1.0 Apache-2.0 BSD-1 BSD-2 BSD CDDL EPL-1.0 GPL-2 LGPL-2.1 LGPL-3 MIT ubiquiti"
|
||||
SLOT="0/5.9"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
#KEYWORDS="~amd64"
|
||||
IUSE=""
|
||||
RESTRICT="mirror"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-db/mongodb
|
||||
virtual/jre"
|
||||
dev-java/tomcat-native
|
||||
virtual/jre:1.8"
|
||||
|
||||
S=${WORKDIR}/UniFi
|
||||
QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
|
||||
DEPEND="app-arch/unzip"
|
||||
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
S="${WORKDIR}/UniFi"
|
||||
|
||||
DOCS=( "readme.txt" )
|
||||
|
||||
QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
|
||||
|
||||
pkg_setup() {
|
||||
enewuser ${PN}
|
||||
enewgroup ${PN}
|
||||
enewgroup unifi
|
||||
enewuser unifi -1 -1 /var/lib/unifi unifi
|
||||
}
|
||||
|
||||
src_install(){
|
||||
static_dir="/usr/$(get_libdir)/${PN}"
|
||||
#install static data
|
||||
insinto ${static_dir}
|
||||
doins -r *
|
||||
src_prepare() {
|
||||
# Remove unneeded files Linux, Mac and Windows
|
||||
rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
|
||||
|
||||
#wrapper to work around mongodb-3.6 compat issue
|
||||
exeinto ${static_dir}/bin/
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Install MongoDB wrapper script, to avoid problems with >= 3.6.0
|
||||
# See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
|
||||
exeinto /usr/lib/unifi/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
|
||||
insinto /usr/lib/unifi
|
||||
doins -r dl lib webapps
|
||||
|
||||
dodir /var/lib/${PN}/work
|
||||
fowners ${PN}:${PN} /var/lib/${PN}/work
|
||||
dosym ../../../var/lib/${PN}/work ${static_dir}/work
|
||||
diropts -o unifi -g unifi
|
||||
keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
|
||||
|
||||
keepdir /var/lib/${PN}/data
|
||||
fowners ${PN}:${PN} /var/lib/${PN}/data
|
||||
dosym ../../../var/lib/${PN}/data ${static_dir}/data
|
||||
for symlink in conf data run tmp work; do
|
||||
dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
|
||||
done
|
||||
dosym ../../../var/log/unifi /usr/lib/unifi/logs
|
||||
|
||||
echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
|
||||
doenvd "${T}"/99${PN}
|
||||
newinitd "${FILESDIR}"/unifi.initd unifi
|
||||
systemd_dounit "${FILESDIR}"/unifi.service
|
||||
|
||||
newinitd "${FILESDIR}"/${PN}.initd ${PN}
|
||||
newconfd "${FILESDIR}"/${PN}.confd ${PN}
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
newconfd "${FILESDIR}"/unifi.confd unifi
|
||||
|
||||
echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
|
||||
doenvd "${T}"/99unifi
|
||||
|
||||
einstalldocs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user