Skip to content

Commit

Permalink
Fixing some issues with the Mac build for ent (#48457)
Browse files Browse the repository at this point in the history
* Adding symbolic links in bindir to app bundle binary

* Updating pkg script to support ent better

* Fixing name of teleport-ent bin package

* Fixing some typos in mac install script
  • Loading branch information
doggydogworld authored Nov 5, 2024
1 parent 91003b4 commit 4633c48
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.assets/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ if [[ "${PACKAGE_TYPE}" == "pkg" ]]; then
FILE_LIST="${TAR_PATH}/teleport ${TAR_PATH}/tbot ${TAR_PATH}/fdpass-teleport"
BUNDLE_ID="${b:-com.gravitational.teleport}"
if [[ "${TELEPORT_TYPE}" == "ent" ]]; then
PKG_FILENAME="teleport-ent-${TELEPORT_VERSION}${ARCH_TAG}.${PACKAGE_TYPE}"
PKG_FILENAME="teleport-ent-bin-${TELEPORT_VERSION}${ARCH_TAG}.${PACKAGE_TYPE}"
else
PKG_FILENAME="teleport-bin-${TELEPORT_VERSION}${ARCH_TAG}.${PACKAGE_TYPE}"
fi
Expand Down
2 changes: 1 addition & 1 deletion build.assets/build-pkg-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ or name of the key to sign packages"

# Prepare app shell.
local target="$tmp/root/$PACKAGE_NAME.app"
cp -r "$tmp/teleport/$PACKAGE_NAME.app" "$target"
cp -r "$tmp/teleport$ent/$PACKAGE_NAME.app" "$target"

local entitlements="$buildassets/macos/$TSH_SKELETON/$TSH_SKELETON.entitlements"
if [[ "$PACKAGE_NAME" == "tctl" ]]; then
Expand Down
22 changes: 22 additions & 0 deletions build.assets/macos/install
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ cp -f teleport tbot fdpass-teleport $BINDIR/ || exit 1
cp -rf tsh.app/ "$APPS_DIR"/tsh.app/ || exit 1
cp -rf tctl.app/ "$APPS_DIR"/tctl.app/ || exit 1


# If tsh exists and is not a link, make a backup.
if [ -f "$BINDIR/tsh" ] && [ ! -L "$BINDIR/tsh" ]; then
rm -f "$BINDIR/tsh.bak"
mv "$BINDIR/tsh" "$BINDIR/tsh.bak"
fi

# Link package to $BINDIR.
rm -f "$BINDIR/tsh" # in case link exists
ln -s "$APPS_DIR/tsh.app/Contents/MacOS/tsh" "$BINDIR/tsh"

# If tctl exists and is not a link, make a backup.
if [ -f "$BINDIR/tctl" ] && [ ! -L "$BINDIR/tctl" ]; then
rm -f "$BINDIR/tctl.bak"
mv "$BINDIR/tctl" "$BINDIR/tctl.bak"
fi

# Link package to $BINDIR.
rm -f "$BINDIR/tctl" # in case link exists
ln -s "$APPS_DIR/tctl.app/Contents/MacOS/tctl" "$BINDIR/tctl"


echo "Teleport binaries have been copied to $BINDIR"
echo ""
echo "Thanks for installing Teleport."
Expand Down

0 comments on commit 4633c48

Please sign in to comment.