60 lines
1.4 KiB
Bash
60 lines
1.4 KiB
Bash
# Copyright 1999-2020 Unitas Network GmbH
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI="7"
|
|
|
|
inherit eutils systemd unpacker user
|
|
|
|
DESCRIPTION="Ubiquiti UniFi server"
|
|
HOMEPAGE="http://www.ubnt.com/unifi"
|
|
|
|
SRC_URI="https://dl.ui.com/unifi/${PV}/unifi_sysvinit_all.deb -> ${P}.deb"
|
|
|
|
RESTRICT="mirror strip"
|
|
|
|
LICENSE="Ubiquiti-EULA"
|
|
SLOT="0"
|
|
KEYWORDS="amd64"
|
|
IUSE=""
|
|
|
|
DEPEND="<dev-db/mongodb-4"
|
|
RDEPEND="${DEPEND}
|
|
virtual/jre"
|
|
|
|
S=${WORKDIR}
|
|
|
|
QA_PREBUILT="*"
|
|
|
|
pkg_setup() {
|
|
enewgroup unifi
|
|
enewuser unifi -1 -1 /var/lib/unifi unifi
|
|
}
|
|
|
|
src_install() {
|
|
exeinto /usr/lib/unifi/bin
|
|
doexe ${FILESDIR}/mongod
|
|
|
|
insinto /usr/lib/unifi
|
|
doins -r usr/lib/unifi/webapps
|
|
insinto /usr/lib/unifi/lib
|
|
doins usr/lib/unifi/lib/*
|
|
insinto /usr/lib/unifi/lib/native/Linux/x86_64
|
|
doins usr/lib/unifi/lib/native/Linux/x86_64/*
|
|
insinto /usr/lib/unifi/dl/firmware
|
|
doins usr/lib/unifi/dl/firmware/*
|
|
keepdir /usr/lib/unifi/conf
|
|
|
|
insinto /etc/pam.d
|
|
doins etc/pam.d/*
|
|
|
|
keepdir /var/lib/unifi/{data,run,work}
|
|
keepdir /var/log/unifi
|
|
fowners unifi:unifi /usr/lib/unifi/data /var/lib/unifi/{data,run,work} /var/log/unifi
|
|
ln -s ../../../var/log/unifi ${D}/usr/lib/unifi/logs
|
|
ln -s ../../../var/lib/unifi/data ${D}/usr/lib/unifi/data
|
|
ln -s ../../../var/lib/unifi/run ${D}/usr/lib/unifi/run
|
|
ln -s ../../../var/lib/unifi/work ${D}/usr/lib/unifi/work
|
|
|
|
systemd_dounit ${FILESDIR}/unifi.service
|
|
}
|