1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
LibrePilot/release/osx/package

32 lines
898 B
Bash
Executable File

#!/bin/bash
OP_BASE=~/Documents/Programming/OpenPilot
RELEASE_NAME=20110519-460cc1ad
REL_DIR=${OP_BASE}/build/release-${RELEASE_NAME}
TEMP_FILE=${REL_DIR}/OpenPilot-temp.dmg
OUT_FILE=${REL_DIR}/OpenPilot-${RELEASE_NAME}.dmg
VOL_NAME=OpenPilot
APP_PATH=${OP_BASE}/build/ground/openpilotgcs/bin/OpenPilot\ GCS.app
FW_PATH="${OP_BASE}/build/release-${RELEASE_NAME}/firmware-${RELEASE_NAME}"
rm ${TEMP_FILE}
rm ${OUT_FILE}
hdiutil convert "${OP_BASE}/release/osx/OpenPilot.dmg" -format UDRW -o "${TEMP_FILE}"
device=$(hdiutil attach ${TEMP_FILE} | \
egrep '^/dev/' | sed 1q | awk '{print $1}')
# packaging goes here
cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}"
cp -r "${FW_PATH}" "/Volumes/${VOL_NAME}/firmware"
${OP_BASE}/release/osx/libraries "/Volumes/${VOL_NAME}/OpenPilot GCS.app"
hdiutil detach ${device}
hdiutil convert ${TEMP_FILE} -format UDZO -o ${OUT_FILE}
rm ${TEMP_FILE}