VirtualBox

source: vbox/trunk/src/VBox/Installer/darwin/Makefile.kmk@ 34796

Last change on this file since 34796 was 34737, checked in by vboxsync, 14 years ago

Main;FE/Qt4-OSX: change the icon on the password dialog

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 54.1 KB
Line 
1# $Id: Makefile.kmk 34737 2010-12-06 11:21:23Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X.
4#
5
6#
7# Copyright (C) 2006-2010 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Include sub-makefiles.
23#
24ifndef VBOX_OSE
25 include $(PATH_SUB_CURRENT)/InstallerPlugins/Makefile.kmk
26endif
27
28
29#
30# Globals
31#
32VBOX_PATH_DI_SRC := $(PATH_SUB_CURRENT)
33VBOX_DI_OUT_DIR := $(PATH_TARGET)/Installer/darwin
34BLDDIRS += $(VBOX_DI_OUT_DIR)
35
36ifdef VBOX_WITH_COMBINED_PACKAGE
37 ifeq ($(KBUILD_TARGET_ARCH),x86)
38 VBOX_PATH_DIST_32 = $(VBOX_PATH_DIST)
39 VBOX_PATH_DIST_64 = $(PATH_OUT_BASE)/darwin.amd64/$(KBUILD_TYPE)/dist
40 else
41 VBOX_PATH_DIST_64 = $(VBOX_PATH_DIST)
42 VBOX_PATH_DIST_32 = $(PATH_OUT_BASE)/darwin.x86/$(KBUILD_TYPE)/dist
43 endif
44 VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST_32)/$1 $(VBOX_PATH_DIST_64)/$2
45 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST_32)/$1
46 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST_64)/$1
47 VBOX_DI_LIPO = lipo
48else
49 VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST)/$1
50 ifeq ($(KBUILD_TARGET_ARCH),x86)
51 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST)/$1
52 VBOX_DI_FN_DEP_64 =
53 else
54 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST)/$1
55 VBOX_DI_FN_DEP_32 =
56 endif
57endif
58
59# Unset this to speed up things during makefile hacking.
60VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
61
62# The location of the PackageMaker program.
63ifndef VBOX_PACKAGEMAKER
64 VBOX_PACKAGEMAKER := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/darwin.x86/packagemaker/v*/PackageMaker.app/Contents/MacOS/PackageMaker)) \
65 /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker)
66endif
67
68# Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
69ifndef VBOX_PATH_PACK_TMP
70 VBOX_PATH_PACK_TMP := $(VBOX_DI_OUT_DIR)
71endif
72
73# These tools are necessary
74## @Todo rename to VBOX_DI_XYZ these conflict with other globals.
75TAR=/usr/bin/tar
76ZIP=/usr/bin/zip
77GZIP=/usr/bin/gzip
78BZIP2=/usr/bin/bzip2
79GREP=/usr/bin/grep
80XARGS=/usr/bin/xargs
81UNZIP=/usr/bin/unzip
82AWK=/usr/bin/awk
83HDIUTIL=/usr/bin/hdiutil
84
85#
86# Install the darwin docs/license.
87#
88INSTALLS += darwin-docs
89darwin-docs_INST = $(INST_DIST)
90darwin-docs_MODE = a+r,u+w
91darwin-docs_SOURCES = \
92 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
93
94
95#
96# The packing.
97#
98PACKING += $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg
99ifdef VBOX_WITH_BUNDLED_INSTALLER
100 PACKING += $(VBOX_PATH_DIST)/VBoxMacBundleInstaller-$(KBUILD_TARGET_ARCH).zip
101endif
102ifdef VBOX_WITH_BUNDLED_ISO
103iso: $(if $(eq $(filter CD,$(VBOX_BRAND_MEDIA)),CD),$(VBOX_PATH_DIST)/VirtualBox.iso,) \
104 $(if $(eq $(filter DVD,$(VBOX_BRAND_MEDIA)),DVD),$(VBOX_PATH_DIST)/VirtualBoxBundle.iso,)
105endif
106#OTHER_CLEAN = TODO
107
108
109include $(KBUILD_PATH)/subfooter.kmk
110
111
112#
113# We're running commands as root here, take some care and assertion
114# a sane environment.
115#
116ifeq ($(strip $(VBOX_PATH_DIST)),)
117 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
118endif
119ifeq ($(strip $(VBOX_PATH_DIST)),/)
120 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
121endif
122ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
123 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
124endif
125ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
126 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
127endif
128
129
130# Check for additional manuals
131VBOX_ADD_MANUALS := $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_$(f).pdf)
132
133VBOX_ADD_MANUAL_de_DE := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_de_DE.pdf,$(VBOX_ADD_MANUALS))
134VBOX_ADD_MANUAL_fr_FR := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_fr_FR.pdf,$(VBOX_ADD_MANUALS))
135
136#
137# The disk image.
138#
139$(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg: \
140 $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg \
141 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \
142 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \
143 $$(wildcard $(VBOX_PATH_DI_SRC)/DiskImage/*) \
144 $(if $(VBOX_WITH_DOCS_PACKING), \
145 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf \
146 $(VBOX_ADD_MANUALS)) \
147 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
148 $(call MSG_TOOL,hdiutil,,,$@)
149 @# Cleanup any previously failed attempts and various trash.
150 sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp
151 $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
152 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
153 sudo rm -Rf \
154 $@ \
155 $(VBOX_PATH_PACK_TMP)/DiskImage/
156 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage
157 @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO)
158 $(INSTALL) $(VBOX_PATH_DI_SRC)/DiskImage/VirtualBox_Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/
159ifeq (1,1)
160 @# Pedantic mode...
161 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store
162 $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background
163 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff
164 ifdef VBOX_WITH_BUNDLED_INSTALLER
165 $(if $(VBOX_WITH_DOCS_PACKING), \
166 $(INSTALL) -m 644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/User\ Manual.pdf$(NLTAB) \
167 $(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)) \
168 $(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)))
169 # Rename the main package
170 else
171 $(if $(VBOX_WITH_DOCS_PACKING), $(INSTALL) $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/)
172 $(LN) -s /Applications/ $(VBOX_PATH_PACK_TMP)/DiskImage/Applications
173 endif
174endif
175 @# Change the owners.
176 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
177 @# Create the image.
178 sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" "$@"
179 @# Change (back) the owner so it can be deleted by the user.
180 sudo chown "$(shell whoami)" "$@"
181 sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
182
183#
184# The meta-package.
185#
186$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg: \
187 $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg \
188 $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \
189 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
190 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \
191 $$(TARGET_RegistrationPane) \
192 $(if $(VBOX_OSE), , \
193 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist \
194 $$(wildcard $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/*.lproj/*.strings \
195 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/*.lproj/RegistrationPane.nib/*.nib)) \
196 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
197 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
198 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
199 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_HTML) \
200 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) \
201 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS)) \
202 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
203 $(call MSG_TOOL,PackageMaker,,,$@)
204 @# Cleanup any previously failed attempts.
205 sudo rm -Rf \
206 $@ \
207 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \
208 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
209 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res
210 @# Correct directory permissions are important.
211 $(MKDIR) -p \
212 $(@D) \
213 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
214 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
215 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj
216 @# Do keyword replacement in the package info and description files.
217 $(SED) \
218 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
219 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
220 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
221 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
222 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
223 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
224 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
225 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \
226 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Info.plist
227 $(SED) \
228 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
229 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
230 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
231 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
232 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
233 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
234 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
235 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \
236 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Description.plist
237 $(SED) \
238 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
239 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
240 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
241 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
242 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
243 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
244 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
245 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Welcome.html \
246 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.html
247 @# Copy the resources.
248# $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/ReadMe.html $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/ReadMe.html
249 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.html $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Conclusion.html
250 $(SED) \
251 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
252 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
253 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
254 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Localizable.strings \
255 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
256 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/background.tif
257 $(INSTALL) -m 0766 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/checkforrunningvms $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/checkforrunningvms
258 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
259 $(MKDIR) -p \
260 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
261 $(SED) \
262 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
263 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
264 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
265 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
266 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.html \
267 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_HTML)$(NLTAB) \
268 $(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) \
269 $(SED) \
270 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
271 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
272 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
273 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
274 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
275 )
276 @# Build the package.
277 $(VBOX_PACKAGEMAKER) -build -v \
278 -p $@ \
279 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
280 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \
281 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \
282 -mi $(VBOX_PATH_PACK_TMP)/Packages
283 @# Copy the plugins.
284 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist $@/Contents/
285ifndef VBOX_OSE
286 $(MKDIR) -p $@/Contents/Plugins/
287ifdef VBOX_WITH_SERIALNUMBER_INSTALL
288 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist
289else
290 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist.off
291endif
292 @# Copy the Registration Pane plugin.
293 $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/
294 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist $@/Contents/Plugins/RegistrationPane.bundle/Contents/
295 $(INSTALL) -m 0644 $(TARGET_RegistrationPane) $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/
296 $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib
297 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/InfoPlist.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/
298 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/Localizable.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/
299 $(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/
300 $(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/
301 $(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/
302 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
303 $(MKDIR) -p \
304 $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
305 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/InfoPlist.strings$(NLTAB) \
306 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings$(NLTAB) \
307 )
308endif
309 @# Cleanup.
310 sudo rm -Rf \
311 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \
312 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
313 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res
314
315
316
317#
318# The VirtualBox Kernel extensions.
319#
320VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB
321VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
322
323$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
324 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
325 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
326 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
327 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
328 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
329 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
330 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
331 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
332 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
333 $(call MSG_TOOL,PackageMaker,,,$@)
334 @# Cleanup any previously failed attempts.
335 sudo rm -Rf \
336 $@ \
337 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
338 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
339 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
340 @# Correct directory permissions are important.
341 $(MKDIR) -p \
342 $(@D) \
343 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
344 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
345 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
346 $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
347 $(MKDIR) -p -m 0755 \
348 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions \
349 $(foreach kext,$(VBOX_DI_KEXTS), \
350 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext \
351 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
352 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
353 @# Copy the common files (Info.plist).
354 $(foreach kext,$(VBOX_DI_KEXTS), \
355 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/)
356 @# Copy the binaries, invoking lipo and strip.
357ifdef VBOX_WITH_COMBINED_PACKAGE
358 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), \
359 $(NLTAB)$(VBOX_DI_LIPO) -create \
360 $(VBOX_PATH_DIST_32)/$(kext).kext/Contents/MacOS/$(kext) \
361 $(VBOX_PATH_DIST_64)/$(kext).kext/Contents/MacOS/$(kext) \
362 -output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
363else
364 $(foreach kext,$(VBOX_DI_KEXTS), \
365 $(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/)
366endif
367if1of ($(KBUILD_TYPE), release)
368 $(foreach kext,$(VBOX_DI_KEXTS), \
369 $(NLTAB)strip -uX $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
370endif
371 @# Set the correct owners.
372 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
373 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions
374 @# Do keyword replacement in the package info and description files.
375 $(SED) \
376 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
377 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
378 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
379 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
380 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
381 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
382 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
383 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
384 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Info.plist
385 $(SED) \
386 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
387 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
388 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
389 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
390 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
391 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
392 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
393 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist \
394 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Description.plist
395 $(SED) \
396 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
397 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
398 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
399 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/ReadMe.html \
400 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/ReadMe.html
401 @# Copy the resources.
402 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/InstallationCheck $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
403 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
404 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
405 $(MKDIR) -p \
406 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
407 $(SED) \
408 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
409 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
410 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
411 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
412 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
413 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
414 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
415 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
416 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST)$(NLTAB) \
417 $(SED) \
418 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
419 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
420 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
421 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/ReadMe.html \
422 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML)$(NLTAB) \
423 $(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) \
424 )
425 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/English.lproj/InstallationCheck.strings $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/
426 @# Build the package.
427 $(VBOX_PACKAGEMAKER) -build -v \
428 -p $@ \
429 -f $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
430 -r $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
431 -i $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
432 -d $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist
433 @# Cleanup
434 sudo rm -Rf \
435 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
436 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
437 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
438
439
440#
441# The VirtualBox Startupitems.
442#
443$(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg: \
444 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/* \
445 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/*.lproj/*) \
446 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/* \
447 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/*.lproj/*) \
448 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
449 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)) \
450 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
451 $(call MSG_TOOL,PackageMaker,,,$@)
452 @# Cleanup any previously failed attempts.
453 sudo rm -Rf \
454 $@ \
455 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
456 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
457 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
458 @# Correct directory permissions are important.
459 $(MKDIR) -p \
460 $(@D) \
461 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
462 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
463 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj
464 $(MKDIR) -p -m 0775 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
465 $(MKDIR) -p -m 0755 \
466 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems \
467 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox \
468 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources \
469 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj
470 @# Copy the files.
471 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/StartupParameters.plist $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
472 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/VirtualBox $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
473 $(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/
474 @# Set the correct owners.
475 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
476 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems
477 @# Do keyword replacement in the package info and description files.
478 $(SED) \
479 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
480 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
481 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
482 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
483 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
484 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
485 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
486 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
487 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Info.plist
488 $(SED) \
489 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
490 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
491 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
492 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
493 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
494 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
495 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
496 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist \
497 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Description.plist
498 @# Copy the resources.
499 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
500 $(MKDIR) -p \
501 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
502 $(SED) \
503 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
504 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
505 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
506 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
507 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
508 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
509 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
510 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
511 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)$(NLTAB) \
512 )
513 @# Build the package.
514 $(VBOX_PACKAGEMAKER) -build -v \
515 -p $@ \
516 -f $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
517 -r $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
518 -i $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
519 -d $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist
520 @# Cleanup
521 sudo rm -Rf \
522 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
523 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
524 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
525
526
527#
528# Figure out which languages that we support and construct
529# .qm and .lproj lists for these.
530#
531include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
532VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
533VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
534
535
536#
537# The VirtualBox Application.
538#
539
540VBOX_DI_VBAPP_DYLIBS = \
541 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \
542 MacOS/VBoxDD.dylib \
543 MacOS/VBoxDD2.dylib \
544 MacOS/VBoxDDU.dylib \
545 MacOS/VBoxREM.dylib \
546 MacOS/VBoxRT.dylib \
547 MacOS/VBoxSharedFolders.dylib \
548 MacOS/VBoxSharedClipboard.dylib \
549 MacOS/VBoxGuestPropSvc.dylib \
550 MacOS/VBoxVMM.dylib \
551 MacOS/VBoxXPCOM.dylib \
552 MacOS/VBoxXPCOMC.dylib \
553 MacOS/components/VBoxC.dylib \
554 MacOS/components/VBoxSVCM.dylib \
555 MacOS/components/VBoxXPCOMIPCC.dylib \
556 MacOS/VBoxAuth.dylib \
557 MacOS/VBoxAuthSimple.dylib
558ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
559 VBOX_DI_VBAPP_DYLIBS += \
560 MacOS/accessible/libqtaccessiblewidgets.dylib
561endif
562ifdef VBOX_WITH_GUEST_CONTROL
563 VBOX_DI_VBAPP_DYLIBS += \
564 MacOS/VBoxGuestControlSvc.dylib
565endif
566if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
567 VBOX_DI_VBAPP_DYLIBS += \
568 MacOS/VBoxVRDP.dylib
569endif
570ifdef VBOX_WITH_CROGL
571 VBOX_DI_VBAPP_DYLIBS += \
572 MacOS/VBoxOGLhostcrutil.dylib \
573 MacOS/VBoxOGLhosterrorspu.dylib \
574 MacOS/VBoxOGLrenderspu.dylib \
575 MacOS/VBoxSharedCrOpenGL.dylib
576endif
577ifdef VBOX_WITH_DEBUGGER_GUI
578 VBOX_DI_VBAPP_DYLIBS += \
579 MacOS/VBoxDbg.dylib
580endif
581ifdef VBOX_WITH_HARDENING
582 VBOX_DI_VBAPP_DYLIBS += \
583 MacOS/VirtualBox.dylib \
584 MacOS/VBoxNetDHCP.dylib \
585 MacOS/VBoxHeadless.dylib
586endif
587ifdef VBOX_WITH_HDDPARALLELS_INSTALL
588 VBOX_DI_VBAPP_DYLIBS += \
589 MacOS/VBoxHDDParallels.dylib
590endif
591if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
592 VBOX_DI_VBAPP_DYLIBS += \
593 MacOS/VBoxPython2_6.so
594endif
595
596VBOX_DI_VBAPP_DYLIBS.x86 := \
597 MacOS/VBoxREM32.dylib \
598 MacOS/VBoxREM64.dylib
599ifdef VBOX_WITH_PYTHON
600 VBOX_DI_VBAPP_DYLIBS.x86 += \
601 MacOS/VBoxPython2_5.so \
602 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
603endif
604
605VBOX_DI_VBAPP_DYLIBS.amd64 :=
606if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
607 VBOX_DI_VBAPP_DYLIBS.amd64 += \
608 MacOS/VBoxPython2_6.so
609endif
610
611if defined(VBOX_WITH_JXPCOM)
612 VBOX_DI_VBAPP_DYLIBS += \
613 MacOS/libvboxjxpcom.jnilib
614endif
615
616if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
617 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
618endif
619if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
620 $(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))
621endif
622
623VBOX_DI_VBAPP_PROGS = \
624 MacOS/VBoxManage \
625 MacOS/VBoxSVC \
626 MacOS/VBoxHeadless \
627 MacOS/VBoxXPCOMIPCD \
628 MacOS/VirtualBox \
629 MacOS/VirtualBoxVM \
630 MacOS/VBoxNetAdpCtl \
631 MacOS/VBoxNetDHCP \
632 MacOS/VBoxExtPackHelperApp
633ifdef VBOX_WITH_WEBSERVICES
634 VBOX_DI_VBAPP_PROGS += \
635 MacOS/vboxwebsrv
636endif
637
638VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
639 MacOS/VMMR0.r0 \
640 MacOS/VBoxDDR0.r0 \
641 MacOS/VBoxDD2R0.r0 \
642 MacOS/vmstarter
643
644VBOX_DI_VBAPP_OTHER_BINS = \
645 MacOS/VMMGC.gc \
646 MacOS/VBoxDDGC.gc \
647 MacOS/VBoxDD2GC.gc
648
649VBOX_DI_VBAPP_MISC_FILES = \
650 Resources/VirtualBoxVM.app/Contents/Info.plist \
651 Resources/VirtualBoxVM.app/Contents/PkgInfo \
652 Resources/vmstarter.app/Contents/Info.plist \
653 Resources/vmstarter.app/Contents/PkgInfo \
654 Info.plist \
655 PkgInfo \
656 Resources/virtualbox.icns \
657 Resources/virtualbox.png \
658 Resources/virtualbox-vbox.icns \
659 Resources/virtualbox-vbox-extpack.icns \
660 Resources/virtualbox-ovf.icns \
661 Resources/virtualbox-ova.icns \
662 MacOS/components/VBoxXPCOMBase.xpt \
663 MacOS/components/VirtualBox_XPCOM.xpt
664ifdef VBOX_WITH_DOCS_PACKING
665VBOX_DI_VBAPP_MISC_FILES += \
666 MacOS/UserManual.pdf
667endif
668ifdef VBOX_WITH_ADDITIONS_PACKING
669 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
670 VBOX_DI_VBAPP_MISC_FILES += \
671 MacOS/VBoxGuestAdditions.iso
672 endif
673endif
674ifdef VBOX_WITH_EFIFW_PACKING
675VBOX_DI_VBAPP_MISC_FILES += \
676 MacOS/VBoxEFI32.fd \
677 MacOS/VBoxEFI64.fd
678endif
679ifdef VBOX_WITH_COCOA_QT
680VBOX_DI_VBAPP_MISC_FILES += \
681 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \
682 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \
683 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib
684endif
685
686VBOX_DI_VBAPP_SYMLINKS = \
687 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
688 Resources/VirtualBoxVM.app/Contents/Resources=>../../../Resources/ \
689 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
690 Resources/vmstarter.app/Contents/Resources=>../../../Resources/ \
691 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod))
692ifdef VBOX_WITH_COCOA_QT
693VBOX_DI_VBAPP_SYMLINKS += \
694 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Resources=>Versions/4/Resources/
695endif
696
697ifdef VBOX_WITH_PYTHON
698 # Python XPCOM glue
699 VBOX_DI_VBAPP_PYTHON_FILES = \
700 $(foreach f,$(notdir $(wildcard $(VBOX_PATH_DIST)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
701 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
702 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
703 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
704 sdk/bindings/xpcom/python/xpcom/server/factory.py \
705 sdk/bindings/xpcom/python/xpcom/server/loader.py \
706 sdk/bindings/xpcom/python/xpcom/server/module.py \
707 sdk/bindings/xpcom/python/xpcom/server/policy.py \
708 sdk/installer/vboxapisetup.py \
709 sdk/installer/vboxapi/__init__.py \
710 sdk/installer/vboxapi/VirtualBox_constants.py
711endif
712
713
714# (The dependencies are including way too much here because I'm lazy.)
715$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
716 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
717 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
718 $(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)\
719 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
720 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
721 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
722 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
723 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
724 \
725 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
726 $(VBOX_BRAND_LICENSE_TXT) \
727 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
728 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
729 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
730 \
731 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
732 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
733 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
734 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
735 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
736 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
737 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
738 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
739 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
740 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
741 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
742 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
743 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
744 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
745 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
746 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
747 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
748 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
749 $(call MSG_TOOL,PackageMaker,,,$@)
750 @# Cleanup any previously failed attempts.
751 sudo rm -Rf \
752 $@ \
753 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
754 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
755 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
756 @# Correct directory permissions are important.
757 $(MKDIR) -p \
758 $(@D) \
759 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
760 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
761 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
762 $(MKDIR) -p -m 0775 \
763 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
764 $(MKDIR) -p -m 0755 $(sort \
765 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents \
766 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS \
767 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/components \
768 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls \
769 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/accessible \
770 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources \
771 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \
772 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \
773 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app \
774 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app/Contents \
775 $(if-expr defined(VBOX_WITH_PYTHON), \
776 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \
777 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer \
778 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer/vboxapi \
779 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/ \
780 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom \
781 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python \
782 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
783 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
784 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
785 $(if-expr defined(VBOX_WITH_JXPCOM), \
786 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java,) \
787 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/,$(dir \
788 $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES) \
789 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "amd64",$(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64),) \
790 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86", $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86),) \
791 ))\
792 )
793 @# Create the .lproj language directories
794 $(MKDIR) -p -m 0755 \
795 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
796 @# Install all supported language files
797 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
798 ,$(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))
799ifdef VBOX_WITH_WEBSERVICES
800 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
801endif
802 @# Install the python stuff
803ifdef VBOX_WITH_PYTHON
804 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
805 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(f)$(NLTAB) )
806 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS
807endif
808ifdef VBOX_WITH_JXPCOM
809 $(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
810endif
811 @# Copy misc files.
812 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
813 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
814ifdef VBOX_WITH_COMBINED_PACKAGE
815 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.x86) \
816 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
817 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.amd64) \
818 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
819endif
820 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/LICENSE
821ifdef VBOX_WITH_DOCS_PACKING
822 $(foreach f,$(VBOX_ADD_MANUALS) \
823 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(NLTAB))
824endif
825 @# Create symlinks.
826ifdef VBOX_WITH_COMBINED_PACKAGE
827 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.amd64) $(VBOX_DI_VBAPP_SYMLINKS.x86) \
828 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
829else
830 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
831 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
832endif
833 @# Copy the dylibs.
834ifdef VBOX_WITH_COMBINED_PACKAGE
835 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) \
836 ,$(VBOX_DI_LIPO) -create \
837 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) \
838 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) \
839 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
840 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.x86) \
841 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
842 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.amd64) \
843 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
844else
845 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
846 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
847endif
848 @# Copy the other binaries.
849ifdef VBOX_WITH_COMBINED_PACKAGE
850 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
851 ,$(VBOX_DI_LIPO) -create \
852 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \
853 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \
854 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
855 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) \
856 ,$(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) \
857 $(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))
858else
859 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
860 ,$(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))
861endif
862 @# Copy the binaries.
863ifdef VBOX_WITH_COMBINED_PACKAGE
864 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
865 ,$(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) \
866 $(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))
867else
868 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
869 ,$(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))
870endif
871 @# Create symlinks for all the binaries (corrected by postflight and the VirtualBox StartupItem to hardlinks).
872ifdef VBOX_WITH_COMBINED_PACKAGE
873 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \
874 ,$(LN) -s $(bin)-x86 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB))
875else
876 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \
877 ,$(LN) -s $(bin)-$(KBUILD_TARGET_ARCH) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB))
878endif
879 @# Strip programs and dylibs.
880if1of ($(KBUILD_TYPE), release)
881 ifdef VBOX_WITH_COMBINED_PACKAGE
882 strip -SXru \
883 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_DYLIBS.amd64) \
884 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)) \
885 $(foreach bin, $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \
886 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin))
887 else
888 strip -SXru \
889 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
890 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)) \
891 $(foreach bin, $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \
892 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin))
893 endif
894endif
895 @## @todo Strip the .r0 and .gc modules as well?
896#ifdef VBOX_WITH_HARDENING - disabled temporarily
897if 1
898 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
899 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
900 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
901 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(NLTAB) )
902 $(foreach f, \
903 $(VBOX_DI_VBAPP_DYLIBS) \
904 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), \
905 $(VBOX_DI_VBAPP_DYLIBS.x86) \
906 $(VBOX_DI_VBAPP_DYLIBS.amd64) \
907 $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) \
908 $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \
909 ,$(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
910 $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \
911 ) \
912 ,install_name_tool \
913 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), \
914 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
915 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
916 -change $(VBOX_PATH_QT4)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
917 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
918 -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \
919 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
920 -change $(qtmod).framework/Versions/4/$(qtmod) \
921 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
922 ) \
923 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
924endif
925 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
926 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
927ifdef VBOX_WITH_HARDENING
928 ifdef VBOX_WITH_COMBINED_PACKAGE
929 sudo chmod u+s \
930 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
931 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-x86 \
932 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-amd64)
933 else
934 sudo chmod u+s \
935 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
936 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-$(KBUILD_TARGET_ARCH))
937 endif
938endif
939 @# Do keyword replacement in the package info and description files.
940 $(SED) \
941 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
942 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
943 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
944 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
945 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
946 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
947 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
948 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
949 $(VBOX_PATH_DI_SRC)/VirtualBox/Info.plist
950 $(SED) \
951 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
952 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
953 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
954 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
955 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
956 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
957 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
958 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist \
959 $(VBOX_PATH_DI_SRC)/VirtualBox/Description.plist
960 @# Copy the resources.
961 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
962 ,$(MKDIR) -p \
963 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
964 $(SED) \
965 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
966 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
967 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
968 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
969 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
970 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
971 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
972 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
973 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)$(NLTAB) \
974 )
975 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
976 @# Build the package.
977 $(VBOX_PACKAGEMAKER) -build -v \
978 -p $@ \
979 -f $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
980 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
981 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
982 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist
983 @# Cleanup
984 sudo rm -Rf \
985 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
986 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
987 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
988
989#
990# The VirtualBox CLI wrapper scripts.
991#
992$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
993 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
994 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
995 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
996 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
997 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
998 $(call MSG_TOOL,PackageMaker,,,$@)
999 @# Cleanup any previously failed attempts.
1000 sudo rm -Rf \
1001 $@ \
1002 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1003 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1004 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1005 @# Correct directory permissions are important.
1006 $(MKDIR) -p \
1007 $(@D) \
1008 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1009 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1010 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
1011 $(MKDIR) -p -m 0755 \
1012 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
1013 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin
1014 @# Generate the wrapper scripts.
1015 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox '#!/bin/bash'
1016 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
1017 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage '#!/bin/bash'
1018 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
1019 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP '#!/bin/bash'
1020 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1021 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless '#!/bin/bash'
1022 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1023ifdef VBOX_WITH_WEBSERVICES
1024 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv '#!/bin/bash'
1025 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
1026endif
1027 @# Set the correct owners and file permissions.
1028 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/*
1029 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
1030 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
1031 @# Do keyword replacement in the package info and description files.
1032 $(SED) \
1033 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1034 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1035 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1036 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1037 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1038 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1039 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1040 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1041 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Info.plist
1042 $(SED) \
1043 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1044 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1045 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1046 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1047 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1048 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1049 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1050 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist \
1051 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Description.plist
1052 @# Copy the resources.
1053 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
1054 ,$(MKDIR) -p \
1055 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
1056 $(SED) \
1057 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1058 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1059 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1060 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1061 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1062 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1063 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1064 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
1065 $(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)$(NLTAB) \
1066 )
1067 @# Build the package.
1068 $(VBOX_PACKAGEMAKER) -build -v \
1069 -p $@ \
1070 -f $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1071 -r $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1072 -i $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1073 -d $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist
1074 @# Cleanup
1075 sudo rm -Rf \
1076 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1077 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1078 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1079
1080
1081ifndef VBOX_OSE
1082 include $(VBOX_PATH_DI_SRC)/Bundle.kmk
1083endif
1084
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette