diff options
author | Stuart Shelton <stuart@shelton.me> | 2018-02-08 08:32:37 +0000 |
---|---|---|
committer | Stuart Shelton <stuart@shelton.me> | 2018-02-08 08:32:37 +0000 |
commit | b29e46c7d9f872b472cdc1bb05f06f185b381480 (patch) | |
tree | 9e570d1da7c3f79f4df1f68136459d9f4c158e36 /net-misc | |
parent | Add net-dns/libidn-1.33-r2 (diff) | |
download | srcshelton-b29e46c7d9f872b472cdc1bb05f06f185b381480.tar.gz srcshelton-b29e46c7d9f872b472cdc1bb05f06f185b381480.tar.bz2 srcshelton-b29e46c7d9f872b472cdc1bb05f06f185b381480.zip |
Add net-misc/unifi-controller-bin-5.6.30, net-misc/unifi-controller-bin-5.6.31_rc, net-misc/unifi-controller-bin-5.7.15_rc
Diffstat (limited to 'net-misc')
4 files changed, 753 insertions, 0 deletions
diff --git a/net-misc/unifi-controller-bin/Manifest b/net-misc/unifi-controller-bin/Manifest index a316d199..093c176c 100644 --- a/net-misc/unifi-controller-bin/Manifest +++ b/net-misc/unifi-controller-bin/Manifest @@ -19,6 +19,13 @@ DIST unifi-5.6.26_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6 DIST unifi-5.6.26_sysvinit_all.deb 50195710 SHA256 6ade32913eddbc555c8c1120babe9baf765547aa5944f8554f59f77a0385865b SHA512 628ef6ccf2b0908254f50d5564dd8a8968f34154a1c3cf0730b7602899403e1c7c990af94a4b4c1605eba2b56e6415f5fcd543c7f6bb4311ac52d7a263e75c7e WHIRLPOOL a8774c34d29b2eae70ce1283f614c7cd90f153d59fa45f850ca01c08942dff09b4225764bc14fa87de7c617d9abe8122fa55240a2fce5e14cc5257c381187ab6 DIST unifi-5.6.29_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b DIST unifi-5.6.29_sysvinit_all.deb 50199980 SHA256 e8d7966fa005d3388c78521ff328701c8d483a663e346e7749be85962b49ca16 SHA512 f95d132c1a6b696a200059a3bfa8f94855e1f0ebdd737ef2bb0d00be96103937fb800170cfcd96e1b98ab04387031aad25347bbf03d0345a30e0aae8b9dad312 WHIRLPOOL e7bb51339f0f9519545c0591d7e7739b5380b3694f2fd371eb127f270aea82558e9ce1e15afee38879010e9548957e6a5f40ff359c1b1a40437d99ff52cfb070 +DIST unifi-5.6.30_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b +DIST unifi-5.6.30_sysvinit_all.deb 50209900 SHA256 44facefdca0e3270ccbacdf661a9dd2a2e3fe126a840c3a402f6b61393806b20 SHA512 a0446789d0f37e45cdc941df7b15c91f2731ad3d02db24e8bb415becccb3d79b870425371788d1eb481c7187fc1d3dd981c55f0c62791dcc20b6896f0dbc37cf WHIRLPOOL 9e9895d23fdbfdbd3e9339f79cf74b9a6df6ad523dea0e7e3f1f5c661ca19c70d2c33dd73c1509a3825f706b1737213e8f50269855a3beaadb4ccb897e208d05 +DIST unifi-5.6.31-e6237920d0_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b +DIST unifi-5.6.31-e6237920d0_sysvinit_all.deb 50228998 SHA256 ea31a214e19a48be58130ec1f1d03c0f4578c68c17f957e097624d5dd6752b4e SHA512 0c0500a0ba59eb80dd483565bcbb5271ab1464ec71beb771da8ee7ef81f504ac7244fbdadca7204b41537fd5982320a51503c8954055c255a88d5af20dee2240 WHIRLPOOL ac9bcbf37b7ecaa40cdaf3c67ae15da7ac14241692efc94679e8298fe1bfc0f8318d580fe051106b62056b8b192fbac3fa7a7f2a45f70725c9e822a8ed6b63c3 +DIST unifi-5.7.15-e9b882be05_api.sh 5167 SHA256 5baf98dc45b7dac7f5444f7f4e36e26602908755fb6d668b6e47c07135ed2deb SHA512 e8b250e6c363fcda8f5550fb7d3f6d352fa0af458a0d0907177835f6236c37374336e877687644abb1f018fae4a33efa411b286bf1a39488966253b3b4a06600 WHIRLPOOL 1bc922fcc82b3c156e697db55413484df0236eb16992fce5c96448631e57a84cfa230a82395b827221f33cce1780ffb9a1a5ba1f2fc5ad8c901eb8477aa4f21b +DIST unifi-5.7.15-e9b882be05_changelog.txt 247962 SHA256 20632c1a8e9ce69974eb7887497ef09ac9b3c0c70b7f30e56997f1c10576c0ff SHA512 ed9d2232f6a7dfa5f856426c1e1339b69d6fb327827cbc77d00892199333c746246b1267a3a3702434034a079e17cca925476eecd7e034f37bf85aaf305602f8 WHIRLPOOL 999819513767e9756efbf04c2959e04cd2d09be0cb322af63f019be01d64c6290b5ab803fdd8b64ac7562e51fcbf74dd7c07e94a119db9497d9cfac83495f490 +DIST unifi-5.7.15-e9b882be05_sysvinit_all.deb 63651966 SHA256 93684bcc311bd56ab74765e7b78bba9689f760d3457f044d3284c32a0f6fa820 SHA512 318902086cfbbb80a5485d529743f76f0a6a32c53bfac264ffc50217ea9e154e294725c24d0dc4d621dd9b9f365fe8951aeb35fd265b39b2966cf2c0a628a8ed WHIRLPOOL 9092753774b5eaec3b9489a98bda3a9e2554ffb514b0b2c7a749a35dbee98138a8112951813a0bfb16948d950e97d57d469839386fb878aa61302fc77d1bf840 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.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364040021d983c5dd3ceb9636d309902d606eb446 SHA512 30ad29fce7077b8ce552d844a0e8add8d8eb33f1a19b2de91843aec9c438aad1ac372e756cc99a6e85a9d93d03722565e19db008f6efdf55aad670c6bc9195df WHIRLPOOL 4b5dec02852aef06f4aa881ec2ba4030165da0a3fe54638f765eb93917a90f728c865afeae57ad8599c60b773edb8f380a114f9a8dc145f47d715ea93ffa8efb @@ -28,3 +35,6 @@ EBUILD unifi-controller-bin-5.6.22.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364 EBUILD unifi-controller-bin-5.6.24_rc.ebuild 7705 SHA256 b2bf28a669fa8576185e71346562cc4e55793dc6134b3d8afac86e3c8188a043 SHA512 e28afba992c6df3f9f8de34a871bbc95c0e768955cf9296214f090cf465b7c421e44c2f839c9e7d33dca55ebbf5dcd1e36531c6eaee312ec4d7d740300362361 WHIRLPOOL 13069639d95b4e92d59343f4a5f9f7424a02a462d377321cab834189f87cece1d6130cd106cb4d039b8bcffebe81d6cf57fc829cdeab57171d901a4284d1dc14 EBUILD unifi-controller-bin-5.6.26.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364040021d983c5dd3ceb9636d309902d606eb446 SHA512 30ad29fce7077b8ce552d844a0e8add8d8eb33f1a19b2de91843aec9c438aad1ac372e756cc99a6e85a9d93d03722565e19db008f6efdf55aad670c6bc9195df WHIRLPOOL 4b5dec02852aef06f4aa881ec2ba4030165da0a3fe54638f765eb93917a90f728c865afeae57ad8599c60b773edb8f380a114f9a8dc145f47d715ea93ffa8efb EBUILD unifi-controller-bin-5.6.29.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364040021d983c5dd3ceb9636d309902d606eb446 SHA512 30ad29fce7077b8ce552d844a0e8add8d8eb33f1a19b2de91843aec9c438aad1ac372e756cc99a6e85a9d93d03722565e19db008f6efdf55aad670c6bc9195df WHIRLPOOL 4b5dec02852aef06f4aa881ec2ba4030165da0a3fe54638f765eb93917a90f728c865afeae57ad8599c60b773edb8f380a114f9a8dc145f47d715ea93ffa8efb +EBUILD unifi-controller-bin-5.6.30.ebuild 7691 SHA256 17d58dcc78b28ebe4740942364040021d983c5dd3ceb9636d309902d606eb446 SHA512 30ad29fce7077b8ce552d844a0e8add8d8eb33f1a19b2de91843aec9c438aad1ac372e756cc99a6e85a9d93d03722565e19db008f6efdf55aad670c6bc9195df WHIRLPOOL 4b5dec02852aef06f4aa881ec2ba4030165da0a3fe54638f765eb93917a90f728c865afeae57ad8599c60b773edb8f380a114f9a8dc145f47d715ea93ffa8efb +EBUILD unifi-controller-bin-5.6.31_rc.ebuild 7705 SHA256 5fd69be2de07a5a29e76ba42a78a4f5cc6bf37c8a675c4ee3a1657d550622095 SHA512 0143dee4c632631f215ff99b4a8e6a04072b9354a08635b1750a9e9c898685b40d703134bef01851021df5e8c153d9809e8267b73b2c9672f0bfbef4f4fe0785 WHIRLPOOL ddd24763a9fec57de788fb2193195efb765764877aa754d61eb86ad27a1fea67a3dd7f968b9e1db55f554c435e0c5e3fdee00f05ba07eaa3bc5062ae4baf023e +EBUILD unifi-controller-bin-5.7.15_rc.ebuild 8121 SHA256 809f3e43839b25858f182b1833f871c2ed61983fbdcff271f940aaa3c084b5d7 SHA512 a782362d4f0d91724e321953057cf93916acf4b0c5aca84ccce6da111c72bb7ddf843d6b854942e06b481feb1ae71f0c58fa66ca5b11efe98da76f01f1e68985 WHIRLPOOL f561580d53778359e28a2258a651f162fdbc1d0c5875060fba4245ecf178e69b3a67f8eec98313f78b77a8247544b72400392b25eb3ffaf62b91cfccc90a7cb9 diff --git a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.30.ebuild b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.30.ebuild new file mode 100644 index 00000000..577a29c1 --- /dev/null +++ b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.30.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}" + +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 +} diff --git a/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.31_rc.ebuild b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.31_rc.ebuild new file mode 100644 index 00000000..601611d7 --- /dev/null +++ b/net-misc/unifi-controller-bin/unifi-controller-bin-5.6.31_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}-e6237920d0" + +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 +} diff --git a/net-misc/unifi-controller-bin/unifi-controller-bin-5.7.15_rc.ebuild b/net-misc/unifi-controller-bin/unifi-controller-bin-5.7.15_rc.ebuild new file mode 100644 index 00000000..21ae6af8 --- /dev/null +++ b/net-misc/unifi-controller-bin/unifi-controller-bin-5.7.15_rc.ebuild @@ -0,0 +1,253 @@ +# 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}-e9b882be05" +MY_DOCS="ubnt/Blog_UniFi_Beta/283/2" + +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 + https://community.ubnt.com/ubnt/attachments/${MY_DOCS}/UniFi-changelog-5.7.x.txt -> unifi-${MY_PV}_changelog.txt + 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.8.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 + + newdoc "unifi-${MY_PV}_changelog.txt" changelog.txt + + 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" + elog + ewarn "UniFi Controller 5.7+ will not support UAP-AC and UAP-AC-Outdoor" + ewarn "models:" + ewarn " https://community.ubnt.com/t5/UniFi-Updates-Blog/UAP-AC-UAP-AC-Outdoor-LTS-Announcement/ba-p/2059058" +} + +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 +} |