root/oggzcap/buildmac.sh

Revision d172f177ff9e7ff75ed885b94cfbdeb9ccf34094, 2.1 kB (checked in by Robin Gareus <rgareus@…>, 11 months ago)

oggZcap: GUI, xcode and supportfiles

  • Property mode set to 100644
Line 
1#!/bin/sh
2
3if [ -n "$1" ];then
4  UPLOAD=true
5fi
6CLEAN=true
7
8VERSION=3.0
9DMGFILE=/tmp/oggzcap-$VERSION.dmg
10echo $DMGFILE
11
12BUILD=build/Release/OggZCap.app
13VOLNAME=OggZCap
14APPNAME=OggZCap.app
15BGPIC=./dmgbg.png
16
17TMPFILE=/tmp/ogztmp.dmg
18MNTPATH=/tmp/mnt/
19
20#####
21
22if [ -n "$CLEAN" ]; then
23xcodebuild clean || exit
24fi
25xcodebuild ||exit
26
27#####
28
29#roll a DMG
30
31mkdir -p $MNTPATH
32if [ -e $TMPFILE -o -e $DMGFILE -o ! -d $MNTPATH ]; then
33  echo "could not make DMG. (file exists?!)"
34  exit;
35fi
36
37hdiutil create -megabytes 200 $TMPFILE
38DiskDevice=$(hdid -nomount "${TMPFILE}" | grep Apple_HFS | cut -f 1 -d ' ')
39newfs_hfs -v "${VOLNAME}" "${DiskDevice}"
40
41mount -t hfs "${DiskDevice}" "${MNTPATH}"
42
43cp -r ${BUILD} ${MNTPATH}/
44mkdir ${MNTPATH}/.background
45BGFILE=$(basename $BGPIC)
46cp -vi ${BGPIC} ${MNTPATH}/.background/${BGFILE}
47#ln -s /Applications ${MNTPATH}/Applications
48
49echo '
50   tell application "Finder"
51     tell disk "'${VOLNAME}'"
52           open
53           set current view of container window to icon view
54           set toolbar visible of container window to false
55           set statusbar visible of container window to false
56           set the bounds of container window to {400, 200, 800, 425}
57           set theViewOptions to the icon view options of container window
58           set arrangement of theViewOptions to not arranged
59           set icon size of theViewOptions to 64
60           set background picture of theViewOptions to file ".background:'${BGFILE}'"
61           make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
62           set position of item "'${APPNAME}'" of container window to {100, 100}
63           set position of item "Applications" of container window to {310, 100}
64           close
65           open
66           update without registering applications
67           delay 3
68           eject
69     end tell
70   end tell
71' | osascript
72
73# Umount the image
74umount "${DiskDevice}"
75hdiutil eject "${DiskDevice}"
76
77# Create a read-only version, use zlib compression
78hdiutil convert -format UDZO "${TMPFILE}" -imagekey zlib-level=9 -o "${DMGFILE}"
79
80# Delete the temporary files
81rm $TMPFILE
82rmdir $MNTPATH
83
84if [ -n "$UPLOAD" ];then
85  scp $DMGFILE rg42.org:/var/sites/inout/docroot/software/
86fi
Note: See TracBrowser for help on using the browser.