43 lines
1.4 KiB
Bash
43 lines
1.4 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# Build the project and pack it into a .deb using the standard Debian
|
|
# toolchain (debhelper). Run this on a Debian-family system, e.g. Debian,
|
|
# Ubuntu, or in WSL2 / a Docker container:
|
|
#
|
|
# sudo apt install build-essential cmake debhelper
|
|
# ./build-deb.sh
|
|
#
|
|
# The resulting package lands in ./dist/ and can be installed with:
|
|
# sudo apt install ./dist/hatsune-miku-shoshitsu_*.deb
|
|
#
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
# --- sanity checks ---------------------------------------------------------
|
|
for tool in dpkg-buildpackage dpkg-deb cmake; do
|
|
command -v "$tool" >/dev/null 2>&1 || {
|
|
echo "error: '$tool' not found." >&2
|
|
echo " Install the build tools first:" >&2
|
|
echo " sudo apt install build-essential cmake debhelper" >&2
|
|
exit 1
|
|
}
|
|
done
|
|
|
|
# --- build the binary .deb -------------------------------------------------
|
|
# -us don't sign the source
|
|
# -uc don't sign the .changes file
|
|
# -b build a binary package only (no upstream source tarball needed)
|
|
# -d don't verify Build-Depends (we check the tools ourselves)
|
|
#
|
|
# dpkg-buildpackage writes the .deb into the PARENT directory.
|
|
dpkg-buildpackage -us -uc -b -d
|
|
|
|
# --- collect the artifacts into ./dist --------------------------------------
|
|
mkdir -p dist
|
|
mv -f ../hatsune-miku-shoshitsu_*.deb dist/ 2>/dev/null || true
|
|
mv -f ../hatsune-miku-shoshitsu_*.changes dist/ 2>/dev/null || true
|
|
|
|
echo
|
|
echo "Done. Debian package built:"
|
|
ls -lh dist/*.deb
|