summaryrefslogtreecommitdiff
path: root/app-misc/zigbee2mqtt/zigbee2mqtt-2.6.3.ebuild
blob: a38c5934b1a41cb62af68a36a90657480749ce5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Zigbee to MQTT bridge"
HOMEPAGE="https://github.com/Koenkk/zigbee2mqtt"
SRC_URI="https://github.com/Koenkk/zigbee2mqtt/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+="
	https://share.terinstock.com/${P}-deps.tar.xz
	https://share.terinstock.com/${P}-dist.tar.xz
"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~arm64"

RDEPEND="net-libs/nodejs"

src_install() {
	local find_dirs=(
		-iwholename '*.github' -o
		-iwholename '*.idea' -o
		-iwholename '*.tscache' -o
		-iwholename '*/man' -o
		-iwholename '*/test' -o
		-iwholename '*/scripts' -o
		-iwholename '*/git-hooks' -o
		-iwholename '*/android-arm' -o
		-iwholename '*/android-arm64' -o
		-iwholename '*/linux-armvy' -o
		-iwholename '*/linux-armv7' -o
		-iwholename '*/linux-arm' -o
		-iwholename '*/win32-arm64' -o
		-iwholename '*/win32-ia32' -o
		-iwholename '*/win32-x64' -o
		-iwholename '*/darwin-x64+arm64'
	)

	find "${WORKDIR}"/node_modules -type d \( "${find_dirs[@]}" \) -exec rm -rvf {} +

	insinto "/usr/share/${PN}"
	doins -r "${WORKDIR}"/node_modules "${WORKDIR}"/dist index.js package.json
	exeinto "/usr/share/${PN}"
	exeopts -m755
	doexe cli.js
	dosym -r "/usr/share/${PN}/cli.js" "/usr/bin/zigbee2mqtt"
}