diff --git a/build.assets/build-package.sh b/build.assets/build-package.sh index 3930950043a98..56274d0a1dee8 100755 --- a/build.assets/build-package.sh +++ b/build.assets/build-package.sh @@ -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 diff --git a/build.assets/build-pkg-app.sh b/build.assets/build-pkg-app.sh index cf6e8b0493908..76e142165f95a 100755 --- a/build.assets/build-pkg-app.sh +++ b/build.assets/build-pkg-app.sh @@ -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 diff --git a/build.assets/macos/install b/build.assets/macos/install index ce8db0ac3442b..d97ed78c7d8f3 100755 --- a/build.assets/macos/install +++ b/build.assets/macos/install @@ -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."