Generic install script
This commit is contained in:
1 parent
e313b97dc3
commit
5bfd977df5
2 files changed
+21
-8
No files matched your search
@@ -26,16 +26,29 @@ Get libusb-compat-0.1:
|
||||
|
||||
## Building
|
||||
|
||||
> ./install-novacomd-linux.sh
|
||||
Run the build script from the source directory. It picks a compiler and adds `-std=gnu17` when supported:
|
||||
|
||||
To force a specific compiler, set `CC`, for example:
|
||||
> ./install-novacomd.sh
|
||||
|
||||
> CC="gcc -std=gnu17" ./install-novacomd-linux.sh
|
||||
To force a specific compiler, set `CC`:
|
||||
|
||||
To install, copy or symlink `build-novacomd-host/novacomd` to the `/bin` directory of your Palm SDK install (usually `/opt/nova/bin`).
|
||||
> CC="gcc -std=gnu17" ./install-novacomd.sh
|
||||
|
||||
*May not require privilege escalation depending on your install location.*
|
||||
> mv build-novacomd-host/novacomd /YOUR/LOCATION/HERE/
|
||||
The built daemon lands at `build-novacomd-host/novacomd`.
|
||||
|
||||
## Installing
|
||||
|
||||
**Linux** — re-run the script with privilege escalation. It still builds as your normal user, then installs to `/usr/local/bin` (override with `INSTALL_DIR`):
|
||||
|
||||
> sudo ./install-novacomd.sh
|
||||
|
||||
`doas ./install-novacomd.sh` works too.
|
||||
|
||||
**macOS** — build *without* privilege escalation (running the script as root is refused), then copy the binary into your Palm SDK `bin`, usually `/opt/nova/bin`:
|
||||
|
||||
> ./install-novacomd.sh
|
||||
>
|
||||
> sudo cp build-novacomd-host/novacomd /opt/nova/bin/novacomd
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ if (( EUID == 0 )); then
|
||||
if [ -n "$orig_user" ] && [[ "$builder_uid" =~ ^[1-9][0-9]*$ ]] && command -v runuser >/dev/null 2>&1; then
|
||||
builder_prefix=(runuser -u "$orig_user" --)
|
||||
else
|
||||
die "refusing to build as root -- run as a normal user; elevation is only used to install."
|
||||
die "refusing to build as root -- run as a normal user; privilege escalation is only used to install."
|
||||
fi
|
||||
fi
|
||||
as_builder() { "${builder_prefix[@]}" "$@"; }
|
||||
@@ -96,7 +96,7 @@ if (( EUID == 0 )); then
|
||||
[ -f "$dest" ] && [ -x "$dest" ] || die "post-install check failed: $dest"
|
||||
log "installed: $dest"
|
||||
else
|
||||
# Not root: print the manual install command using whichever elevation tool is available.
|
||||
# Not root: print the manual install command using the available privilege escalation tool.
|
||||
if command -v doas >/dev/null 2>&1; then elevate="doas"; else elevate="sudo"; fi
|
||||
log "not running as root -- skipping install."
|
||||
log "to install: $elevate install -T -m 0755 '$src_dir/$BUILD_BIN' '$INSTALL_DIR/$TARGET'"
|
||||
Reference in new issue
Block a user