steamguard-cli/package.sh

34 lines
992 B
Bash
Raw Normal View History

2016-08-24 18:45:48 +02:00
#!/bin/bash
2021-08-20 18:17:59 +02:00
BIN_PATH="target/steamguard-cli"
if [[ ! -f "${BIN_PATH}" ]]; then
echo "ERROR: Could not find release binaries, building them..."
cargo build --release
fi
VERSION=$("$BIN_PATH" --version | cut -d " " -f 2)"-0"
2016-08-24 18:45:48 +02:00
TEMP_PKG_PATH="/tmp/steamguard-cli_$VERSION"
2021-08-20 18:17:59 +02:00
echo "Building Debian package for v$VERSION..."
2016-08-24 18:45:48 +02:00
2021-08-20 18:17:59 +02:00
mkdir -p "$TEMP_PKG_PATH/usr/local/bin"
mkdir -p "$TEMP_PKG_PATH/etc/bash_completion.d"
mkdir -p "$TEMP_PKG_PATH/DEBIAN"
2016-08-24 18:45:48 +02:00
2021-08-20 18:17:59 +02:00
cp "$BIN_PATH" "$TEMP_PKG_PATH/usr/local/bin/steamguard"
"$BIN_PATH" completion --shell bash > "$TEMP_PKG_PATH/etc/bash_completion.d/steamguard"
2016-08-24 18:45:48 +02:00
cat <<EOT >> $TEMP_PKG_PATH/DEBIAN/control
Package: steamguard-cli
2021-08-20 18:17:59 +02:00
Depends:
2016-08-24 18:45:48 +02:00
Version: $VERSION
Section: base
Priority: optional
Architecture: all
2021-08-20 18:17:59 +02:00
Maintainer: Carson McManus <carson.mcmanus1@gmail.com>
2016-08-24 18:45:48 +02:00
Description: steamguard-cli
2021-08-20 18:17:59 +02:00
A command line utility to generate Steam 2FA codes and respond to confirmations.
2016-08-24 18:45:48 +02:00
EOT
2021-08-20 18:17:59 +02:00
dpkg-deb --build "$TEMP_PKG_PATH" "steamguard-cli_$VERSION.deb"
2016-08-24 18:45:48 +02:00
2021-08-20 18:17:59 +02:00
rm -rf "$TEMP_PKG_PATH"