29 lines
1.3 KiB
Shell
29 lines
1.3 KiB
Shell
|
|
#!/bin/sh
|
||
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
||
|
|
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||
|
|
# make-bin-tarball.sh — bundle the cross-compiled fingerprintd binary and its
|
||
|
|
# runtime files into the source tarball APKBUILD consumes. Run from the repo
|
||
|
|
# root after a cross build; output lands in the current directory.
|
||
|
|
set -eu
|
||
|
|
|
||
|
|
VER="${1:-$(sed -n 's/.*char\* Version = "\(.*\)".*/\1/p' implementations/main.cpp)}"
|
||
|
|
[ -n "$VER" ] || { echo "could not determine version — pass it as \$1" >&2; exit 1; }
|
||
|
|
BIN=$(ls -t bin/fingerprintd-aarch64-*/fingerprintd 2>/dev/null | head -n1)
|
||
|
|
[ -n "$BIN" ] || { echo "no aarch64 fingerprintd build found — cross-compile first" >&2; exit 1; }
|
||
|
|
|
||
|
|
stage=$(mktemp -d)
|
||
|
|
trap 'rm -rf "$stage"' EXIT
|
||
|
|
mkdir "$stage/fingerprintd-$VER"
|
||
|
|
cp "$BIN" "$stage/fingerprintd-$VER/fingerprintd"
|
||
|
|
cp packaging/fingerprintd.service \
|
||
|
|
packaging/mnt-persist.mount \
|
||
|
|
packaging/80-fingerprintd.preset \
|
||
|
|
packaging/net.reactivated.Fprint.conf \
|
||
|
|
packaging/net.reactivated.Fprint.service \
|
||
|
|
packaging/net.reactivated.fprint.device.policy \
|
||
|
|
packaging/fingerprintd.tmpfiles.conf \
|
||
|
|
packaging/fingerprintd.modules-load.conf \
|
||
|
|
packaging/fingerprintd.json \
|
||
|
|
"$stage/fingerprintd-$VER/"
|
||
|
|
tar -C "$stage" -czf "fingerprintd-$VER.tar.gz" "fingerprintd-$VER"
|
||
|
|
echo "wrote fingerprintd-$VER.tar.gz ($(du -h "fingerprintd-$VER.tar.gz" | cut -f1))"
|