This commit is contained in:
Linrador 2026-06-23 12:55:49 +02:00
parent 9766006d8b
commit 1f5ad37a40
5 changed files with 44 additions and 12 deletions

View File

@ -55,7 +55,7 @@ echo.
echo Build erfolgreich.
echo Windows: dist\nsfwapp.exe
echo Debian: dist\nsfwapp-linux-amd64
echo Debian-Paket: dist\nsfwapp_*.deb
echo Debian-Paket: dist\nsfwapp_amd64.deb
goto end
:error

View File

@ -1,15 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
PACKAGE_NAME="${DEB_PACKAGE_NAME:-nsfwapp}"
APP_TITLE="${DEB_APP_TITLE:-NSFW App}"
VERSION="${DEB_VERSION:-0.1.0}"
ARCH="${DEB_ARCH:-amd64}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MANIFEST_PATH="${BUILD_MANIFEST:-$SCRIPT_DIR/build_manifest.env}"
if [ -f "$MANIFEST_PATH" ]; then
# shellcheck disable=SC1090
source "$MANIFEST_PATH"
fi
PACKAGE_NAME="${DEB_PACKAGE_NAME:-${PACKAGE_NAME:-}}"
APP_TITLE="${DEB_APP_TITLE:-${APP_TITLE:-}}"
VERSION="${DEB_VERSION:-${VERSION:-}}"
ARCH="${DEB_ARCH:-${ARCH:-}}"
SECTION="${DEB_SECTION:-${SECTION:-}}"
PRIORITY="${DEB_PRIORITY:-${PRIORITY:-}}"
MAINTAINER="${DEB_MAINTAINER:-${MAINTAINER:-}}"
DESCRIPTION_SHORT="${DEB_DESCRIPTION_SHORT:-${DESCRIPTION_SHORT:-}}"
DESCRIPTION_LONG="${DEB_DESCRIPTION_LONG:-${DESCRIPTION_LONG:-}}"
OUT_DIR="$SCRIPT_DIR/dist"
BIN_PATH="$OUT_DIR/nsfwapp-linux-amd64"
OUT_FILE="$OUT_DIR/${PACKAGE_NAME}_${VERSION}_${ARCH}.deb"
OUT_FILE="$OUT_DIR/${PACKAGE_NAME}_${ARCH}.deb"
CLEAN_BUILD_DIR=0
if [ -n "${DEB_BUILD_DIR:-}" ]; then
@ -35,6 +47,16 @@ fail() {
exit 1
}
[ -n "$PACKAGE_NAME" ] || fail "PACKAGE_NAME fehlt im Build-Manifest."
[ -n "$APP_TITLE" ] || fail "APP_TITLE fehlt im Build-Manifest."
[ -n "$VERSION" ] || fail "VERSION fehlt im Build-Manifest."
[ -n "$ARCH" ] || fail "ARCH fehlt im Build-Manifest."
[ -n "$SECTION" ] || fail "SECTION fehlt im Build-Manifest."
[ -n "$PRIORITY" ] || fail "PRIORITY fehlt im Build-Manifest."
[ -n "$MAINTAINER" ] || fail "MAINTAINER fehlt im Build-Manifest."
[ -n "$DESCRIPTION_SHORT" ] || fail "DESCRIPTION_SHORT fehlt im Build-Manifest."
[ -n "$DESCRIPTION_LONG" ] || fail "DESCRIPTION_LONG fehlt im Build-Manifest."
command -v dpkg-deb >/dev/null 2>&1 || fail "dpkg-deb fehlt. Installiere es mit: sudo apt install -y dpkg-dev"
mkdir -p "$OUT_DIR"
@ -266,13 +288,13 @@ EOF
cat >"$PKG_ROOT/DEBIAN/control" <<EOF
Package: $PACKAGE_NAME
Version: $VERSION
Section: video
Priority: optional
Section: $SECTION
Priority: $PRIORITY
Architecture: $ARCH
Maintainer: Local Build <local@example.invalid>
Maintainer: $MAINTAINER
Depends: ca-certificates, ffmpeg, python3, xdg-utils, libnotify-bin, procps
Description: NSFW recorder backend and web UI
Local Debian package for the NSFW recorder backend with embedded web UI and ML assets.
Description: $DESCRIPTION_SHORT
$DESCRIPTION_LONG
EOF
cat >"$PKG_ROOT/DEBIAN/postinst" <<'EOF'

View File

@ -0,0 +1,10 @@
# Build and Debian package metadata.
PACKAGE_NAME="nsfwapp"
APP_TITLE="NSFW App"
VERSION="1.1.0"
ARCH="amd64"
SECTION="video"
PRIORITY="optional"
MAINTAINER="Local Build <local@example.invalid>"
DESCRIPTION_SHORT="NSFW recorder backend and web UI"
DESCRIPTION_LONG="Local Debian package for the NSFW recorder backend with embedded web UI and ML assets."

Binary file not shown.

Binary file not shown.