Gentoo Archives: gentoo-commits

From: Ben Kohler <bkohler@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/unifi/files/, net-wireless/unifi/
Date: Tue, 26 Jun 2018 19:02:39
Message-Id: 1530039652.611a7f7c61652de2ca70421ef08685faf0e6971b.bkohler@gentoo
1 commit: 611a7f7c61652de2ca70421ef08685faf0e6971b
2 Author: Conrad Kostecki <conrad <AT> kostecki <DOT> com>
3 AuthorDate: Tue Jun 26 17:40:28 2018 +0000
4 Commit: Ben Kohler <bkohler <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 26 19:00:52 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=611a7f7c
7
8 net-wireless/unifi: eBuilds reworked
9
10 Closes: https://bugs.gentoo.org/634518
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 net-wireless/unifi/files/mongod-wrapper | 9 ++-
14 net-wireless/unifi/files/unifi.confd | 6 +-
15 net-wireless/unifi/files/unifi.initd | 23 ++++---
16 net-wireless/unifi/files/unifi.service | 8 +--
17 net-wireless/unifi/files/unifi.service.conf | 4 --
18 net-wireless/unifi/metadata.xml | 15 ++++-
19 net-wireless/unifi/unifi-5.6.39.ebuild | 97 ++++++++++++++++-------------
20 net-wireless/unifi/unifi-5.7.28.ebuild | 97 ++++++++++++++++-------------
21 net-wireless/unifi/unifi-5.8.23.ebuild | 88 ++++++++++++++------------
22 net-wireless/unifi/unifi-5.9.4.ebuild | 87 ++++++++++++++------------
23 10 files changed, 245 insertions(+), 189 deletions(-)
24
25 diff --git a/net-wireless/unifi/files/mongod-wrapper b/net-wireless/unifi/files/mongod-wrapper
26 index f2eb2a43752..21637de50a0 100755
27 --- a/net-wireless/unifi/files/mongod-wrapper
28 +++ b/net-wireless/unifi/files/mongod-wrapper
29 @@ -1,3 +1,6 @@
30 -#!/bin/bash
31 -cleaned_args=$(echo $* | sed -e 's/--nohttpinterface//')
32 -/usr/bin/mongod ${cleaned_args}
33 +#!/bin/sh
34 +
35 +# Remove --nohttpinterface argument, since it does not exist on MongoDB >= 3.6.x anymore
36 +# See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
37 +remove_nohttpinterface_arg=$(echo $* | sed -e 's/--nohttpinterface//')
38 +/usr/bin/mongod ${remove_nohttpinterface_arg}
39
40 diff --git a/net-wireless/unifi/files/unifi.confd b/net-wireless/unifi/files/unifi.confd
41 index 78a59910ac4..580c18d332b 100644
42 --- a/net-wireless/unifi/files/unifi.confd
43 +++ b/net-wireless/unifi/files/unifi.confd
44 @@ -1,6 +1,6 @@
45 # Copyright 1999-2018 Gentoo Foundation
46 # Distributed under the terms of the GNU General Public License v2
47
48 -# /etc/conf.d/unifi.conf
49 -
50 -#JAVA_HOME="/usr"
51 +# Specifies the path of an used Java runtime,
52 +# if it's not set, the system default is being used.
53 +# JAVA_HOME=""
54
55 diff --git a/net-wireless/unifi/files/unifi.initd b/net-wireless/unifi/files/unifi.initd
56 index 7aded2123df..959aa58a42c 100644
57 --- a/net-wireless/unifi/files/unifi.initd
58 +++ b/net-wireless/unifi/files/unifi.initd
59 @@ -2,22 +2,25 @@
60 # Copyright 1999-2018 Gentoo Foundation
61 # Distributed under the terms of the GNU General Public License v2
62
63 -PID_FILE="/run/unifi.pid"
64 -DAEMON="${JAVA_HOME-/usr}"/bin/java
65 +ACE_LIB="lib/ace.jar"
66 +DAEMON="${JAVA_HOME-/etc/java-config-2/current-system-vm}"/bin/java
67 +JAVA_OPTS="-Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp"
68 +UNIFI_GROUP="unifi"
69 UNIFI_PATH="/usr/lib/unifi"
70 +UNIFI_USER="unifi"
71 +
72 +depend() {
73 + need net
74 +}
75
76 start() {
77 - ebegin "Starting unifi"
78 - cd "${UNIFI_PATH}"
79 - start-stop-daemon --start --quiet -b \
80 - --pidfile "${PID_FILE}" -m \
81 - --exec ${DAEMON} -- -jar lib/ace.jar start
82 + ebegin "Starting UniFi Controller"
83 + 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
84 eend $?
85 - #--user nobody --group nobody \
86 }
87
88 stop() {
89 - ebegin "Stopping unifi"
90 - start-stop-daemon --quiet --stop -R 20 --pidfile "${PID_FILE}"
91 + ebegin "Stopping UniFi Controller"
92 + start-stop-daemon --start --quiet --background --user ${UNIFI_USER} --group ${UNIFI_GROUP} --chdir ${UNIFI_PATH} --exec ${DAEMON} -- ${JAVA_OPTS} -jar ${ACE_LIB} stop
93 eend $?
94 }
95
96 diff --git a/net-wireless/unifi/files/unifi.service b/net-wireless/unifi/files/unifi.service
97 index 11385a0e913..cee05d4d153 100644
98 --- a/net-wireless/unifi/files/unifi.service
99 +++ b/net-wireless/unifi/files/unifi.service
100 @@ -1,14 +1,14 @@
101 [Unit]
102 Description=UniFi Controller
103 -Requires=network.target
104 -After=network.target
105 +After=network-online.target
106
107 [Service]
108 -ExecStart=/usr/bin/java -jar /usr/lib/unifi/lib/ace.jar start
109 -ExecStop=/usr/bin/java -jar /usr/lib/unifi/lib/ace.jar stop
110 +Type=simple
111 User=unifi
112 Group=unifi
113 WorkingDirectory=/usr/lib/unifi
114 +ExecStart=/usr/bin/java -Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp -jar /usr/lib/unifi/lib/ace.jar start
115 +ExecStop=/usr/bin/java -Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp -jar /usr/lib/unifi/lib/ace.jar stop
116
117 [Install]
118 WantedBy=network.target
119
120 diff --git a/net-wireless/unifi/files/unifi.service.conf b/net-wireless/unifi/files/unifi.service.conf
121 deleted file mode 100644
122 index 0ef221d3b73..00000000000
123 --- a/net-wireless/unifi/files/unifi.service.conf
124 +++ /dev/null
125 @@ -1,4 +0,0 @@
126 -[Service]
127 -RuntimeDirectory=unifi
128 -User=unifi
129 -Group=unifi
130
131 diff --git a/net-wireless/unifi/metadata.xml b/net-wireless/unifi/metadata.xml
132 index ee9a82ac417..57ba2066974 100644
133 --- a/net-wireless/unifi/metadata.xml
134 +++ b/net-wireless/unifi/metadata.xml
135 @@ -5,5 +5,18 @@
136 <email>bkohler@g.o</email>
137 <name>Ben Kohler</name>
138 </maintainer>
139 + <maintainer type="person">
140 + <email>ck+gentoo@××××××××.de</email>
141 + <name>Conrad Kostecki</name>
142 + </maintainer>
143 + <maintainer type="project">
144 + <email>proxy-maint@g.o</email>
145 + <name>Proxy Maintainers</name>
146 + </maintainer>
147 + <longdescription>
148 + UniFi is a management controller software for Ubiquiti UniFi APs.
149 + It's purpose is to configure and monitor all those APs.
150 + Also all kind of statistics are collected, which can be accessed through UniFi.
151 + There is also an internal RADIUS server, which can be used for WPA2-Enterprise.
152 + </longdescription>
153 </pkgmetadata>
154 -
155
156 diff --git a/net-wireless/unifi/unifi-5.6.39.ebuild b/net-wireless/unifi/unifi-5.6.39.ebuild
157 index cd3ade4f06f..e29f1cfaaff 100644
158 --- a/net-wireless/unifi/unifi-5.6.39.ebuild
159 +++ b/net-wireless/unifi/unifi-5.6.39.ebuild
160 @@ -3,56 +3,69 @@
161
162 EAPI=6
163
164 -inherit systemd user
165 -
166 -# for stable candidates set RC_SUFFIX="-xxxxxxxxxx"
167 +# Used, when it's an unstable, beta or release candidate
168 RC_SUFFIX=""
169
170 -DESCRIPTION="Management Controller for UniFi APs"
171 -HOMEPAGE="https://www.ubnt.com/download/unifi"
172 -SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
173 +inherit systemd user
174
175 -LICENSE="GPL-3"
176 -SLOT="0"
177 -KEYWORDS="~amd64"
178 -IUSE=""
179 -RESTRICT="mirror"
180 +DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
181 +HOMEPAGE="https://www.ubnt.com"
182 +SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
183 +
184 +KEYWORDS="~amd64 ~x86"
185 +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"
186 +SLOT="0/5.6"
187
188 -DEPEND=""
189 RDEPEND="dev-db/mongodb
190 - virtual/jre"
191 + dev-java/tomcat-native
192 + virtual/jre:1.8"
193 +
194 +DEPEND="app-arch/unzip"
195
196 -S=${WORKDIR}/UniFi
197 -QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
198 +RESTRICT="bindist mirror"
199 +
200 +S="${WORKDIR}/UniFi"
201 +
202 +DOCS=( "readme.txt" )
203 +
204 +QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
205
206 pkg_setup() {
207 - enewuser ${PN}
208 - enewgroup ${PN}
209 + enewgroup unifi
210 + enewuser unifi -1 -1 /var/lib/unifi unifi
211 +}
212 +
213 +src_prepare() {
214 + # Remove unneeded files Linux, Mac and Windows
215 + rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
216 +
217 + default
218 }
219
220 -src_install(){
221 - static_dir="/usr/$(get_libdir)/${PN}"
222 - #install static data
223 - insinto ${static_dir}
224 - doins -r *
225 - #prepare runtime-data dirs which live in /var but are symlinked from static
226 - #data dir, and are writable by non-root user
227 - dodir /var/log/${PN}
228 - fowners ${PN}:${PN} /var/log/${PN}
229 - dosym ../../../var/log/${PN} ${static_dir}/logs
230 -
231 - dodir /var/lib/${PN}/work
232 - fowners ${PN}:${PN} /var/lib/${PN}/work
233 - dosym ../../../var/lib/${PN}/work ${static_dir}/work
234 -
235 - keepdir /var/lib/${PN}/data
236 - fowners ${PN}:${PN} /var/lib/${PN}/data
237 - dosym ../../../var/lib/${PN}/data ${static_dir}/data
238 -
239 - echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
240 - doenvd "${T}"/99${PN}
241 -
242 - newinitd "${FILESDIR}"/${PN}.initd ${PN}
243 - newconfd "${FILESDIR}"/${PN}.confd ${PN}
244 - systemd_dounit "${FILESDIR}"/${PN}.service
245 +src_install() {
246 + # Install MongoDB wrapper script, to avoid problems with >= 3.6.0
247 + # See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
248 + exeinto /usr/lib/unifi/bin
249 + newexe "${FILESDIR}"/mongod-wrapper mongod
250 +
251 + insinto /usr/lib/unifi
252 + doins -r dl lib webapps
253 +
254 + diropts -o unifi -g unifi
255 + keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
256 +
257 + for symlink in conf data run tmp work; do
258 + dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
259 + done
260 + dosym ../../../var/log/unifi /usr/lib/unifi/logs
261 +
262 + newinitd "${FILESDIR}"/unifi.initd unifi
263 + systemd_dounit "${FILESDIR}"/unifi.service
264 +
265 + newconfd "${FILESDIR}"/unifi.confd unifi
266 +
267 + echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
268 + doenvd "${T}"/99unifi
269 +
270 + einstalldocs
271 }
272
273 diff --git a/net-wireless/unifi/unifi-5.7.28.ebuild b/net-wireless/unifi/unifi-5.7.28.ebuild
274 index 0e23b1ca6d5..04953de49c4 100644
275 --- a/net-wireless/unifi/unifi-5.7.28.ebuild
276 +++ b/net-wireless/unifi/unifi-5.7.28.ebuild
277 @@ -3,56 +3,69 @@
278
279 EAPI=6
280
281 -inherit systemd user
282 +# Used, when it's an unstable, beta or release candidate
283 +RC_SUFFIX="5c442c6b54"
284
285 -# for not-stable releases set RC_SUFFIX="-xxxxxxxxxx"
286 -RC_SUFFIX="-5c442c6b54"
287 +inherit systemd user
288
289 -DESCRIPTION="Management Controller for UniFi APs"
290 -HOMEPAGE="https://www.ubnt.com/download/unifi"
291 -SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
292 +DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
293 +HOMEPAGE="https://www.ubnt.com"
294 +SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
295
296 -LICENSE="GPL-3"
297 -SLOT="0"
298 -KEYWORDS="~amd64"
299 -IUSE=""
300 -RESTRICT="mirror"
301 +KEYWORDS="~amd64 ~x86"
302 +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"
303 +SLOT="0/5.7"
304
305 -DEPEND=""
306 RDEPEND="dev-db/mongodb
307 - virtual/jre"
308 + dev-java/tomcat-native
309 + virtual/jre:1.8"
310 +
311 +DEPEND="app-arch/unzip"
312 +
313 +RESTRICT="bindist mirror"
314
315 -S=${WORKDIR}/UniFi
316 -QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
317 +S="${WORKDIR}/UniFi"
318 +
319 +DOCS=( "readme.txt" )
320 +
321 +QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
322
323 pkg_setup() {
324 - enewuser ${PN}
325 - enewgroup ${PN}
326 + enewgroup unifi
327 + enewuser unifi -1 -1 /var/lib/unifi unifi
328 +}
329 +
330 +src_prepare() {
331 + # Remove unneeded files Linux, Mac and Windows
332 + rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
333 +
334 + default
335 }
336
337 -src_install(){
338 - static_dir="/usr/$(get_libdir)/${PN}"
339 - #install static data
340 - insinto ${static_dir}
341 - doins -r *
342 - #prepare runtime-data dirs which live in /var but are symlinked from static
343 - #data dir, and are writable by non-root user
344 - dodir /var/log/${PN}
345 - fowners ${PN}:${PN} /var/log/${PN}
346 - dosym ../../../var/log/${PN} ${static_dir}/logs
347 -
348 - dodir /var/lib/${PN}/work
349 - fowners ${PN}:${PN} /var/lib/${PN}/work
350 - dosym ../../../var/lib/${PN}/work ${static_dir}/work
351 -
352 - keepdir /var/lib/${PN}/data
353 - fowners ${PN}:${PN} /var/lib/${PN}/data
354 - dosym ../../../var/lib/${PN}/data ${static_dir}/data
355 -
356 - echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
357 - doenvd "${T}"/99${PN}
358 -
359 - newinitd "${FILESDIR}"/${PN}.initd ${PN}
360 - newconfd "${FILESDIR}"/${PN}.confd ${PN}
361 - systemd_dounit "${FILESDIR}"/${PN}.service
362 +src_install() {
363 + # Install MongoDB wrapper script, to avoid problems with >= 3.6.0
364 + # See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
365 + exeinto /usr/lib/unifi/bin
366 + newexe "${FILESDIR}"/mongod-wrapper mongod
367 +
368 + insinto /usr/lib/unifi
369 + doins -r dl lib webapps
370 +
371 + diropts -o unifi -g unifi
372 + keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
373 +
374 + for symlink in conf data run tmp work; do
375 + dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
376 + done
377 + dosym ../../../var/log/unifi /usr/lib/unifi/logs
378 +
379 + newinitd "${FILESDIR}"/unifi.initd unifi
380 + systemd_dounit "${FILESDIR}"/unifi.service
381 +
382 + newconfd "${FILESDIR}"/unifi.confd unifi
383 +
384 + echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
385 + doenvd "${T}"/99unifi
386 +
387 + einstalldocs
388 }
389
390 diff --git a/net-wireless/unifi/unifi-5.8.23.ebuild b/net-wireless/unifi/unifi-5.8.23.ebuild
391 index ea971a293b1..d0bd1c77f6d 100644
392 --- a/net-wireless/unifi/unifi-5.8.23.ebuild
393 +++ b/net-wireless/unifi/unifi-5.8.23.ebuild
394 @@ -3,61 +3,69 @@
395
396 EAPI=6
397
398 -inherit systemd user
399 +# Used, when it's an unstable, beta or release candidate
400 +RC_SUFFIX="d5a5bbfda4"
401
402 -# for not-stable releases set RC_SUFFIX="-xxxxxxxxxx"
403 -RC_SUFFIX=""
404 +inherit systemd user
405
406 -DESCRIPTION="Management Controller for UniFi APs"
407 -HOMEPAGE="https://www.ubnt.com/download/unifi"
408 -SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
409 +DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
410 +HOMEPAGE="https://www.ubnt.com"
411 +SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
412
413 -LICENSE="GPL-3"
414 -SLOT="0"
415 -KEYWORDS="~amd64"
416 -IUSE=""
417 -RESTRICT="mirror"
418 +KEYWORDS="~amd64 ~x86"
419 +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"
420 +SLOT="0/5.8"
421
422 -DEPEND=""
423 RDEPEND="dev-db/mongodb
424 - virtual/jre"
425 + dev-java/tomcat-native
426 + virtual/jre:1.8"
427 +
428 +DEPEND="app-arch/unzip"
429 +
430 +RESTRICT="bindist mirror"
431 +
432 +S="${WORKDIR}/UniFi"
433
434 -S=${WORKDIR}/UniFi
435 -QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
436 +DOCS=( "readme.txt" )
437 +
438 +QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
439
440 pkg_setup() {
441 - enewuser ${PN}
442 - enewgroup ${PN}
443 + enewgroup unifi
444 + enewuser unifi -1 -1 /var/lib/unifi unifi
445 }
446
447 -src_install(){
448 - static_dir="/usr/$(get_libdir)/${PN}"
449 - #install static data
450 - insinto ${static_dir}
451 - doins -r *
452 +src_prepare() {
453 + # Remove unneeded files Linux, Mac and Windows
454 + rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
455 +
456 + default
457 +}
458
459 - #wrapper to work around mongodb-3.6 compat issue
460 - exeinto ${static_dir}/bin/
461 +src_install() {
462 + # Install MongoDB wrapper script, to avoid problems with >= 3.6.0
463 + # See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
464 + exeinto /usr/lib/unifi/bin
465 newexe "${FILESDIR}"/mongod-wrapper mongod
466
467 - #prepare runtime-data dirs which live in /var but are symlinked from static
468 - #data dir, and are writable by non-root user
469 - dodir /var/log/${PN}
470 - fowners ${PN}:${PN} /var/log/${PN}
471 - dosym ../../../var/log/${PN} ${static_dir}/logs
472 + insinto /usr/lib/unifi
473 + doins -r dl lib webapps
474 +
475 + diropts -o unifi -g unifi
476 + keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
477 +
478 + for symlink in conf data run tmp work; do
479 + dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
480 + done
481 + dosym ../../../var/log/unifi /usr/lib/unifi/logs
482
483 - dodir /var/lib/${PN}/work
484 - fowners ${PN}:${PN} /var/lib/${PN}/work
485 - dosym ../../../var/lib/${PN}/work ${static_dir}/work
486 + newinitd "${FILESDIR}"/unifi.initd unifi
487 + systemd_dounit "${FILESDIR}"/unifi.service
488
489 - keepdir /var/lib/${PN}/data
490 - fowners ${PN}:${PN} /var/lib/${PN}/data
491 - dosym ../../../var/lib/${PN}/data ${static_dir}/data
492 + newconfd "${FILESDIR}"/unifi.confd unifi
493
494 - echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
495 - doenvd "${T}"/99${PN}
496 + echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
497 + doenvd "${T}"/99unifi
498
499 - newinitd "${FILESDIR}"/${PN}.initd ${PN}
500 - newconfd "${FILESDIR}"/${PN}.confd ${PN}
501 - systemd_dounit "${FILESDIR}"/${PN}.service
502 + einstalldocs
503 }
504
505 diff --git a/net-wireless/unifi/unifi-5.9.4.ebuild b/net-wireless/unifi/unifi-5.9.4.ebuild
506 index b51420746ef..5a117e75dae 100644
507 --- a/net-wireless/unifi/unifi-5.9.4.ebuild
508 +++ b/net-wireless/unifi/unifi-5.9.4.ebuild
509 @@ -3,61 +3,68 @@
510
511 EAPI=6
512
513 -inherit systemd user
514 +# Used, when it's an unstable, beta or release candidate
515 +RC_SUFFIX="b647df56b7"
516
517 -# for not-stable releases set RC_SUFFIX="-xxxxxxxxxx"
518 -RC_SUFFIX="-b647df56b7"
519 +inherit systemd user
520
521 -DESCRIPTION="Management Controller for UniFi APs"
522 -HOMEPAGE="https://www.ubnt.com/download/unifi"
523 -SRC_URI="http://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
524 +DESCRIPTION="A Management Controller for Ubiquiti Networks UniFi APs"
525 +HOMEPAGE="https://www.ubnt.com"
526 +SRC_URI="https://dl.ubnt.com/unifi/${PV}${RC_SUFFIX}/UniFi.unix.zip -> ${P}.zip"
527
528 -LICENSE="GPL-3"
529 -SLOT="0"
530 -#KEYWORDS="~amd64"
531 -IUSE=""
532 -RESTRICT="mirror"
533 +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"
534 +SLOT="0/5.9"
535
536 -DEPEND=""
537 RDEPEND="dev-db/mongodb
538 - virtual/jre"
539 + dev-java/tomcat-native
540 + virtual/jre:1.8"
541 +
542 +DEPEND="app-arch/unzip"
543 +
544 +RESTRICT="bindist mirror"
545 +
546 +S="${WORKDIR}/UniFi"
547
548 -S=${WORKDIR}/UniFi
549 -QA_PREBUILT="/usr/lib64/unifi/lib/native/*"
550 +DOCS=( "readme.txt" )
551 +
552 +QA_PREBUILT="usr/lib/unifi/lib/native/Linux/x86_64/*.so"
553
554 pkg_setup() {
555 - enewuser ${PN}
556 - enewgroup ${PN}
557 + enewgroup unifi
558 + enewuser unifi -1 -1 /var/lib/unifi unifi
559 }
560
561 -src_install(){
562 - static_dir="/usr/$(get_libdir)/${PN}"
563 - #install static data
564 - insinto ${static_dir}
565 - doins -r *
566 +src_prepare() {
567 + # Remove unneeded files Linux, Mac and Windows
568 + rm -r lib/native/Linux/{aarch64,armv7} lib/native/{Mac,Windows} || die
569 +
570 + default
571 +}
572
573 - #wrapper to work around mongodb-3.6 compat issue
574 - exeinto ${static_dir}/bin/
575 +src_install() {
576 + # Install MongoDB wrapper script, to avoid problems with >= 3.6.0
577 + # See https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/td-p/2195435
578 + exeinto /usr/lib/unifi/bin
579 newexe "${FILESDIR}"/mongod-wrapper mongod
580
581 - #prepare runtime-data dirs which live in /var but are symlinked from static
582 - #data dir, and are writable by non-root user
583 - dodir /var/log/${PN}
584 - fowners ${PN}:${PN} /var/log/${PN}
585 - dosym ../../../var/log/${PN} ${static_dir}/logs
586 + insinto /usr/lib/unifi
587 + doins -r dl lib webapps
588 +
589 + diropts -o unifi -g unifi
590 + keepdir /var/lib/unifi/{conf,data,run,tmp,work} /var/log/unifi
591 +
592 + for symlink in conf data run tmp work; do
593 + dosym ../../../var/lib/unifi/${symlink} /usr/lib/unifi/${symlink}
594 + done
595 + dosym ../../../var/log/unifi /usr/lib/unifi/logs
596
597 - dodir /var/lib/${PN}/work
598 - fowners ${PN}:${PN} /var/lib/${PN}/work
599 - dosym ../../../var/lib/${PN}/work ${static_dir}/work
600 + newinitd "${FILESDIR}"/unifi.initd unifi
601 + systemd_dounit "${FILESDIR}"/unifi.service
602
603 - keepdir /var/lib/${PN}/data
604 - fowners ${PN}:${PN} /var/lib/${PN}/data
605 - dosym ../../../var/lib/${PN}/data ${static_dir}/data
606 + newconfd "${FILESDIR}"/unifi.confd unifi
607
608 - echo "CONFIG_PROTECT=\"/var/lib/${PN}/data/system.properties\"" > "${T}"/99${PN}
609 - doenvd "${T}"/99${PN}
610 + echo 'CONFIG_PROTECT="/var/lib/unifi"' > "${T}"/99unifi || die
611 + doenvd "${T}"/99unifi
612
613 - newinitd "${FILESDIR}"/${PN}.initd ${PN}
614 - newconfd "${FILESDIR}"/${PN}.confd ${PN}
615 - systemd_dounit "${FILESDIR}"/${PN}.service
616 + einstalldocs
617 }