From 18d729beeedde739c8372cea3086bd4592a5256f Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Fri, 19 Nov 2021 09:08:04 +0100 Subject: [PATCH] Add rpc submodule. --- .gitmodules | 3 +++ build-ykman.bat | 16 ++++++++++++++++ build-ykman.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ yubikey-manager | 1 + 4 files changed, 62 insertions(+) create mode 100644 .gitmodules create mode 100644 build-ykman.bat create mode 100755 build-ykman.sh create mode 160000 yubikey-manager diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..6097639f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "yubikey-manager"] + path = yubikey-manager + url = https://github.com/Yubico/yubikey-manager diff --git a/build-ykman.bat b/build-ykman.bat new file mode 100644 index 00000000..ee196f4a --- /dev/null +++ b/build-ykman.bat @@ -0,0 +1,16 @@ +@echo off + +REM Make sure the submodule is cloned, but if it already is, don't reset it. +( dir /b /a "yubikey-manager" | findstr . ) > nul || ( + git submodule init + git submodule update +) + +echo Building ykman CLI for Windows... +cd yubikey-manager +poetry install +rmdir /s /q ..\build\windows\ykman +poetry run pyinstaller ykman.spec --distpath ..\build\windows +cd .. + +echo All done, output in build/windows/ diff --git a/build-ykman.sh b/build-ykman.sh new file mode 100755 index 00000000..68456a0c --- /dev/null +++ b/build-ykman.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# +# This script creates a pyinstaller build of yubikey-manager from the submodule in this repository. +# + +set -e + +# Make sure the submodule is cloned, but if it already is, don't reset it. +if ! [ "$(ls yubikey-manager)" ]; then + git submodule init + git submodule update +fi + +case "$(uname)" in + Darwin*) + OS="macos";; + Linux*) + OS="linux";; + MINGW*) + OS="windows";; +esac + +echo "Building ykman CLI for $OS..." +OUTPUT="build/$OS" + +cd yubikey-manager +poetry install +rm -rf ../$OUTPUT/ykman +poetry run pyinstaller ykman.spec --distpath ../$OUTPUT +cd .. + +# Fixup permissions (should probably be more strict) +find $OUTPUT/ykman -type f -exec chmod a-x {} + +chmod a+x $OUTPUT/ykman/ykman + +# Adhoc sign executable (MacOS) +if [ "$OS" = "macos" ]; then + codesign -f --timestamp --entitlements macos/ykman.entitlements --sign - $OUTPUT/ykman/ykman +fi + +echo "All done, output in $OUTPUT/" diff --git a/yubikey-manager b/yubikey-manager new file mode 160000 index 00000000..739f3122 --- /dev/null +++ b/yubikey-manager @@ -0,0 +1 @@ +Subproject commit 739f3122a43adfcd2549374bc4cd11e88a483a8d