aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2017-11-19 11:30:56 +0000
committerStuart Shelton <stuart@shelton.me>2017-11-19 12:59:08 +0000
commitfa86e1e525cc9130fff4c5e6cda21c6401660182 (patch)
treef9b1454262568befcf156b0967f41c84beff98e0 /net-misc
parentUpdate net-dns/avahi-0.7 (diff)
downloadsrcshelton-fa86e1e525cc9130fff4c5e6cda21c6401660182.tar.gz
srcshelton-fa86e1e525cc9130fff4c5e6cda21c6401660182.tar.bz2
srcshelton-fa86e1e525cc9130fff4c5e6cda21c6401660182.zip
Add net-misc/unifi-controller-bin-5.6.24_rc, update net-misc/unifi-controller-bin-5.6.20, net-misc/unifi-controller-bin-5.6.22
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/unifi-controller-bin/Manifest9
-rw-r--r--net-misc/unifi-controller-bin/files/system.properties14
-rw-r--r--net-misc/unifi-controller-bin/unifi-controller-bin-5.6.20.ebuild12
-rw-r--r--net-misc/unifi-controller-bin/unifi-controller-bin-5.6.22.ebuild12
-rw-r--r--net-misc/unifi-controller-bin/unifi-controller-bin-5.6.24_rc.ebuild245
5 files changed, 287 insertions, 5 deletions
diff --git a/net-misc/unifi-controller-bin/Manifest b/net-misc/unifi-controller-bin/Manifest
index 169a75a2..7957b7b7 100644
--- a/net-misc/unifi-controller-bin/Manifest
+++ b/net-misc/unifi-controller-bin/Manifest
@@ -1,4 +1,4 @@
-AUX system.properties 1132 SHA256 7c61e886ae63af6a8dd03a688a8a51ea7ffeba3c82bd1eebfbe37c9e32b39c91 SHA512 fb17050830706b1aa7a6362d7996827ce82bf7b40d04958b217eb51bec3e8a55688c686a2cafb54c778995df1b8409c73096955bfdda2967eef7ecc3b7af1e1a WHIRLPOOL 7ed32ae730e07a83463b0a7aad6d47dbf4a39f25b92c0bc155f07d0ff345d4ef6f9f645a93b91ff60407584af444a643eaedcf7857b34410c0a3e326ae42120d
+AUX system.properties 1517 SHA256 8f6bf1dd9f4156bc6f6735208e8a23bee50a9688b229522f3c0af61fc48c38c4 SHA512 96d523fff84496f1754d10fee510362e2574e0eddf1cf496f42adca6a4fceb10cd8f92c4f573a59e0830a849c7d8cef10a65e66e9ed395f72d193c4b4541adc0 WHIRLPOOL 6e4ae1ff505c9e7a1b27d27137998fd562bc7560dcb63720bc79a1e03a28351ea9175ac7f68ea9485ab2f93941fea6efc039e6b41c0d3d244d63f60744e09a99
AUX unifi.confd 220 SHA256 422b4cc58a8b9e2fbd5c6a0e13b8ccf22ec95cd0f357c330a612f91324425677 SHA512 c24f637bb1aff2bda4eafd3ea2984074a48d3dd29da70481fe468b65359b51dc02f851ae713ef92e7e97bb72bcde78203807da87204f91c9a1a6edf42a32c371 WHIRLPOOL f570395eb05b3b77cf5707a25b1e3890e250ff0a9b5c4005b08e926a7c7919529f37b1a322605986a79060cf9bdfb545da79ee7147bb3f8453ef0eaaaf0eca12
AUX unifi.initd 2377 SHA256 3d66fd3acf6dc4f444a733a0fa76b06e727dea7e7a85faaa3eee98d490bb28f8 SHA512 5be1db9aae2209b428e6b77ccee38be77538069fee837566bd65a7b1d69242dd835e6b6890c820390395570637b9b882729d0fd8b826cc713e1340cca05b23d1 WHIRLPOOL df8ca84abf14c5df46fd5281c63daa2794a22d60d521da883fadccbfdb78987617a8c269fc98aecaf4810f167a55b4cb742153f74119515845391b49b20c6067
DIST unifi-5.5.24_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b
@@ -11,8 +11,11 @@ DIST unifi-5.6.20_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6
DIST unifi-5.6.20_sysvinit_all.deb 49878842 SHA256 54b24f3152d2f47646ee1ec6679a290655bae18174a1ba3816f2c94bd3f31337 SHA512 f71277258d920245f19805dba6166b1c2928be343ea94ede7c9d16a2acf0c246cfebecc61f091106569ef879951abfc8846037ead25186933ba8e1492a5a47b9 WHIRLPOOL 97e65d41a5189c2221fd112dae4f0297e7750206f33f924beac79081cfb842fee46f05a231367047d8ce2142f6c1d4ebb606ae20bda6c910132005868adc188a
DIST unifi-5.6.22_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b
DIST unifi-5.6.22_sysvinit_all.deb 50151560 SHA256 1420348469095acff5e298509c3d6747dee2405a552143198572b8466283d7b9 SHA512 e261f003f885b36a030525d5dd01131fc3f4a6a4d07d04b6eaee1a8dfa34da120485b1d0285ca36683e0a66badc256d7749ccfa9d8d3e7c9420ee86f22c7b824 WHIRLPOOL 6bde891c6006010b17b9148a2918fd873df413871075605b564abde850d7858963b5b142ad198d49484b46879644b2947df12f13ec71f3025e740e9b4a2b9ca4
+DIST unifi-5.6.24-e2998a5aab_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b
+DIST unifi-5.6.24-e2998a5aab_sysvinit_all.deb 50150912 SHA256 9121be8b02da1de9b7d3e69179ef71ded69a8f4d3c114a4164a0a916662c0865 SHA512 6ffa5dcff13849a7baa2d4c188bb27559a54bfcd2894d32a5b8d8a6e0e7b7d311afaf4af617f63e6c3bb7bf3866edcc5d75997d3345497440fa7cb68435a788a WHIRLPOOL 87c3b29aa88f80c9b73794b40f3e883cdde9e7c95abdddd6d894ab38376a6d23046c5c033cf85d283268179abcb60d43b3e3da96c2d3af1c90150d3de569f76a
EBUILD unifi-controller-bin-5.5.24.ebuild 6995 SHA256 0586a17fb2abd46e819a2c7baa24de21970bc90ac846c4728f9edbaba9a20503 SHA512 9dca6b2ec2613d3055e4aed7467cd018c6bc22fe301481d83d3ae90377bc549234029f0c78c2e3295e7273bedd345f9a1934d8591c014d94ea0609bf0333bbab WHIRLPOOL 77905657f5c89259477b553d3e6e6914c20d8d5fa53b9d9b887076042e12ba996bc87890ccb82d638809ecc9aea0e709a84938a410344b2084c3924dda7f500a
EBUILD unifi-controller-bin-5.6.18_rc.ebuild 7009 SHA256 013bf4f3bcafb7b4a1669059110548f2e531b34ca24bad09ee7f5acaffeb9adb SHA512 301a52b4854fb47de53f82858964a588bb7df0437677ca87a8fda778c8a871f80ca6ecc9037c767bc2b9e461e54dc6f6a28dd7f6966d7129beee7a20df9caea4 WHIRLPOOL 0a172224edc8e29d2c1e68f0aaadb2d107f9b9cafba3513bffb053cee65ddee7bcc547f0aea7625129084310e09153af498022f259a96b2800e5cd68877fd559
EBUILD unifi-controller-bin-5.6.19_rc.ebuild 7000 SHA256 0fc064807f65cd376233959ea0ee2e7859727f7ec3b51331121bd3fda1f1a6b9 SHA512 8318592889fd946d25cca2f0d8df53249ed554908f873bbb9c48b3f91bcf9a691a89142ec0e233cdaffa6a42e837ea39e1bf5d1aeb03533d82e6fa2e2020b7b4 WHIRLPOOL 55b5000e707673cc387e9ac66c6561d1879e92d636119b25fde706e82009f937cfc0701cade95e6af079a8fb2ba7e5ba8342e3cd53eebb12c555b4a264d84fdd
-EBUILD unifi-controller-bin-5.6.20.ebuild 7320 SHA256 ba8d9b695b2e09165b2e415a5e10499cb6c61bef79beb5d27b816f549bfcb179 SHA512 3745a0c8e45d567f01182be99890076c4baee72ca1963ee3eb6a01cf3933ee9bdbe193e94943678b6fd527cfb1ebabd09ce1552f21a558c09d73a829882a06e9 WHIRLPOOL 3bc256266274d8c3f2dca659b3767296ec3f6a484105df4bc845b900702ab37e1b89c0b65a1d19e33ead8c6fed96a842fad036f9bde84ac565b4983fb59f2cd2
-EBUILD unifi-controller-bin-5.6.22.ebuild 7320 SHA256 ba8d9b695b2e09165b2e415a5e10499cb6c61bef79beb5d27b816f549bfcb179 SHA512 3745a0c8e45d567f01182be99890076c4baee72ca1963ee3eb6a01cf3933ee9bdbe193e94943678b6fd527cfb1ebabd09ce1552f21a558c09d73a829882a06e9 WHIRLPOOL 3bc256266274d8c3f2dca659b3767296ec3f6a484105df4bc845b900702ab37e1b89c0b65a1d19e33ead8c6fed96a842fad036f9bde84ac565b4983fb59f2cd2
+EBUILD unifi-controller-bin-5.6.20.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364040021d983c5dd3ceb9636d309902d606eb446 SHA512 30ad29fce7077b8ce552d844a0e8add8d8eb33f1a19b2de91843aec9c438aad1ac372e756cc99a6e85a9d93d03722565e19db008f6efdf55aad670c6bc9195df WHIRLPOOL 4b5dec02852aef06f4aa881ec2ba4030165da0a3fe54638f765eb93917a90f728c865afeae57ad8599c60b773edb8f380a114f9a8dc145f47d715ea93ffa8efb
+EBUILD unifi-controller-bin-5.6.22.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364040021d983c5dd3ceb9636d309902d606eb446 SHA512 30ad29fce7077b8ce552d844a0e8add8d8eb33f1a19b2de91843aec9c438aad1ac372e756cc99a6e85a9d93d03722565e19db008f6efdf55aad670c6bc9195df WHIRLPOOL 4b5dec02852aef06f4aa881ec2ba4030165da0a3fe54638f765eb93917a90f728c865afeae57ad8599c60b773edb8f380a114f9a8dc145f47d715ea93ffa8efb
+EBUILD unifi-controller-bin-5.6.24_rc.ebuild 7705 SHA256 b2bf28a669fa8576185e71346562cc4e55793dc6134b3d8afac86e3c8188a043 SHA512 e28afba992c6df3f9f8de34a871bbc95c0e768955cf9296214f090cf465b7c421e44c2f839c9e7d33dca55ebbf5dcd1e36531c6eaee312ec4d7d740300362361 WHIRLPOOL 13069639d95b4e92d59343f4a5f9f7424a02a462d377321cab834189f87cece1d6130cd106cb4d039b8bcffebe81d6cf57fc829cdeab57171d901a4284d1dc14
diff --git a/net-misc/unifi-controller-bin/files/system.properties b/net-misc/unifi-controller-bin/files/system.properties
index e858984e..cc7028c7 100644
--- a/net-misc/unifi-controller-bin/files/system.properties
+++ b/net-misc/unifi-controller-bin/files/system.properties
@@ -40,3 +40,17 @@
# Port used for throughput measurement.
# unifi.throughput.port=6789
#
+
+#
+# Comments below this line will be erased when this unifi instance is started!
+#
+
+# Prevent controller from trying to allocate 1GB RAM on startup
+# Unifi Cloud Key leaves xms unset but sets xmx to 768(MB)
+unifi.xms=128
+unifi.xmx=512
+# Ensure that mongodb doesn't create huge jounral files
+unifi.db.nojournal=true
+# Apply strong SSL defaults
+unifi.https.sslEnabledProtocols=TLSv1.2
+
diff --git a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.20.ebuild b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.20.ebuild
index a9de5a92..577a29c1 100644
--- a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.20.ebuild
+++ b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.20.ebuild
@@ -20,7 +20,7 @@ RESTRICT="mirror"
LICENSE="GPL-3 UBNT-20170717"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~x86"
+KEYWORDS="amd64 arm x86"
IUSE="nls rpi1 systemd +tools"
UNIFI_LINGUAS=( ca cs da de_DE el en es_ES nl pl pt_PT sv tr zh_CN )
IUSE+=" ${UNIFI_LINGUAS[@]/#/linguas_}"
@@ -219,6 +219,16 @@ pkg_postinst() {
ewarn "UniFi Guest Portal from operating correctly - please upgrade"
ewarn "or downgrade your Java installation to avoid this issue"
fi
+
+ elog
+ ewarn "From ${PN}-5.6.20, the default behaviour is to immediately"
+ ewarn "attempt to allocate 1GB of memory on startup. If running on a"
+ ewarn "memory-constrained system, please edit:"
+ ewarn
+ ewarn " /opt/${MY_P}/data/system.properties"
+ ewarn
+ ewarn "... in order to set appropriate Java XMS and XMX (minimum and"
+ ewarn "maximum memory constraints) values"
}
pkg_prerm() {
diff --git a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.22.ebuild b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.22.ebuild
index a9de5a92..577a29c1 100644
--- a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.22.ebuild
+++ b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.22.ebuild
@@ -20,7 +20,7 @@ RESTRICT="mirror"
LICENSE="GPL-3 UBNT-20170717"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~x86"
+KEYWORDS="amd64 arm x86"
IUSE="nls rpi1 systemd +tools"
UNIFI_LINGUAS=( ca cs da de_DE el en es_ES nl pl pt_PT sv tr zh_CN )
IUSE+=" ${UNIFI_LINGUAS[@]/#/linguas_}"
@@ -219,6 +219,16 @@ pkg_postinst() {
ewarn "UniFi Guest Portal from operating correctly - please upgrade"
ewarn "or downgrade your Java installation to avoid this issue"
fi
+
+ elog
+ ewarn "From ${PN}-5.6.20, the default behaviour is to immediately"
+ ewarn "attempt to allocate 1GB of memory on startup. If running on a"
+ ewarn "memory-constrained system, please edit:"
+ ewarn
+ ewarn " /opt/${MY_P}/data/system.properties"
+ ewarn
+ ewarn "... in order to set appropriate Java XMS and XMX (minimum and"
+ ewarn "maximum memory constraints) values"
}
pkg_prerm() {
diff --git a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.24_rc.ebuild b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.24_rc.ebuild
new file mode 100644
index 00000000..8cfcf779
--- /dev/null
+++ b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.24_rc.ebuild
@@ -0,0 +1,245 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+CHECKREQS_DISK_VAR="500M"
+
+inherit check-reqs unpacker user
+
+MY_P="${P/-bin}"
+MY_PN="${PN/-bin}"
+MY_PV="${PV/_rc}-e2998a5aab"
+
+DESCRIPTION="Ubiquiti UniFi Controller"
+HOMEPAGE="https://www.ubnt.com/download/unifi/"
+SRC_URI="
+ http://dl.ubnt.com/unifi/${MY_PV}/unifi_sysvinit_all.deb -> unifi-${MY_PV}_sysvinit_all.deb
+ tools? (
+ https://dl.ubnt.com/unifi/${MY_PV}/unifi_sh_api -> unifi-${MY_PV}_api.sh
+ )"
+RESTRICT="mirror"
+
+LICENSE="GPL-3 UBNT-20170717"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="nls rpi1 systemd +tools"
+UNIFI_LINGUAS=( ca cs da de_DE el en es_ES nl pl pt_PT sv tr zh_CN )
+IUSE+=" ${UNIFI_LINGUAS[@]/#/linguas_}"
+
+# debian control dependencies:
+# binutils
+# coreutils
+# jsvc
+# mongodb-server (>=2.4.10) | mongodb-10gen (>=2.4.14) | mongodb-org-server (>=2.6.0)
+# openjdk-7-jre-headless | java8-runtime-headless
+
+# The version of mongodb bundled with the Mac edition is v2.4.14 at the moment,
+# but currently the oldest ebuild (and only v2.x) is v2.6.12. The default
+# version is currently v3.0.14 - but this crashes with the UniFi code, possibly
+# documented in https://jira.mongodb.org/browse/SERVER-22334.
+# As a result, we'll only accept the oldest or newer versions as dependencies.
+DEPEND="
+ || (
+ ~dev-db/mongodb-2.6.12
+ >=dev-db/mongodb-3.2
+ )
+ >=virtual/jre-1.7.0
+"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="opt/${MY_P}/lib/native/*/*/libubnt_webrtc_jni.so"
+
+pkg_setup () {
+ # unifi controller uses mongodb as a data-store, and mongo immediately
+ # requires >3GB of space on creation of a new store, if journaling is
+ # enabled. By default, UniFi disables mongo's journal - but if you
+ # override this option then bear in mind that you'll need an additional
+ # 3GB(!) of space on your /var partition, or you'll need to relocate
+ # /var/lib/unifi to a larger drive.
+ # 500M is the bare minimum required for a single AP and a handful of
+ # clients - the likelihood is that (much?) more space will be required
+ # in time...
+ check-reqs_pkg_setup
+
+ enewgroup unifi
+ enewuser unifi -1 -1 /var/lib/unifi unifi
+}
+
+src_unpack () {
+ local file
+ for file in ${A}; do
+ if [[ "${file}" == *.jar ]]; then
+ cp -r "${DISTDIR}"/"${file}" "${S}"/
+ elif [[ "${file}" == *.deb ]]; then
+ unpack_deb "${file}" || die
+ else
+ cp "${DISTDIR}"/"${file}" "${WORKDIR}"/
+ fi
+ done
+ cd "${S}"
+
+ if [[ "${ARCH}" == "arm" ]]; then
+ rm usr/lib/unifi/lib/native/Linux/x86_64/libubnt_webrtc_jni.so
+ use rpi1 && rm usr/lib/unifi/lib/native/Linux/armhf/libubnt_webrtc_jni.so
+ elif [[ "${ARCH}" == "amd64" ]]; then
+ rm usr/lib/unifi/lib/native/Linux/armhf/libubnt_webrtc_jni.so
+ else # [[ "${ARCH}" == "x86" ]]
+ rm usr/lib/unifi/lib/native/Linux/x86_64/libubnt_webrtc_jni.so
+ rm usr/lib/unifi/lib/native/Linux/armhf/libubnt_webrtc_jni.so
+ fi
+ rmdir -p usr/lib/unifi/lib/native/Linux/x86_64 usr/lib/unifi/lib/native/Linux/armhf 2>/dev/null
+
+ rm -r usr/lib/unifi/lib/native/Windows
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ rm -r usr/lib/unifi/lib/native/Linux
+ else
+ rm -r usr/lib/unifi/lib/native/Mac
+ fi
+ rmdir usr/lib/unifi/lib/native 2>/dev/null
+
+ rm -r usr/lib/unifi/{bin,conf}
+}
+
+src_prepare () {
+ default
+
+ if use nls; then
+ local lingua=''
+ for lingua in ${UNIFI_LINGUAS[@]}; do
+ if ! use linguas_${lingua}; then
+ rm -r usr/lib/unifi/webapps/ROOT/app-unifi/locales/"${lingua}" || die
+ fi
+ done
+ fi
+
+ echo "CONFIG_PROTECT=\"${EPREFIX%/}/var/lib/unifi/data\"" > "${T}/90${MY_PN}"
+}
+
+src_install () {
+ local d
+ for d in conf data db logs run; do # Do we still need conf & db?
+ if [[ -d usr/lib/unifi/${d} ]]; then
+ rmdir usr/lib/unifi/${d} || die "Cannot remove directory 'unifi/${d}': ${?}"
+ fi
+ done
+
+ insinto /opt/"${MY_P}"
+ doins -r usr/lib/unifi/* || die "Installation failed"
+
+ keepdir /var/lib/unifi/backup
+ keepdir /var/lib/unifi/conf # ?
+ keepdir /var/lib/unifi/data
+ keepdir /var/lib/unifi/db # ?
+ keepdir /var/lib/unifi/webapp/work
+ keepdir /var/log/unifi
+
+ mkdir -p "${ED%/}"/var/run/unifi # Try to keep QA checker happy - this is created by the init script
+
+ dosym /var/lib/unifi/backup /opt/"${MY_P}"/backup
+ dosym /var/lib/unifi/conf /opt/"${MY_P}"/conf
+ dosym /var/lib/unifi/data /opt/"${MY_P}"/data
+ dosym /var/lib/unifi/db /opt/"${MY_P}"/db
+ dosym /var/lib/unifi/webapp/work /opt/"${MY_P}"/work
+ dosym /var/log/unifi /opt/"${MY_P}"/logs
+ dosym /var/run/unifi /opt/"${MY_P}"/run
+
+ # <sigh>
+ dodir /opt/"${MY_P}"/bin
+ dosym /usr/bin/mongod /opt/"${MY_P}"/bin/mongod
+
+ if use tools; then
+ insinto /opt/"${MY_P}"/bin
+ newins "${WORKDIR}"/unifi-${MY_PV}_api.sh unifi-api.sh
+ fperms 755 /opt/"${MY_P}"/bin/unifi-api.sh
+ fi
+
+ insinto /var/lib/unifi/data
+ doins "${FILESDIR}"/system.properties
+
+ fowners -R unifi:unifi \
+ /var/lib/unifi \
+ /var/log/unifi
+
+ newinitd "${FILESDIR}"/unifi.initd unifi ||
+ die "Could not create init script"
+ newconfd "${FILESDIR}"/unifi.confd unifi ||
+ die "Could not create conf file"
+ sed -i -e "s|%INST_DIR%|/opt/${MY_P}|g" \
+ "${ED%/}"/etc/{init,conf}.d/unifi \
+ || die "Could not customise init scripts"
+
+ doenvd "${T}/90${MY_PN}" || die "Could not configure environment"
+
+ if use systemd; then
+ sed -i -e "s|/usr/lib/unifi|${ED%/}/opt/${MY_P}|" \
+ lib/systemd/system/unifi.service \
+ || die "Could not customise systemd unit file"
+ systemd_dounit lib/systemd/system/unifi.service
+ fi
+
+ rmdir -p "${ED%/}"/var/run/unifi 2>/dev/null # Try to keep QA checker happy - this is created by the init script
+}
+
+pkg_postinst() {
+ elog "By default, ${MY_P} uses the following ports:"
+ elog
+ elog " Web Interface: 8080"
+ elog " API: 8443"
+ elog " Portal HTTP redirect: 8880"
+ elog " Portal HTTPS redirect: 8843"
+ elog " STUN: 3478"
+ elog
+ elog "... and will attempt to connect to mongodb on localhost:27117"
+ elog
+ elog "Additionally, ports 8881 and 8882 are reserved, and 6789 is used"
+ elog "for determining throughput."
+ elog
+ elog "All of these ports may be customised by editing"
+ elog
+ elog " /opt/${MY_P}/data/system.properties"
+ elog
+ elog "... but please note that the file will be re-written on each"
+ elog "startup/shutdown, and any changes to the comments will be lost."
+ elog
+ elog "These settings cannot be passed as '-D' parameters to Java,"
+ elog "${MY_P} only uses values from the properties file."
+ elog
+ elog "If the Web Interface/Inform port is changed from the default of"
+ elog "8080, then all managed devices must be updated via debug console"
+ elog "with the command:"
+ elog
+ elog " set-inform http://<controller IP>:<new port>/inform"
+ elog
+ elog "... before they will be able to reconnect."
+
+ if has_version '>=dev-java/oracle-jdk-bin-1.8.0.151' && has_version '<dev-java/oracle-jdk-bin-1.8.0.162'; then
+ elog
+ ewarn "Oracle Java SDK releases 1.8.0r151 to 1.8.0r161 prevent the"
+ ewarn "UniFi Guest Portal from operating correctly - please upgrade"
+ ewarn "or downgrade your Java installation to avoid this issue"
+ fi
+
+ elog
+ ewarn "From ${PN}-5.6.20, the default behaviour is to immediately"
+ ewarn "attempt to allocate 1GB of memory on startup. If running on a"
+ ewarn "memory-constrained system, please edit:"
+ ewarn
+ ewarn " /opt/${MY_P}/data/system.properties"
+ ewarn
+ ewarn "... in order to set appropriate Java XMS and XMX (minimum and"
+ ewarn "maximum memory constraints) values"
+}
+
+pkg_prerm() {
+ local link
+
+ # Clean-up any remaining symlinks, which would otherwise be protected and
+ # not removed...
+ if [[ -z "${REPLACED_BY_VERSION:-}" || "${REPLACED_BY_VERSION}" != "${PVR}" ]]; then
+ for link in data logs run work; do
+ [[ -L "${EPREFIX%/}"/opt/"${MY_P}"/${link} ]] &&
+ rm "${EPREFIX%/}"/opt/"${MY_P}"/${link}
+ done
+ fi
+}