# 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" }