add: debian file, perform various fixes

This commit is contained in:
Charles
2024-01-15 22:44:05 -08:00
parent ccafa34f33
commit 195cd67c90
17 changed files with 432 additions and 204 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
mkdir -p dbuild/usr/local/bin
mkdir -p dbuild/etc/
mkdir -p dbuild/etc/systemd/system/
mkdir -p dbuild/DEBIAN
cat <<EOF > dbuild/DEBIAN/control
Package: watcher
Version: 0.2
Maintainer: Charles
Architecture: all
Description: Watches cameras and temp sensors
EOF
cat <<EOF > dbuild/DEBIAN/postinst
#!/bin/bash
systemctl daemon-reload
# Make sure its enabled
systemctl enable --now watcher
# Restart it; it might have already been installed and running
systemctl restart watcher
EOF
chmod +x dbuild/DEBIAN/postinst
GOOS=linux GOARCH=arm64 go build -o dbuild/usr/local/bin/watcher ./cmd/watcher
cp ./rpi_camera.yaml dbuild/etc/watcher_config.yaml
cp ./watcher.systemd dbuild/etc/systemd/system/watcher.service
cp ./temperature.py dbuild/usr/local/bin/
dpkg-deb --build dbuild