Include eclass for new nodejs ebuilds
New packages (zigbee2mqtt and node-red) from my gentoo overlay (https://github.com/inode64/inode64-overlay)
This commit is contained in:
2
app-misc/zigbee2mqtt/Manifest
Normal file
2
app-misc/zigbee2mqtt/Manifest
Normal file
@@ -0,0 +1,2 @@
|
||||
DIST zigbee2mqtt-1.30.1-node_modules.tar.xz 18782028 BLAKE2B ee85f5de70a6913b164c73420a5ff01761d5ed3e417951e57f391234e66cd5de76dc459fda84452e1615c544f064d89d156bb580137503a45237b4aae4e23a0b SHA512 d4454ef828c66974d1210b7cc1df7526e3e324addc4e420de13314a13070132e3b7958bf2e8fdac50648ed21f06340f5335fc5b947ee1815dea3035f38954876
|
||||
DIST zigbee2mqtt-1.30.1.tar.gz 483028 BLAKE2B 9c297c85a08ef911ad13b2722adecda6e01f0c5689a5225e3e4b0998c6a6626fe0ded2d64df0479c72971fc5f92f79cb65bdc3f8ecd1583b78d94168de1fcdba SHA512 b38accbaea044c0e5b28a4cef0652d90d7691ca936e82bdd82b39d8f77719ac750c067dcb58b9a9d2251dd821e81ed62eed8bbab3c232f516a7a6247fa575d58
|
||||
24
app-misc/zigbee2mqtt/files/zigbee2mqtt
Normal file
24
app-misc/zigbee2mqtt/files/zigbee2mqtt
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
depend() {
|
||||
need mosquitto
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
if [ ! -f /var/lib/${SVCNAME}/configuration.yaml ] ; then
|
||||
eerror "No /var/lib/${SVCNAME}/configuration.yaml file exists!"
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return 1
|
||||
ebegin "Starting ${SVCNAME}"
|
||||
start-stop-daemon --start --user zigbee2mqtt:zigbee2mqtt --env ZIGBEE2MQTT_DATA=/var/lib/${SVCNAME} --chdir /usr/lib64/node_modules/zigbee2mqtt --exec /usr/bin/npm --background --make-pidfile --pidfile /run/${SVCNAME}.pid -- start
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${SVCNAME}"
|
||||
start-stop-daemon --stop --quiet --retry 10 --pidfile /run/${SVCNAME}.pid
|
||||
eend $?
|
||||
}
|
||||
3
app-misc/zigbee2mqtt/files/zigbee2mqtt.conf
Normal file
3
app-misc/zigbee2mqtt/files/zigbee2mqtt.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
d /var/lib/zigbee2mqtt 0750 zigbee2mqtt zigbee2mqtt
|
||||
f /var/lib/zigbee2mqtt//configuration.yaml 0640 zigbee2mqtt zigbee2mqtt
|
||||
d /var/log/zigbee2mqtt 0750 zigbee2mqtt zigbee2mqtt
|
||||
43
app-misc/zigbee2mqtt/files/zigbee2mqtt.service
Normal file
43
app-misc/zigbee2mqtt/files/zigbee2mqtt.service
Normal file
@@ -0,0 +1,43 @@
|
||||
[Unit]
|
||||
Description=zigbee2mqtt
|
||||
After=network.target
|
||||
Wants=mosquitto.service
|
||||
|
||||
[Service]
|
||||
ExecStart=npm start
|
||||
WorkingDirectory=/usr/lib64/node_modules/zigbee2mqtt
|
||||
Environment=ZIGBEE2MQTT_DATA=/var/lib/zigbee2mqtt
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
User=zigbee2mqtt
|
||||
|
||||
CapabilityBoundingSet=
|
||||
NoNewPrivileges=true
|
||||
RemoveIPC=true
|
||||
LockPersonality=true
|
||||
|
||||
ProtectControlGroups=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectKernelLogs=true
|
||||
ProtectHostname=true
|
||||
ProtectProc=noaccess
|
||||
ProtectClock=yes
|
||||
DeviceAllow=char-* rw
|
||||
|
||||
RestrictRealtime=true
|
||||
RestrictSUIDSGID=true
|
||||
RestrictNamespaces=true
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/var/lib/zigbee2mqtt
|
||||
|
||||
SystemCallArchitectures=native
|
||||
SystemCallFilter=@system-service @pkey
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
15
app-misc/zigbee2mqtt/metadata.xml
Normal file
15
app-misc/zigbee2mqtt/metadata.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person" proxied="yes">
|
||||
<email>web@inode64.com</email>
|
||||
<name>Fco. Javier Félix</name>
|
||||
</maintainer>
|
||||
<maintainer type="project" proxied="proxy">
|
||||
<email>proxy-maint@gentoo.org</email>
|
||||
<name>Proxy Maintainers</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">Koenkk/zigbee2mqtt</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
60
app-misc/zigbee2mqtt/zigbee2mqtt-1.30.1.ebuild
Normal file
60
app-misc/zigbee2mqtt/zigbee2mqtt-1.30.1.ebuild
Normal file
@@ -0,0 +1,60 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
EGIT_REPO_URI="https://github.com/Koenkk/zigbee2mqtt"
|
||||
EGIT_BRANCH="dev"
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://github.com/Koenkk/zigbee2mqtt/archive/${PV}.tar.gz -> ${P}.tar.gz
|
||||
https://raw.githubusercontent.com/inode64/inode64-overlay/main/dist/${P}-node_modules.tar.xz"
|
||||
fi
|
||||
|
||||
inherit nodejs nodejs-pack systemd tmpfiles
|
||||
|
||||
DESCRIPTION="It bridges events and allows you to control your Zigbee devices via MQTT"
|
||||
HOMEPAGE="https://www.zigbee2mqtt.io/"
|
||||
COMMIT="eb878d3d8ee47f77e27c771452e2d2c77ca83bb5"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND="
|
||||
acct-group/zigbee2mqtt
|
||||
acct-user/zigbee2mqtt
|
||||
app-misc/mosquitto
|
||||
"
|
||||
|
||||
NODEJS_EXTRA_FILES="scripts"
|
||||
|
||||
src_install() {
|
||||
echo "${COMMIT}" > dist/.hash
|
||||
|
||||
echo -e "\nadvanced:" >>data/configuration.yaml
|
||||
echo -e " network_key: GENERATE" >>data/configuration.yaml
|
||||
echo -e " pan_id: GENERATE" >>data/configuration.yaml
|
||||
echo -e " log_directory: /var/log/${PN}" >>data/configuration.yaml
|
||||
|
||||
enpm_clean
|
||||
enpm_install
|
||||
|
||||
keepdir /var/log/${PN}
|
||||
|
||||
insinto /var/lib/${PN}
|
||||
doins data/configuration.yaml
|
||||
|
||||
dotmpfiles "${FILESDIR}"/zigbee2mqtt.conf
|
||||
|
||||
doinitd "${FILESDIR}"/${PN}
|
||||
systemd_dounit "${FILESDIR}/${PN}.service"
|
||||
|
||||
dodir /etc/env.d
|
||||
echo 'CONFIG_PROTECT="/var/lib/${PN}"' >>"${ED}"/etc/env.d/90${PN} || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
tmpfiles_process zigbee2mqtt.conf
|
||||
}
|
||||
Reference in New Issue
Block a user