2011-05-21 00:50:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2011-05-22 00:43:13 +02:00
|
|
|
# the following environment variables must be set
|
|
|
|
: ${ROOT_DIR?} ${BUILD_DIR?} ${RELEASE_LBL?} ${RELEASE_DIR?} ${FW_DIR?}
|
|
|
|
|
|
|
|
# more variables
|
|
|
|
APP_PATH="${BUILD_DIR}/ground/openpilotgcs/bin/OpenPilot GCS.app"
|
|
|
|
TEMP_FILE="${RELEASE_DIR}/OpenPilot-temp.dmg"
|
|
|
|
OUT_FILE="${RELEASE_DIR}/OpenPilot-${RELEASE_LBL}.dmg"
|
|
|
|
VOL_NAME="OpenPilot"
|
|
|
|
|
|
|
|
# prepare the stage
|
|
|
|
rm -f "${TEMP_FILE}"
|
|
|
|
rm -f "${OUT_FILE}"
|
|
|
|
|
|
|
|
hdiutil convert "${ROOT_DIR}/release/osx/OpenPilot.dmg" \
|
|
|
|
-format UDRW -o "${TEMP_FILE}"
|
|
|
|
device=$(hdiutil attach "${TEMP_FILE}" | \
|
2011-05-21 00:50:50 +02:00
|
|
|
egrep '^/dev/' | sed 1q | awk '{print $1}')
|
|
|
|
|
|
|
|
# packaging goes here
|
|
|
|
cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}"
|
2011-05-22 00:43:13 +02:00
|
|
|
cp -r "${FW_DIR}" "/Volumes/${VOL_NAME}/firmware"
|
2011-05-21 00:50:50 +02:00
|
|
|
|
2011-05-22 00:43:13 +02:00
|
|
|
"${ROOT_DIR}/release/osx/libraries" \
|
|
|
|
"/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1
|
2011-05-21 18:08:00 +02:00
|
|
|
|
2011-05-21 00:50:50 +02:00
|
|
|
hdiutil detach ${device}
|
2011-05-22 00:43:13 +02:00
|
|
|
hdiutil convert "${TEMP_FILE}" -format UDZO -o "${OUT_FILE}"
|
2011-05-21 00:50:50 +02:00
|
|
|
|
2011-05-22 00:43:13 +02:00
|
|
|
# cleanup
|
|
|
|
rm "${TEMP_FILE}"
|