Skip to content

Commit

Permalink
Builder|OS X: Use command line tools to create installer package
Browse files Browse the repository at this point in the history
PackageMaker is obsolete nowadays, the command line tools pkgbuild
and productbuild are supposed to be used instead.
  • Loading branch information
skyjake committed May 24, 2014
1 parent 25b42e4 commit f47aa1f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
24 changes: 24 additions & 0 deletions distrib/macx/Distribution.xml.in
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>Doomsday Engine</title>
<background file="background.png" mime-type="image/png" />
<readme file="Read Me.rtf" mime-type="text/rtf" />
<pkg-ref id="net.dengine.doomsday.frontend.pkg"/>
<pkg-ref id="net.dengine.doomsday.shell.pkg"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="net.dengine.doomsday.frontend.pkg"/>
<line choice="net.dengine.doomsday.shell.pkg"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="net.dengine.doomsday.frontend.pkg" visible="false">
<pkg-ref id="net.dengine.doomsday.frontend.pkg"/>
</choice>
<pkg-ref id="net.dengine.doomsday.frontend.pkg" version="${Version}" onConclusion="none">Frontend.pkg</pkg-ref>
<choice id="net.dengine.doomsday.shell.pkg" visible="false">
<pkg-ref id="net.dengine.doomsday.shell.pkg"/>
</choice>
<pkg-ref id="net.dengine.doomsday.shell.pkg" version="${Version}" onConclusion="none">Shell.pkg</pkg-ref>
</installer-gui-script>
Binary file added distrib/macx/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 23 additions & 4 deletions distrib/platform_release.py
Expand Up @@ -297,9 +297,28 @@ def fw_codesign(app):
templateFile, output_filename('_apps-' + mac_osx_suffix() + '.dmg')))
remove(templateFile)

print 'Creating disk:', target
os.system('osascript /Users/jaakko/Dropbox/Doomsday/package-installer.applescript')
# Package the apps and create an installer package.
os.system('mkdir package')
duptree('Doomsday Engine.app', 'package/Doomsday Engine.app')
os.system('pkgbuild --identifier net.dengine.doomsday.frontend.pkg --version %s ' % DOOMSDAY_VERSION_FULL + \
'--install-location /Applications --root package Frontend.pkg')
os.system('rm -rf package')

os.system('mkdir package')
duptree('Doomsday Shell.app', 'package/Doomsday Shell.app')
os.system('pkgbuild --identifier net.dengine.doomsday.shell.pkg --version %s ' % DOOMSDAY_VERSION_FULL + \
'--install-location /Applications --root package Shell.pkg')
os.system('rm -rf package')

os.system("sed 's/${Version}/%s/' < ../macx/Distribution.xml.in > Distribution.xml" % DOOMSDAY_VERSION_FULL)
os.system('mkdir res')
shutil.copy(os.path.join(DOOMSDAY_DIR, "doc/output/Read Me.rtf"), 'res/Read Me.rtf')
shutil.copy('../macx/background.png', 'res/background.png')
os.system('productbuild --distribution Distribution.xml --package-path . --resources res --sign "Developer ID Installer: Jaakko Keranen" Doomsday.pkg')

print 'Creating disk:', target

# Compress a disk image containing the installer package.
masterPkg = target
volumeName = "Doomsday Engine " + DOOMSDAY_VERSION_FULL
templateFile = os.path.join(SNOWBERRY_DIR, 'template-image/template.sparseimage')
Expand All @@ -310,15 +329,15 @@ def fw_codesign(app):
remkdir('imaging')
os.system('hdiutil attach imaging.sparseimage -noautoopen -quiet -mountpoint imaging')
try:
shutil.copy('/Users/jaakko/Desktop/Doomsday.pkg', 'imaging/Doomsday.pkg')
shutil.copy('Doomsday.pkg', 'imaging/Doomsday.pkg')
except Exception, ex:
print 'No installer available:', ex
shutil.copy(os.path.join(DOOMSDAY_DIR, "doc/output/Read Me.rtf"), 'imaging/Read Me.rtf')

volumeName = "Doomsday Engine " + DOOMSDAY_VERSION_FULL
os.system('/usr/sbin/diskutil rename ' + os.path.abspath('imaging') + ' "' + volumeName + '"')

os.system('hdiutil detach -quiet imaging')
os.system('hdiutil detach -quiet imaging; rmdir imaging')
os.system('hdiutil convert imaging.sparseimage -format UDZO -imagekey zlib-level=9 -o "' + target + '"')
remove('imaging.sparseimage')

Expand Down

0 comments on commit f47aa1f

Please sign in to comment.