34 lines
777 B
Bash
Executable file
34 lines
777 B
Bash
Executable file
#!/bin/bash
|
|
|
|
VERSION=1.27.0
|
|
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
|
|
|
|
STEP="minimum_package envinit default_prebuild build makedeb"
|
|
|
|
envinit() {
|
|
configure_depot_nodejs
|
|
apt-get update
|
|
apt-get dist-upgrade -y
|
|
apt install -y --no-install-recommends nodejs make g++ gcc
|
|
}
|
|
|
|
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
|
|
}
|