# $Id: Makefile.kmk 33185 2010-10-18 08:40:50Z vboxsync $ ## @file # Install misc stuff and create dist packages for Mac OS X. # # # Copyright (C) 2006-2010 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk # # Include sub-makefiles. # ifndef VBOX_OSE include $(PATH_SUB_CURRENT)/InstallerPlugins/Makefile.kmk endif # # Globals # VBOX_PATH_DI_SRC := $(PATH_SUB_CURRENT) VBOX_DI_OUT_DIR := $(PATH_TARGET)/Installer/darwin BLDDIRS += $(VBOX_DI_OUT_DIR) ifdef VBOX_WITH_COMBINED_PACKAGE ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_PATH_DIST_32 = $(VBOX_PATH_DIST) VBOX_PATH_DIST_64 = $(PATH_OUT_BASE)/darwin.amd64/$(KBUILD_TYPE)/dist else VBOX_PATH_DIST_64 = $(VBOX_PATH_DIST) VBOX_PATH_DIST_32 = $(PATH_OUT_BASE)/darwin.x86/$(KBUILD_TYPE)/dist endif VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST_32)/$1 $(VBOX_PATH_DIST_64)/$2 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST_32)/$1 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST_64)/$1 VBOX_DI_LIPO = lipo else VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST)/$1 ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST)/$1 VBOX_DI_FN_DEP_64 = else VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST)/$1 VBOX_DI_FN_DEP_32 = endif endif # Unset this to speed up things during makefile hacking. VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT) # The location of the PackageMaker program. ifndef VBOX_PACKAGEMAKER VBOX_PACKAGEMAKER := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/darwin.x86/packagemaker/v*/PackageMaker.app/Contents/MacOS/PackageMaker)) \ /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) endif # Where we do the packing (override this in LocalConfig.kmk if building on smbfs). ifndef VBOX_PATH_PACK_TMP VBOX_PATH_PACK_TMP := $(VBOX_DI_OUT_DIR) endif # These tools are necessary ## @Todo rename to VBOX_DI_XYZ these conflict with other globals. TAR=/usr/bin/tar ZIP=/usr/bin/zip GZIP=/usr/bin/gzip BZIP2=/usr/bin/bzip2 GREP=/usr/bin/grep XARGS=/usr/bin/xargs UNZIP=/usr/bin/unzip AWK=/usr/bin/awk HDIUTIL=/usr/bin/hdiutil # # Install the darwin docs/license. # INSTALLS += darwin-docs darwin-docs_INST = $(INST_DIST) darwin-docs_MODE = a+r,u+w darwin-docs_SOURCES = \ $(VBOX_BRAND_LICENSE_TXT)=>LICENSE # # The packing. # PACKING += $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg ifdef VBOX_WITH_BUNDLED_INSTALLER PACKING += $(VBOX_PATH_DIST)/VBoxMacBundleInstaller-$(KBUILD_TARGET_ARCH).zip endif ifdef VBOX_WITH_BUNDLED_ISO iso: $(if $(eq $(filter CD,$(VBOX_BRAND_MEDIA)),CD),$(VBOX_PATH_DIST)/VirtualBox.iso,) \ $(if $(eq $(filter DVD,$(VBOX_BRAND_MEDIA)),DVD),$(VBOX_PATH_DIST)/VirtualBoxBundle.iso,) endif #OTHER_CLEAN = TODO include $(KBUILD_PATH)/subfooter.kmk # # We're running commands as root here, take some care and assertion # a sane environment. # ifeq ($(strip $(VBOX_PATH_DIST)),) $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST)) endif ifeq ($(strip $(VBOX_PATH_DIST)),/) $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST)) endif ifeq ($(strip $(VBOX_PATH_PACK_TMP)),) $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP)) endif ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/) $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP)) endif # Check for additional manuals VBOX_ADD_MANUALS := $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_$(f).pdf) VBOX_ADD_MANUAL_de_DE := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_de_DE.pdf,$(VBOX_ADD_MANUALS)) VBOX_ADD_MANUAL_fr_FR := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_fr_FR.pdf,$(VBOX_ADD_MANUALS)) # # The disk image. # $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg: \ $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg \ $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \ $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \ $$(wildcard $(VBOX_PATH_DI_SRC)/DiskImage/*) \ $(if $(VBOX_WITH_DOCS_PACKING), \ $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf \ $(VBOX_ADD_MANUALS)) \ $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) $(call MSG_TOOL,hdiutil,,,$@) @# Cleanup any previously failed attempts and various trash. sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/ sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/ sudo rm -Rf \ $@ \ $(VBOX_PATH_PACK_TMP)/DiskImage/ sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO) $(INSTALL) $(VBOX_PATH_DI_SRC)/DiskImage/VirtualBox_Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/ ifeq (1,1) @# Pedantic mode... $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff ifdef VBOX_WITH_BUNDLED_INSTALLER $(if $(VBOX_WITH_DOCS_PACKING), \ $(INSTALL) -m 644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/User\ Manual.pdf$(NLTAB) \ $(if $(VBOX_ADD_MANUAL_de_DE),$(INSTALL) -m 644 $(VBOX_ADD_MANUAL_de_DE) "$(VBOX_PATH_PACK_TMP)/DiskImage/$(VBOX_BRAND_de_DE_MANUAL_NAME).pdf"$(NLTAB)) \ $(if $(VBOX_ADD_MANUAL_fr_FR),$(INSTALL) -m 644 $(VBOX_ADD_MANUAL_fr_FR) "$(VBOX_PATH_PACK_TMP)/DiskImage/$(VBOX_BRAND_fr_FR_MANUAL_NAME).pdf"$(NLTAB))) # Rename the main package else $(if $(VBOX_WITH_DOCS_PACKING), $(INSTALL) $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/) $(LN) -s /Applications/ $(VBOX_PATH_PACK_TMP)/DiskImage/Applications endif endif @# Change the owners. sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage @# Create the image. sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" "$@" @# Change (back) the owner so it can be deleted by the user. sudo chown "$(shell whoami)" "$@" sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage # # The meta-package. # $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg: \ $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg \ $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \ $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \ $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \ $$(TARGET_RegistrationPane) \ $(if $(VBOX_OSE), , \ $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist \ $$(wildcard $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/*.lproj/*.strings \ $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/*.lproj/RegistrationPane.nib/*.nib)) \ $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \ $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_HTML) \ $(VBOX_BRAND_$(f)_LICENSE_RTF) \ $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) \ $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS)) \ $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) $(call MSG_TOOL,PackageMaker,,,$@) @# Cleanup any previously failed attempts. sudo rm -Rf \ $@ \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res @# Correct directory permissions are important. $(MKDIR) -p \ $(@D) \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj @# Do keyword replacement in the package info and description files. $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \ $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Info.plist $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \ $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Description.plist $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Welcome.html \ $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.html @# Copy the resources. # $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/ReadMe.html $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/ReadMe.html $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.html $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Conclusion.html $(SED) \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Localizable.strings \ $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/License.rtf $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/background.tif $(INSTALL) -m 0766 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/checkforrunningvms $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/checkforrunningvms $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(MKDIR) -p \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \ $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.html \ $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_HTML)$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VIRTUALBOX_CONCLUSION_HTML) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Conclusion.html$(NLTAB) \ $(SED) \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \ $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \ ) @# Build the package. $(VBOX_PACKAGEMAKER) -build -v \ -p $@ \ -r $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \ -i $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \ -d $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \ -mi $(VBOX_PATH_PACK_TMP)/Packages @# Copy the plugins. $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist $@/Contents/ ifndef VBOX_OSE $(MKDIR) -p $@/Contents/Plugins/ ifdef VBOX_WITH_SERIALNUMBER_INSTALL $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist else $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist.off endif @# Copy the Registration Pane plugin. $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/ $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist $@/Contents/Plugins/RegistrationPane.bundle/Contents/ $(INSTALL) -m 0644 $(TARGET_RegistrationPane) $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/ $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/InfoPlist.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/ $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/Localizable.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/ $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/RegistrationPane.nib/classes.nib $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib/ $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/RegistrationPane.nib/info.nib $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib/ $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/RegistrationPane.nib/keyedobjects.nib $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib/ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(MKDIR) -p \ $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/InfoPlist.strings$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings$(NLTAB) \ ) endif @# Cleanup. sudo rm -Rf \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res # # The VirtualBox Kernel extensions. # VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL) $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \ $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \ $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \ $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \ $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \ $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \ $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS) \ $(VBOX_BRAND_$(f)_LICENSE_RTF)) \ $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) $(call MSG_TOOL,PackageMaker,,,$@) @# Cleanup any previously failed attempts. sudo rm -Rf \ $@ \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res @# Correct directory permissions are important. $(MKDIR) -p \ $(@D) \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library $(MKDIR) -p -m 0755 \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions \ $(foreach kext,$(VBOX_DI_KEXTS), \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS ) @# Copy the common files (Info.plist). $(foreach kext,$(VBOX_DI_KEXTS), \ $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/) @# Copy the binaries, invoking lipo and strip. ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), \ $(NLTAB)$(VBOX_DI_LIPO) -create \ $(VBOX_PATH_DIST_32)/$(kext).kext/Contents/MacOS/$(kext) \ $(VBOX_PATH_DIST_64)/$(kext).kext/Contents/MacOS/$(kext) \ -output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext)) else $(foreach kext,$(VBOX_DI_KEXTS), \ $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/) endif if1of ($(KBUILD_TYPE), release) $(foreach kext,$(VBOX_DI_KEXTS), \ $(NLTAB)strip -uX $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext)) endif @# Set the correct owners. sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions @# Do keyword replacement in the package info and description files. $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \ $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Info.plist $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist \ $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Description.plist $(SED) \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/ReadMe.html \ $(VBOX_PATH_DI_SRC)/VBoxKEXTs/ReadMe.html @# Copy the resources. $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/InstallationCheck $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/ $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/ $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/License.rtf $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(MKDIR) -p \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \ $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \ $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST)$(NLTAB) \ $(SED) \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/ReadMe.html \ $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML)$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/InstallationCheck.strings$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \ ) $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/English.lproj/InstallationCheck.strings $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/ @# Build the package. $(VBOX_PACKAGEMAKER) -build -v \ -p $@ \ -f $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \ -r $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \ -i $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \ -d $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist @# Cleanup sudo rm -Rf \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res # # The VirtualBox Startupitems. # $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg: \ $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/* \ $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/*.lproj/*) \ $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/* \ $(VBOX_PATH_DI_SRC)/VBoxStartupItems/*.lproj/*) \ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST) \ $(VBOX_BRAND_$(f)_LICENSE_RTF)) \ $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) $(call MSG_TOOL,PackageMaker,,,$@) @# Cleanup any previously failed attempts. sudo rm -Rf \ $@ \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res @# Correct directory permissions are important. $(MKDIR) -p \ $(@D) \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj $(MKDIR) -p -m 0775 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library $(MKDIR) -p -m 0755 \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj @# Copy the files. $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/StartupParameters.plist $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/ $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/VirtualBox $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/ $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/English.lproj/Localizable.strings $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj/ @# Set the correct owners. sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems @# Do keyword replacement in the package info and description files. $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \ $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Info.plist $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist \ $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Description.plist @# Copy the resources. $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj/License.rtf $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(MKDIR) -p \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \ $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \ $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \ ) @# Build the package. $(VBOX_PACKAGEMAKER) -build -v \ -p $@ \ -f $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \ -r $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \ -i $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \ -d $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist @# Cleanup sudo rm -Rf \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res # # Figure out which languages that we support and construct # .qm and .lproj lists for these. # include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm) VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES)) # # The VirtualBox Application. # VBOX_DI_VBAPP_DYLIBS = \ $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \ MacOS/VBoxDD.dylib \ MacOS/VBoxDD2.dylib \ MacOS/VBoxDDU.dylib \ MacOS/VBoxREM.dylib \ MacOS/VBoxRT.dylib \ MacOS/VBoxSharedFolders.dylib \ MacOS/VBoxSharedClipboard.dylib \ MacOS/VBoxGuestPropSvc.dylib \ MacOS/VBoxVMM.dylib \ MacOS/VBoxXPCOM.dylib \ MacOS/VBoxXPCOMC.dylib \ MacOS/components/VBoxC.dylib \ MacOS/components/VBoxSVCM.dylib \ MacOS/components/VBoxXPCOMIPCC.dylib \ MacOS/VBoxAuth.dylib \ MacOS/VBoxAuthSimple.dylib ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),) VBOX_DI_VBAPP_DYLIBS += \ MacOS/accessible/libqtaccessiblewidgets.dylib endif ifdef VBOX_WITH_GUEST_CONTROL VBOX_DI_VBAPP_DYLIBS += \ MacOS/VBoxGuestControlSvc.dylib endif ifdef VBOX_WITH_VRDP VBOX_DI_VBAPP_DYLIBS += \ MacOS/VBoxVRDP.dylib endif ifdef VBOX_WITH_CROGL VBOX_DI_VBAPP_DYLIBS += \ MacOS/VBoxOGLhostcrutil.dylib \ MacOS/VBoxOGLhosterrorspu.dylib \ MacOS/VBoxOGLrenderspu.dylib \ MacOS/VBoxSharedCrOpenGL.dylib endif ifdef VBOX_WITH_DEBUGGER_GUI VBOX_DI_VBAPP_DYLIBS += \ MacOS/VBoxDbg.dylib endif ifdef VBOX_WITH_HARDENING VBOX_DI_VBAPP_DYLIBS += \ MacOS/VirtualBox.dylib \ MacOS/VBoxNetDHCP.dylib \ MacOS/VBoxHeadless.dylib endif ifdef VBOX_WITH_HDDPARALLELS_INSTALL VBOX_DI_VBAPP_DYLIBS += \ MacOS/VBoxHDDParallels.dylib endif if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6) VBOX_DI_VBAPP_DYLIBS += \ MacOS/VBoxPython2_6.so endif VBOX_DI_VBAPP_DYLIBS.x86 := \ MacOS/VBoxREM32.dylib \ MacOS/VBoxREM64.dylib ifdef VBOX_WITH_PYTHON VBOX_DI_VBAPP_DYLIBS.x86 += \ MacOS/VBoxPython2_5.so \ $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,) endif VBOX_DI_VBAPP_DYLIBS.amd64 := if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6) VBOX_DI_VBAPP_DYLIBS.amd64 += \ MacOS/VBoxPython2_6.so endif if defined(VBOX_WITH_JXPCOM) VBOX_DI_VBAPP_DYLIBS += \ MacOS/libvboxjxpcom.jnilib endif if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86)) $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86)) endif if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS)) $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86)$(NLTAB)VBOX_DI_VBAPP_DYLIBS=$(VBOX_DI_VBAPP_DYLIBS)) endif VBOX_DI_VBAPP_PROGS = \ MacOS/VBoxManage \ MacOS/VBoxSVC \ MacOS/VBoxHeadless \ MacOS/VBoxXPCOMIPCD \ MacOS/VirtualBox \ MacOS/VirtualBoxVM \ MacOS/VBoxNetAdpCtl \ MacOS/VBoxNetDHCP ifdef VBOX_WITH_WEBSERVICES VBOX_DI_VBAPP_PROGS += \ MacOS/vboxwebsrv endif VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \ MacOS/VMMR0.r0 \ MacOS/VBoxDDR0.r0 \ MacOS/VBoxDD2R0.r0 VBOX_DI_VBAPP_OTHER_BINS = \ MacOS/VMMGC.gc \ MacOS/VBoxDDGC.gc \ MacOS/VBoxDD2GC.gc VBOX_DI_VBAPP_MISC_FILES = \ Resources/VirtualBoxVM.app/Contents/Info.plist \ Resources/VirtualBoxVM.app/Contents/PkgInfo \ Info.plist \ PkgInfo \ Resources/virtualbox.icns \ MacOS/components/VBoxXPCOMBase.xpt \ MacOS/components/VirtualBox_XPCOM.xpt ifdef VBOX_WITH_DOCS_PACKING VBOX_DI_VBAPP_MISC_FILES += \ MacOS/UserManual.pdf endif ifdef VBOX_WITH_ADDITIONS_PACKING ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),) VBOX_DI_VBAPP_MISC_FILES += \ MacOS/VBoxGuestAdditions.iso endif endif ifdef VBOX_WITH_EFIFW_PACKING VBOX_DI_VBAPP_MISC_FILES += \ MacOS/VBoxEFI32.fd \ MacOS/VBoxEFI64.fd endif ifdef VBOX_WITH_COCOA_QT VBOX_DI_VBAPP_MISC_FILES += \ Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \ Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \ Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib endif VBOX_DI_VBAPP_SYMLINKS = \ Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \ Resources/VirtualBoxVM.app/Contents/Resources=>../../../Resources/ \ $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod)) ifdef VBOX_WITH_COCOA_QT VBOX_DI_VBAPP_SYMLINKS += \ Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Resources=>Versions/4/Resources/ endif ifdef VBOX_WITH_PYTHON # Python XPCOM glue VBOX_DI_VBAPP_PYTHON_FILES = \ $(foreach f,$(notdir $(wildcard $(VBOX_PATH_DIST)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \ sdk/bindings/xpcom/python/xpcom/client/__init__.py \ sdk/bindings/xpcom/python/xpcom/server/__init__.py \ sdk/bindings/xpcom/python/xpcom/server/enumerator.py \ sdk/bindings/xpcom/python/xpcom/server/factory.py \ sdk/bindings/xpcom/python/xpcom/server/loader.py \ sdk/bindings/xpcom/python/xpcom/server/module.py \ sdk/bindings/xpcom/python/xpcom/server/policy.py \ sdk/installer/vboxapisetup.py \ sdk/installer/vboxapi/__init__.py \ sdk/installer/vboxapi/VirtualBox_constants.py endif # (The dependencies are including way too much here because I'm lazy.) $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \ $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST) \ $(VBOX_BRAND_$(f)_LICENSE_RTF)) \ $(foreach f, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES)\ ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \ $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\ ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \ $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\ ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \ \ $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \ $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \ $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \ $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \ \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \ $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \ $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \ $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \ $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \ $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \ $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) $(call MSG_TOOL,PackageMaker,,,$@) @# Cleanup any previously failed attempts. sudo rm -Rf \ $@ \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res @# Correct directory permissions are important. $(MKDIR) -p \ $(@D) \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj $(MKDIR) -p -m 0775 \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications $(MKDIR) -p -m 0755 $(sort \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/components \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/accessible \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \ $(if-expr defined(VBOX_WITH_PYTHON), \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer/vboxapi \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/ \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \ $(if-expr defined(VBOX_WITH_JXPCOM), \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java,) \ $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/,$(dir \ $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES) \ $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "amd64",$(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64),) \ $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86", $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86),) \ ))\ ) @# Create the .lproj language directories $(MKDIR) -p -m 0755 \ $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ)) @# Install all supported language files $(foreach f, $(VBOX_INSTALL_LANG_FILES) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls/$(f)$(NLTAB)) ifdef VBOX_WITH_WEBSERVICES $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/ endif @# Install the python stuff ifdef VBOX_WITH_PYTHON $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(f)$(NLTAB) ) $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS endif ifdef VBOX_WITH_JXPCOM $(INSTALL) -m 0755 $(VBOX_PATH_DIST)/sdk/bindings/xpcom/java/vboxjxpcom.jar $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar endif @# Copy misc files. $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) ) ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.x86) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) ) $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.amd64) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) ) endif ifdef VBOX_WITH_DOCS_PACKING $(foreach f,$(VBOX_ADD_MANUALS) \ ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(NLTAB)) endif @# Create symlinks. ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.amd64) $(VBOX_DI_VBAPP_SYMLINKS.x86) \ ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB)) else $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \ ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB)) endif @# Copy the dylibs. ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) \ ,$(VBOX_DI_LIPO) -create \ $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) \ $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) \ -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB)) $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.x86) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB)) $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.amd64) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB)) else $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB)) endif @# Copy the other binaries. ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \ ,$(VBOX_DI_LIPO) -create \ $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \ $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \ -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB)) $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)-x86$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)-amd64$(NLTAB)) else $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \ ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)-$(KBUILD_TARGET_ARCH)$(NLTAB)) endif @# Copy the binaries. ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \ ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(prog)-x86$(NLTAB) \ $(INSTALL) -m 0755 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(prog)-amd64$(NLTAB)) else $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \ ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(prog)-$(KBUILD_TARGET_ARCH)$(NLTAB)) endif @# Create symlinks for all the binaries (corrected by postflight and the VirtualBox StartupItem to hardlinks). ifdef VBOX_WITH_COMBINED_PACKAGE $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \ ,$(LN) -s $(bin)-x86 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB)) else $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \ ,$(LN) -s $(bin)-$(KBUILD_TARGET_ARCH) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB)) endif @# Strip programs and dylibs. if1of ($(KBUILD_TYPE), release) ifdef VBOX_WITH_COMBINED_PACKAGE strip -SXru \ $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_DYLIBS.amd64) \ ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)) \ $(foreach bin, $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \ ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)) else strip -SXru \ $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \ ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)) \ $(foreach bin, $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \ ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)) endif endif @## @todo Strip the .r0 and .gc modules as well? #ifdef VBOX_WITH_HARDENING - disabled temporarily if 1 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users. $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \ ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(NLTAB) ) $(foreach f, \ $(VBOX_DI_VBAPP_DYLIBS) \ $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), \ $(VBOX_DI_VBAPP_DYLIBS.x86) \ $(VBOX_DI_VBAPP_DYLIBS.amd64) \ $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) \ $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \ ,$(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \ $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \ ) \ ,install_name_tool \ $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), \ -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ -change $(VBOX_PATH_QT4)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \ /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ -change $(qtmod).framework/Versions/4/$(qtmod) \ /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \ ) \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) ) endif @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables. sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root ifdef VBOX_WITH_HARDENING ifdef VBOX_WITH_COMBINED_PACKAGE sudo chmod u+s \ $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-x86 \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-amd64) else sudo chmod u+s \ $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-$(KBUILD_TARGET_ARCH)) endif endif @# Do keyword replacement in the package info and description files. $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \ $(VBOX_PATH_DI_SRC)/VirtualBox/Info.plist $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist \ $(VBOX_PATH_DI_SRC)/VirtualBox/Description.plist @# Copy the resources. $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj/License.rtf $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \ ,$(MKDIR) -p \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \ $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \ $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \ ) $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/ @# Build the package. $(VBOX_PACKAGEMAKER) -build -v \ -p $@ \ -f $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \ -r $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \ -i $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \ -d $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist @# Cleanup sudo rm -Rf \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res # # The VirtualBox CLI wrapper scripts. # $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \ $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \ $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \ ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST) \ $(VBOX_BRAND_$(f)_LICENSE_RTF)) \ $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) $(call MSG_TOOL,PackageMaker,,,$@) @# Cleanup any previously failed attempts. sudo rm -Rf \ $@ \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res @# Correct directory permissions are important. $(MKDIR) -p \ $(@D) \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj $(MKDIR) -p -m 0755 \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin @# Generate the wrapper scripts. $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox '#!/bin/bash' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage '#!/bin/bash' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP '#!/bin/bash' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless '#!/bin/bash' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"' ifdef VBOX_WITH_WEBSERVICES $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv '#!/bin/bash' $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"' endif @# Set the correct owners and file permissions. sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/* sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr @# Do keyword replacement in the package info and description files. $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \ $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Info.plist $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist \ $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Description.plist @# Copy the resources. $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj/License.rtf $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \ ,$(MKDIR) -p \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \ $(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \ $(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)$(NLTAB) \ $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \ ) @# Build the package. $(VBOX_PACKAGEMAKER) -build -v \ -p $@ \ -f $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \ -r $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \ -i $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \ -d $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist @# Cleanup sudo rm -Rf \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \ $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res ifndef VBOX_OSE include $(VBOX_PATH_DI_SRC)/Bundle.kmk endif