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-05-06 11:18:46 +03:00
|
|
|
echo "Building authenticator-helper for $OS..."
|
2021-11-19 11:08:04 +03:00
|
|
|
OUTPUT="build/$OS"
|
|
|
|
|
2022-05-06 11:18:46 +03:00
|
|
|
cd helper
|
2021-11-19 11:08:04 +03:00
|
|
|
poetry install
|
2022-05-06 11:18:46 +03:00
|
|
|
rm -rf ../$OUTPUT/helper
|
|
|
|
poetry run pyinstaller authenticator-helper.spec --distpath ../$OUTPUT
|
2021-11-19 11:08:04 +03:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Fixup permissions (should probably be more strict)
|
2022-05-06 11:18:46 +03:00
|
|
|
find $OUTPUT/helper -type f -exec chmod a-x {} +
|
|
|
|
chmod a+x $OUTPUT/helper/authenticator-helper
|
2021-11-19 11:08:04 +03:00
|
|
|
|
|
|
|
# Adhoc sign executable (MacOS)
|
|
|
|
if [ "$OS" = "macos" ]; then
|
2022-05-06 11:18:46 +03:00
|
|
|
codesign -f --timestamp --entitlements macos/helper.entitlements --sign - $OUTPUT/helper/authenticator-helper
|
2021-11-19 11:08:04 +03:00
|
|
|
fi
|
|
|
|
|
2022-06-05 20:22:00 +03:00
|
|
|
echo "Generating license files..."
|
|
|
|
cd helper
|
|
|
|
poetry build
|
|
|
|
VENV="../$OUTPUT/helper-license-venv"
|
|
|
|
rm -rf $VENV
|
|
|
|
poetry run python -m venv $VENV
|
2022-06-07 14:04:05 +03:00
|
|
|
$VENV/bin/pip install --upgrade pip wheel
|
2022-06-05 20:22:00 +03:00
|
|
|
$VENV/bin/pip install dist/authenticator_helper-0.1.0-py3-none-any.whl pip-licenses
|
2022-10-25 17:08:52 +03:00
|
|
|
$VENV/bin/pip-licenses --format=json --no-license-path --with-license-file --ignore-packages authenticator-helper zxing-cpp --output-file ../assets/licenses/helper.json
|
2022-06-05 20:22:00 +03:00
|
|
|
cd ..
|
|
|
|
|
2021-11-19 11:08:04 +03:00
|
|
|
echo "All done, output in $OUTPUT/"
|