diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-05-23 14:50:05 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-05-23 14:50:05 +0530 |
| commit | ed1837534a0a9a1ab8f8291cff73be031a5d493b (patch) | |
| tree | fbfb92615dcbbd250e7529c7afc00066fc72ef13 /linux/deb/01-fs-hello-kamal/build.sh | |
| parent | fe8b0606b434bb17f870cf9e6ba473c2ef39ca1f (diff) | |
Dir rename
Diffstat (limited to 'linux/deb/01-fs-hello-kamal/build.sh')
| -rwxr-xr-x | linux/deb/01-fs-hello-kamal/build.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/linux/deb/01-fs-hello-kamal/build.sh b/linux/deb/01-fs-hello-kamal/build.sh new file mode 100755 index 0000000..bc77f92 --- /dev/null +++ b/linux/deb/01-fs-hello-kamal/build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Define a function that sends messages to stderr. +errcho() { + echo "$@" 1>&2; +} + +# Check if fakeroot command is available +if ! command -v fakeroot > /dev/null 2>&1; then + errcho "[ERROR] fakeroot command not found. Install the fakeroot package."; + exit 1 +fi + +# Check if dpkg-deb command is available +if ! command -v dpkg-deb > /dev/null 2>&1; then + errcho "[ERROR] dpkg-deb command not found. dpkg package contains it. Are you not running this script on a Debian based system?"; + exit 1 +fi + +# Get the directory of this script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Remove the deb files found inside DIR. Prompt the user before deleting. +if ls $DIR/*.deb 1> /dev/null 2>&1; then + rm -i $DIR/*.deb +fi + +# Build the deb package +fakeroot dpkg-deb --build $DIR/package $DIR |
