Changeset eed80117 for launchers/macosx/osx_create_dmg.sh
- Timestamp:
- Oct 13, 2018 4:06:44 AM (2 years ago)
- Branches:
- master
- Children:
- e326011
- Parents:
- f8fb4a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
launchers/macosx/osx_create_dmg.sh
rf8fb4a6 reed80117 2 2 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 3 3 4 ..sign-secrets4 source $DIR/.sign-secrets 5 5 6 6 APP_NAME="I2PLauncher" 7 VERSION="0.9.3 6"8 DMG_BACKGROUND_IMG= "${DIR}/Background.png"7 VERSION="0.9.37" 8 DMG_BACKGROUND_IMG=${BACKGROUND_IMG:-"Background.png"} 9 9 10 10 APP_EXE="${APP_NAME}.app/Contents/MacOS/${APP_NAME}" 11 VOL_NAME="${APP_NAME} 11 VOL_NAME="${APP_NAME}-${VERSION}" 12 12 DMG_TMP="${VOL_NAME}-temp.dmg" 13 13 DMG_FINAL="${VOL_NAME}.dmg" … … 24 24 _DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}" 25 25 26 sips -s dpiWidth 72 -s dpiHeight 72 $ {DMG_BACKGROUND_IMG} --out${_DMG_BACKGROUND_TMP}26 sips -s dpiWidth 72 -s dpiHeight 72 $DIR/${DMG_BACKGROUND_IMG} --out $DIR/${_DMG_BACKGROUND_TMP} 27 27 28 DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}" 28 29 DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}" 29 30 fi 30 31 # clear out any old data32 rm -rf "${STAGING_DIR}" "${DMG_TMP}" "${DMG_FINAL}"33 31 34 32 # copy over the stuff we want in the final disk image to our staging dir … … 40 38 # assumes our contents are at least 1M! 41 39 SIZE=`du -sh "${STAGING_DIR}" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'` 42 SIZE=`echo "${SIZE} + 1.0" | bc | awk '{print int($1+0.5)}'`40 SIZE=`echo "${SIZE} + 23.0" | bc | awk '{print int($1+0.5)}'` 43 41 44 42 if [ $? -ne 0 ]; then … … 49 47 # create the temp DMG file 50 48 hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \ 51 -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "$ {DMG_TMP}"49 -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "$RELEASE_DIR/${DMG_TMP}" 52 50 53 51 echo "Created DMG: ${DMG_TMP}" 54 52 55 53 # mount it and save the device 56 DEVICE=$(hdiutil attach -readwrite -noverify "$ {DMG_TMP}" | \54 DEVICE=$(hdiutil attach -readwrite -noverify "$RELEASE_DIR/${DMG_TMP}" | \ 57 55 egrep '^/dev/' | sed 1q | awk '{print $1}') 58 56 59 57 sleep 2 60 58 59 60 61 61 # add a link to the Applications dir 62 62 echo "Add link to /Applications" 63 pushd /Volumes/"${VOL_NAME}"64 ln -s /Applications63 cd /Volumes/"${VOL_NAME}" 64 ln -sf /Applications Applications 65 65 66 66 # add a background image 67 mkdir /Volumes/"${VOL_NAME}"/.background 68 cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/ 67 mkdir -p /Volumes/"${VOL_NAME}"/.background 68 cp "$DIR/`basename ${DMG_BACKGROUND_IMG}`" /Volumes/"${VOL_NAME}"/.background/`basename ${DMG_BACKGROUND_IMG}` 69 70 cd $RELEASE_DIR 69 71 70 72 # tell the Finder to resize the window, set the background, … … 99 101 # now make the final image a compressed disk image 100 102 echo "Creating compressed image" 101 hdiutil convert "$ {DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FINAL}"103 hdiutil convert "$RELEASE_DIR/${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "$RELEASE_DIR/${DMG_FINAL}" 102 104 103 codesign --force -- sign "${APPLE_CODE_SIGNER_ID}" "${DMG_FINAL}"105 codesign --force --deep --sign "${APPLE_CODE_SIGNER_ID}" "$RELEASE_DIR/${DMG_FINAL}" 104 106 105 107 # clean up 106 rm -rf "$ {DMG_TMP}"108 rm -rf "$RELEASE_DIR/${DMG_TMP}" 107 109 rm -rf "${STAGING_DIR}" 110 108 111 109 112 echo 'Done.'
Note: See TracChangeset
for help on using the changeset viewer.