summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-06-28 17:15:04 -0400
committerLouie S <louie@example.com>2024-06-28 17:15:12 -0400
commitaccd85087031fbfbd5759f42268597cf22d1a97f (patch)
tree75f0c51d29021c2a88aef741b3d3677b2b816228
parent2d173e84edc4d15fc75d6b794861eba9b76b6fc5 (diff)
Working containerized package builds for deb packages
-rwxr-xr-xactions/build_deb.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/actions/build_deb.sh b/actions/build_deb.sh
new file mode 100755
index 0000000..2055f6e
--- /dev/null
+++ b/actions/build_deb.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env sh
+
+CONTAINER_NAME="build_deb"
+IMAGE_NAME="$1"
+
+DEPENDENCY_LIST="autoconf-archive debmake devscripts ncurses-dev pkg-config"
+
+if [ -z "$IMAGE_NAME" ]; then
+ IMAGE_NAME="debian:unstable"
+fi
+
+podman pull docker.io/library/"$IMAGE_NAME"
+
+podman run -itd --name "$CONTAINER_NAME" "$IMAGE_NAME"
+
+make -C "$(dirname "$0")/.." dist
+podman exec "$CONTAINER_NAME" mkdir -p /tmp/build
+podman cp terminal-media-launcher*.tar.gz "$CONTAINER_NAME":/tmp/build
+
+podman exec -w /tmp/build "$CONTAINER_NAME" apt-get -y update
+podman exec -w /tmp/build "$CONTAINER_NAME" apt-get -y upgrade
+podman exec -w /tmp/build "$CONTAINER_NAME" apt install -y $DEPENDENCY_LIST
+podman exec -w /tmp/build "$CONTAINER_NAME" debmake -y -a terminal-media-launcher-0.1.tar.gz -i debuild
+
+mkdir -p "$(dirname "$0")/build"
+
+podman cp "$CONTAINER_NAME":/tmp/build/. "$(dirname "$0")/build/"
+
+podman kill "$CONTAINER_NAME"
+podman rm "$CONTAINER_NAME"