#!/bin/bash VERSION=1.32.2 APP=zigbee2mqtt DEPOT=https://github.com/Koenkk/zigbee2mqtt.git GIT_VERSION=${VERSION} DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) DEB_VERSION=1.33.0-$(date +%Y%m%d%H%M) DEBIAN_VERSION_CODENAME=bookworm IMAGE_SIZE=2 PACKAGE_DEPENDENCY="nodejs make g++ gcc" main(){ base_package_upgrade configure_depot_nodejs 18 install_package_dependency get_git_source build makedeb } build() { cd /tmp/${APP} npm ci npm run build } makedeb(){ PATH_DEB=/tmp/src/rootfs cp -fr /tmp/zigbee2mqtt/data/configuration.yaml ${PATH_DEB}/etc/zigbee2mqtt/configuration.yaml cp -fr /tmp/zigbee2mqtt/* ${PATH_DEB}/usr/lib/zigbee2mqtt/ sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist }