|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Build script for creating a DEB package for immersionpod |
| 4 | + |
| 5 | +set -euo pipefail |
| 6 | + |
| 7 | +PACKAGE_NAME="immersionpod" |
| 8 | +VERSION=${VERSION:?Version is not set.} |
| 9 | +VERSION=${VERSION##v} |
| 10 | +PACKAGE_DIR="deb_package" |
| 11 | +OUTPUT_FILE="${PACKAGE_NAME}-${VERSION}.deb" |
| 12 | + |
| 13 | +ROOT_DIR=$(git rev-parse --show-toplevel) |
| 14 | +cd -- "$ROOT_DIR" || exit 1 |
| 15 | + |
| 16 | +# Clean up previous build |
| 17 | +rm -rf -- "$PACKAGE_DIR" "$OUTPUT_FILE" |
| 18 | + |
| 19 | +# Create package directory structure |
| 20 | +mkdir -p -- "$PACKAGE_DIR/DEBIAN" |
| 21 | +mkdir -p -- "$PACKAGE_DIR/usr/bin" |
| 22 | +mkdir -p -- "$PACKAGE_DIR/usr/share/doc/$PACKAGE_NAME" |
| 23 | +mkdir -p -- "$PACKAGE_DIR/usr/share/licenses/$PACKAGE_NAME" |
| 24 | + |
| 25 | +# Create control file |
| 26 | +cat > "$PACKAGE_DIR/DEBIAN/control" << EOF |
| 27 | +Package: $PACKAGE_NAME |
| 28 | +Version: $VERSION |
| 29 | +Section: utils |
| 30 | +Priority: optional |
| 31 | +Architecture: all |
| 32 | +Maintainer: Ajatt-Tools and contributors <tatsu@autistici.org> |
| 33 | +Depends: bash, file, gawk, ffmpeg, mpd, xdg-user-dirs |
| 34 | +Recommends: mpc, libnotify-bin, yt-dlp |
| 35 | +Description: AJATT-style passive listening and condensed audio without bloat. |
| 36 | + Immersion pod is a tool for managing passive immersion. It converts |
| 37 | + foreign language movies and TV shows to audio and uses it for passive |
| 38 | + listening. It supports condensed audio and creates it by default |
| 39 | + if it finds subtitles in the container or externally. |
| 40 | +Homepage: https://ajatt.top |
| 41 | +License: GPL-3.0 |
| 42 | +EOF |
| 43 | + |
| 44 | +# Copy files to package directory |
| 45 | +cp -- impd "$PACKAGE_DIR/usr/bin/" |
| 46 | +cp -- README.md "$PACKAGE_DIR/usr/share/doc/$PACKAGE_NAME/" |
| 47 | +cp -- LICENSE "$PACKAGE_DIR/usr/share/licenses/$PACKAGE_NAME/" |
| 48 | + |
| 49 | +# Build the DEB package |
| 50 | +dpkg-deb --build "$PACKAGE_DIR" "$OUTPUT_FILE" |
| 51 | + |
| 52 | +echo "DEB package created: $OUTPUT_FILE" |
| 53 | + |
| 54 | +# Show package info |
| 55 | +echo "Package info:" |
| 56 | +dpkg-deb --info "$OUTPUT_FILE" |
0 commit comments