yubioath-flutter/build-ykman.sh

37 lines
752 B
Bash
Raw Normal View History

2021-11-19 11:08:04 +03:00
#!/bin/sh
#
# This script creates a pyinstaller build of yubikey-manager from the submodule in this repository.
#
set -e
case "$(uname)" in
Darwin*)
OS="macos";;
Linux*)
OS="linux";;
MINGW*)
OS="windows";;
esac
2022-02-10 15:36:38 +03:00
echo "Building ykman-rpc for $OS..."
2021-11-19 11:08:04 +03:00
OUTPUT="build/$OS"
2022-02-10 15:36:38 +03:00
cd ykman-rpc
2021-11-19 11:08:04 +03:00
poetry install
2022-02-10 15:36:38 +03:00
rm -rf ../$OUTPUT/ykman-rpc
poetry run pyinstaller ykman-rpc.spec --distpath ../$OUTPUT
2021-11-19 11:08:04 +03:00
cd ..
# Fixup permissions (should probably be more strict)
2022-02-10 15:36:38 +03:00
find $OUTPUT/ykman-rpc -type f -exec chmod a-x {} +
chmod a+x $OUTPUT/ykman-rpc/ykman-rpc
2021-11-19 11:08:04 +03:00
# Adhoc sign executable (MacOS)
if [ "$OS" = "macos" ]; then
2022-02-10 15:36:38 +03:00
codesign -f --timestamp --entitlements macos/ykman.entitlements --sign - $OUTPUT/ykman-rpc/ykman-rpc
2021-11-19 11:08:04 +03:00
fi
echo "All done, output in $OUTPUT/"