Commit 70f51d77 authored by Jody Garnett's avatar Jody Garnett
Browse files

Merge pull request #1207 from dmkelsey/dk-osx-build-fix

Fixes so that GeoServer can be packaged for OS X
parents abe6f971 ba69cce0
......@@ -27,98 +27,22 @@ fi
# download and ready the artifacts
setup_artifacts $tag mac
pushd tmp > /dev/null
# Setup_artifacts extracts everything to tmp/
# Those resources are not needed.
rm -fr tmp/*
# copy geoserver binary over
mv geoserver-$tag/* $res
rmdir geoserver-$tag
# Note: the '-mac' directory name is important for the '' and 'build.xml' to succeed.
# The build uses a regex to determine and set a variable.
unzip -d tmp/geoserver-$tag-mac files/geoserver-$
cp files/geoserver-$ tmp/geoserver-$tag-mac/
# build the console app
pushd console > /dev/null
mvn clean install
cp target/console*.jar ../$res/console.jar
popd > /dev/null
# unmount existing mounts
if [ -d "/Volumes/${vol}" ]; then
umount "/Volumes/${vol}"
# build the dmg volume
set +e && rm *.dmg && set -e
hdiutil create \
-srcfolder ${app} \
-volname "${vol}" \
-fs HFS+ \
-fsargs "-c c=64,a=16,e=16" \
-format UDRW \
# mount the dmg
sleep 2
device=$(hdiutil attach -readwrite -noverify -noautoopen "${dmg_tmp}" | egrep '^/dev/' | sed 1q | awk '{print $1}')
sleep 5
echo "DEVICE: ${device}"
# copy the background image in
mkdir "/Volumes/${vol}/.background"
cp ${dmg_back} "/Volumes/${vol}/.background/"
# create an alias to Applications
ln -sf /Applications /Volumes/${vol}/Applications
# dmg window dimensions
dmg_bottomright_x=`expr $dmg_topleft_x + $dmg_width`
dmg_bottomright_y=`expr $dmg_topleft_y + $dmg_height`
# Set the background image and icon location
echo '
tell application "Finder"
tell disk "'${vol}'"
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {'${dmg_topleft_x}', '${dmg_topleft_y}', '${dmg_bottomright_x}', '${dmg_bottomright_y}'}
set theViewOptions to the icon view options of container window
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 104
set background picture of theViewOptions to file ".background:'${dmg_back}'"
set position of item "'${app}'" of container window to {120, 180}
set position of item "'Applications'" of container window to {400, 180}
update without registering applications
delay 5
delay 5
end tell
end tell
' | osascript
# convert to compressed image, delete temp image
hdiutil convert "${dmg_tmp}" -format UDZO -imagekey zlib-level=9 -o "${dmg_final}"
if [ -f "${dmg_tmp}" ]; then
rm -f "${dmg_tmp}"
pushd tmp/geoserver-$tag-mac/ > /dev/null
# upload dmg to final location
upload_installer $tag geoserver-$tag.dmg
popd > /dev/null
#popd > /dev/null
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment