debmaker/ressources/zigbee2mqtt/debmaker
2022-12-04 03:31:12 +01:00

35 lines
732 B
Bash
Executable file

#!/bin/bash
VERSION=1.28.4
APP=zigbee2mqtt
DEPOT=https://github.com/Koenkk/zigbee2mqtt.git
GIT_VERSION=${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=2
PACKAGE_DEPENDENCY="nodejs make g++ gcc"
main(){
base_package_upgrade
configure_depot_nodejs
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
}