Files
slide/sbin/build_deb.sh
Nathan Coad a9c5139d55
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
add mqtt control
2026-01-31 16:50:34 +11:00

40 lines
1.1 KiB
Bash

#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
VERSION="${1:-${VERSION:-0.0.0}}"
VERSION="${VERSION#v}"
# Debian versions must start with a digit; fall back to 0.0.0+<sha/tag>.
if [[ ! "$VERSION" =~ ^[0-9] ]]; then
VERSION="0.0.0+${VERSION}"
fi
ARCH="${ARCH:-$(dpkg --print-architecture)}"
PACKAGE_NAME="slide"
BUILD_DIR="$ROOT_DIR/build"
DIST_DIR="$ROOT_DIR/dist"
STAGE_DIR="$BUILD_DIR/deb"
cd "$ROOT_DIR"
make build
rm -rf "$STAGE_DIR"
mkdir -p "$STAGE_DIR/DEBIAN" "$STAGE_DIR/usr/local/bin" "$DIST_DIR"
install -m 0755 "$BUILD_DIR/slide" "$STAGE_DIR/usr/local/bin/slide"
cat > "$STAGE_DIR/DEBIAN/control" <<EOF
Package: ${PACKAGE_NAME}
Version: ${VERSION}
Section: graphics
Priority: optional
Architecture: ${ARCH}
Maintainer: slide build
Depends: libqt5core5a, libqt5gui5, libqt5widgets5, libqt5network5, libexif12, qt5-image-formats-plugins, libmosquitto1
Description: Lightweight slideshow for photo frames
Simple, lightweight slideshow designed for low power devices.
EOF
dpkg-deb --build "$STAGE_DIR" "$DIST_DIR/${PACKAGE_NAME}_${VERSION}_${ARCH}.deb"