Created
July 10, 2012 17:47
-
-
Save jamesez/3085058 to your computer and use it in GitHub Desktop.
Build Chrome dmg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# Mount disk image on temp space | |
mountpoint=`hdiutil attach -mountrandom /tmp -nobrowse googlechrome.dmg | awk '/private\/tmp/ { print $3 } '` | |
echo Mounted on $mountpoint | |
# Determine version number | |
version=`defaults read "$mountpoint/Google Chrome.app/Contents/Info.plist" CFBundleShortVersionString` | |
echo Google Chrome version $version | |
# unmount | |
hdiutil detach $mountpoint | |
# Set up variables | |
dmg=Google-Chrome-$version.dmg | |
plist=Google-Chrome-$version.plist | |
plistbase=`basename $plist .plist` | |
# Rename disk image | |
mv googlechrome.dmg $dmg | |
# Build pkginfo | |
/usr/local/munki/makepkginfo -m go-w -g admin -o root $dmg > $plist | |
defaults write "`pwd`/$plistbase" installer_item_location "jenkins/$dmg" | |
defaults write "`pwd`/$plistbase" minimum_os_version "10.7.0" | |
defaults write "`pwd`/$plistbase" uninstallable -bool NO | |
/usr/bin/plutil -convert xml1 $plist | |
chmod a+r $plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment