Changeset 11013 in ntrip for trunk/BNC/scripts
- Timestamp:
- Sep 10, 2026, 11:48:43 AM (6 hours ago)
- File:
-
- 1 edited
-
trunk/BNC/scripts/mac_package.sh (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/scripts/mac_package.sh
r11012 r11013 11 11 # - optionally signs with a real "Developer ID Application" 12 12 # identity if CODESIGN_IDENTITY is set in the environment 13 # - packages the result as a zip (via ditto, which preservesthe14 # code signature - plain `zip`/tar can corrupt it)13 # - packages the result as a dmg (drag-to-Applications, the 14 # expected format for external users) and/or a zip 15 15 # 16 # Usage: scripts/mac_package.sh [path/to/bnc.app] 16 # Usage: scripts/mac_package.sh [--format dmg|zip|both] [path/to/bnc.app] 17 17 # CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)" \ 18 18 # scripts/mac_package.sh … … 33 33 fi 34 34 35 APP_PATH="${1:-bnc.app}" 35 FORMAT="dmg" 36 APP_PATH="" 37 while [[ $# -gt 0 ]]; do 38 case "$1" in 39 --format) 40 FORMAT="$2" 41 shift 2 42 ;; 43 *) 44 APP_PATH="$1" 45 shift 46 ;; 47 esac 48 done 49 case "$FORMAT" in 50 dmg|zip|both) ;; 51 *) echo "error: --format must be dmg, zip, or both (got '$FORMAT')" >&2; exit 1 ;; 52 esac 53 54 APP_PATH="${APP_PATH:-bnc.app}" 36 55 if [[ ! -d "$APP_PATH" ]]; then 37 56 # fall back to the usual qmake output location (src.pro: TARGET = ../bnc) … … 45 64 fi 46 65 APP_PATH="$(cd "$(dirname "$APP_PATH")" && pwd)/$(basename "$APP_PATH")" 66 APP_NAME="$(basename "$APP_PATH" .app)" 47 67 48 68 command -v macdeployqt >/dev/null 2>&1 || { … … 58 78 codesign --force --deep --options runtime --sign "$CODESIGN_IDENTITY" "$APP_PATH" 59 79 echo " (remember to notarize + staple for Gatekeeper-clean distribution:" 60 echo " xcrun notarytool submit <zip> --keychain-profile <profile> --wait" 80 echo " xcrun notarytool submit <dmg-or-zip> --keychain-profile <profile> --wait" 61 81 echo " xcrun stapler staple \"$APP_PATH\")" 62 82 else … … 68 88 codesign --verify --deep --strict --verbose=2 "$APP_PATH" 69 89 70 ZIP_PATH="${APP_PATH%.app}.zip" 71 echo "== packaging $ZIP_PATH ==" 72 rm -f "$ZIP_PATH" 73 ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH" 90 if [[ "$FORMAT" == "zip" || "$FORMAT" == "both" ]]; then 91 ZIP_PATH="${APP_PATH%.app}.zip" 92 echo "== packaging $ZIP_PATH ==" 93 rm -f "$ZIP_PATH" 94 # ditto preserves the code signature; plain zip/tar can corrupt it 95 ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH" 96 echo "Done: $ZIP_PATH" 97 fi 98 99 if [[ "$FORMAT" == "dmg" || "$FORMAT" == "both" ]]; then 100 DMG_PATH="${APP_PATH%.app}.dmg" 101 echo "== packaging $DMG_PATH ==" 102 rm -f "$DMG_PATH" 103 STAGING_DIR="$(mktemp -d)" 104 trap 'rm -rf "$STAGING_DIR"' EXIT 105 ditto "$APP_PATH" "$STAGING_DIR/$APP_NAME.app" 106 ln -s /Applications "$STAGING_DIR/Applications" 107 hdiutil create -volname "$APP_NAME" -srcfolder "$STAGING_DIR" -ov -format UDZO "$DMG_PATH" 108 echo "Done: $DMG_PATH" 109 fi 74 110 75 111 echo 76 echo "Done: $ZIP_PATH"77 112 echo "Recipients of an unsigned/ad-hoc build must bypass Gatekeeper once:" 78 113 echo " - right-click the app -> Open -> confirm, or" 79 echo " - run: xattr -cr \"$ (basename "$APP_PATH")\" after unzipping"114 echo " - run: xattr -cr \"$APP_NAME.app\" after mounting/unzipping"
Note:
See TracChangeset
for help on using the changeset viewer.
