diff --git a/scripts/build_package_linux.sh b/scripts/build_package_linux.sh new file mode 100755 index 0000000..7f3a985 --- /dev/null +++ b/scripts/build_package_linux.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail + +poetry lock +poetry install + +# Build using the Linux spec so the build is reproducible and uses the project spec +poetry run pyinstaller scripts/spec_scripts/android-file-handler-linux.spec --distpath dist + +# Package into a Debian .deb using fpm +export PATH="$HOME/.local/bin:/usr/local/bin:$PATH" +VERSION="$(poetry version -s)" +mkdir -p dist +chmod +x dist/android-file-handler +# explicit filename into dist/ (Debian .deb) +# change directory into dist and package the binary named 'android-file-handler' +# this ensures the package installs /usr/local/bin/android-file-handler (no extra dist/ prefix) + +# Debian +fpm -s dir -t deb -n android-file-handler -v "$VERSION" \ +--architecture amd64 --prefix /usr/local/bin --deb-user root --deb-group root \ +-p "dist/android-file-handler_${VERSION}_amd64.deb" -C dist android-file-handler \ No newline at end of file