# http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix
# http://developer.apple.com/documentation/developertools/Conceptual/SoftwareDistribution/Concepts/sd_disk_images.html
-def makedmg(app_dir):
+def makedmg(dirlist, volname):
# need to detect what the real volume name is
- mussa_mount = '/Volumes/Mussa'
- mussarw_dmg = 'mussarw.dmg'
- mussa_dmg = 'mussa.dmg'
+ mussa_mount = '/Volumes/%s' %(volname)
+ mussarw_dmg = '%sw.dmg' %(volname)
+ mussa_dmg = '%s.dmg' %(volname)
system('hdiutil detach '+mussa_mount)
if os.path.exists(mussa_mount):
print >>sys.stderr, "Something is in", mussa_mount
os.unlink(mussarw_dmg)
if os.path.exists(mussa_dmg):
os.unlink(mussa_dmg)
- system('hdiutil create -size 64m -fs HFS+ -volname "Mussa" '+mussarw_dmg)
+ system('hdiutil create -size 64m -fs HFS+ -volname "%s" %s'%(volname, mussarw_dmg))
system('hdiutil attach '+mussarw_dmg)
# copy files
- copytree(app_dir, os.path.join(mussa_mount, app_dir))
+ for d in dirlist:
+ copytree(d, os.path.join(mussa_mount, d))
system('hdiutil detach '+mussa_mount)
system('hdiutil convert '+mussarw_dmg +' -format UDZO -o '+mussa_dmg)
contents_exe_path %= ({'framework': frame2})
system("install_name_tool -change "+qtframe2+" "+contents_exe_path+" "+
appframe)
- makedmg(app_dir)
+ makedmg([app_dir], 'mussa')
if __name__ == "__main__":
main(sys.argv[1:])