VirtualBox

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

Last change on this file since 31847 was 31682, checked in by vboxsync, 14 years ago

Installer/darwin/.kmk: use the right variable.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 54.0 KB
Line 
1# $Id: Makefile.kmk 31682 2010-08-16 09:22:39Z 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)_LICENSE_RTF) \
201 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) \
202 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS)) \
203 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
204 $(call MSG_TOOL,PackageMaker,,,$@)
205 @# Cleanup any previously failed attempts.
206 sudo rm -Rf \
207 $@ \
208 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \
209 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
210 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res
211 @# Correct directory permissions are important.
212 $(MKDIR) -p \
213 $(@D) \
214 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
215 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
216 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj
217 @# Do keyword replacement in the package info and description files.
218 $(SED) \
219 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
220 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
221 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
222 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
223 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
224 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
225 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
226 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \
227 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Info.plist
228 $(SED) \
229 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
230 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
231 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
232 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
233 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
234 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
235 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
236 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \
237 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Description.plist
238 $(SED) \
239 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
240 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
241 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
242 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
243 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
244 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
245 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
246 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Welcome.html \
247 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.html
248 @# Copy the resources.
249# $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/ReadMe.html $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/ReadMe.html
250 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.html $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Conclusion.html
251 $(SED) \
252 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
253 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
254 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
255 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Localizable.strings \
256 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
257 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/License.rtf
258 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/background.tif
259 $(INSTALL) -m 0766 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/checkforrunningvms $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/checkforrunningvms
260 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
261 $(MKDIR) -p \
262 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
263 $(SED) \
264 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
265 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
266 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
267 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
268 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.html \
269 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_HTML)$(NLTAB) \
270 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
271 $(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) \
272 $(SED) \
273 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
274 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
275 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
276 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
277 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
278 )
279 @# Build the package.
280 $(VBOX_PACKAGEMAKER) -build -v \
281 -p $@ \
282 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
283 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \
284 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \
285 -mi $(VBOX_PATH_PACK_TMP)/Packages
286 @# Copy the plugins.
287 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist $@/Contents/
288ifndef VBOX_OSE
289 $(MKDIR) -p $@/Contents/Plugins/
290ifdef VBOX_WITH_SERIALNUMBER_INSTALL
291 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist
292else
293 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist.off
294endif
295 @# Copy the Registration Pane plugin.
296 $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/
297 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist $@/Contents/Plugins/RegistrationPane.bundle/Contents/
298 $(INSTALL) -m 0644 $(TARGET_RegistrationPane) $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/
299 $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib
300 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/InfoPlist.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/
301 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/Localizable.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/
302 $(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/
303 $(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/
304 $(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/
305 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
306 $(MKDIR) -p \
307 $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
308 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/InfoPlist.strings$(NLTAB) \
309 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings$(NLTAB) \
310 )
311endif
312 @# Cleanup.
313 sudo rm -Rf \
314 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \
315 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
316 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res
317
318
319
320#
321# The VirtualBox Kernel extensions.
322#
323VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp
324ifndef VBOX_OSE
325 VBOX_DI_KEXTS_UNIVERSAL += VBoxUSB
326endif
327VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
328
329$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
330 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
331 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
332 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
333 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
334 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
335 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
336 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
337 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS) \
338 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
339 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
340 $(call MSG_TOOL,PackageMaker,,,$@)
341 @# Cleanup any previously failed attempts.
342 sudo rm -Rf \
343 $@ \
344 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
345 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
346 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
347 @# Correct directory permissions are important.
348 $(MKDIR) -p \
349 $(@D) \
350 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
351 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
352 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
353 $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
354 $(MKDIR) -p -m 0755 \
355 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions \
356 $(foreach kext,$(VBOX_DI_KEXTS), \
357 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext \
358 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
359 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
360 @# Copy the common files (Info.plist).
361 $(foreach kext,$(VBOX_DI_KEXTS), \
362 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/)
363 @# Copy the binaries, invoking lipo and strip.
364ifdef VBOX_WITH_COMBINED_PACKAGE
365 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), \
366 $(NLTAB)$(VBOX_DI_LIPO) -create \
367 $(VBOX_PATH_DIST_32)/$(kext).kext/Contents/MacOS/$(kext) \
368 $(VBOX_PATH_DIST_64)/$(kext).kext/Contents/MacOS/$(kext) \
369 -output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
370else
371 $(foreach kext,$(VBOX_DI_KEXTS), \
372 $(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/)
373endif
374if1of ($(KBUILD_TYPE), release)
375 $(foreach kext,$(VBOX_DI_KEXTS), \
376 $(NLTAB)strip -uX $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
377endif
378 @# Set the correct owners.
379 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
380 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions
381 @# Do keyword replacement in the package info and description files.
382 $(SED) \
383 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
384 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
385 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
386 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
387 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
388 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
389 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
390 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
391 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Info.plist
392 $(SED) \
393 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
394 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
395 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
396 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
397 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
398 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
399 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
400 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist \
401 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Description.plist
402 $(SED) \
403 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
404 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
405 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
406 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/ReadMe.html \
407 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/ReadMe.html
408 @# Copy the resources.
409 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/InstallationCheck $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
410 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
411 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/License.rtf
412 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
413 $(MKDIR) -p \
414 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
415 $(SED) \
416 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
417 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
418 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
419 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
420 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
421 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
422 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
423 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
424 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST)$(NLTAB) \
425 $(SED) \
426 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
427 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
428 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
429 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/ReadMe.html \
430 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML)$(NLTAB) \
431 $(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) \
432 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
433 )
434 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/English.lproj/InstallationCheck.strings $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/
435 @# Build the package.
436 $(VBOX_PACKAGEMAKER) -build -v \
437 -p $@ \
438 -f $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
439 -r $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
440 -i $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
441 -d $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist
442 @# Cleanup
443 sudo rm -Rf \
444 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
445 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
446 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
447
448
449#
450# The VirtualBox Startupitems.
451#
452$(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg: \
453 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/* \
454 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/*.lproj/*) \
455 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/* \
456 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/*.lproj/*) \
457 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
458 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST) \
459 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
460 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
461 $(call MSG_TOOL,PackageMaker,,,$@)
462 @# Cleanup any previously failed attempts.
463 sudo rm -Rf \
464 $@ \
465 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
466 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
467 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
468 @# Correct directory permissions are important.
469 $(MKDIR) -p \
470 $(@D) \
471 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
472 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
473 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj
474 $(MKDIR) -p -m 0775 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
475 $(MKDIR) -p -m 0755 \
476 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems \
477 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox \
478 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources \
479 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj
480 @# Copy the files.
481 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/StartupParameters.plist $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
482 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/VirtualBox $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
483 $(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/
484 @# Set the correct owners.
485 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
486 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems
487 @# Do keyword replacement in the package info and description files.
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/Info.plist \
497 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Info.plist
498 $(SED) \
499 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
500 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
501 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
502 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
503 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
504 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
505 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
506 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist \
507 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Description.plist
508 @# Copy the resources.
509 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj/License.rtf
510 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
511 $(MKDIR) -p \
512 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
513 $(SED) \
514 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
515 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
516 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
517 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
518 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
519 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
520 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
521 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
522 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)$(NLTAB) \
523 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
524 )
525 @# Build the package.
526 $(VBOX_PACKAGEMAKER) -build -v \
527 -p $@ \
528 -f $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
529 -r $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
530 -i $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
531 -d $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist
532 @# Cleanup
533 sudo rm -Rf \
534 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
535 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
536 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
537
538
539#
540# Figure out which languages that we support and construct
541# .qm and .lproj lists for these.
542#
543include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
544VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
545VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
546
547
548#
549# The VirtualBox Application.
550#
551VBOX_DI_VBAPP_QTMODS = \
552 QtCore QtGui QtNetwork
553
554ifdef VBOX_GUI_USE_QGL
555 VBOX_DI_VBAPP_QTMODS += QtOpenGL
556endif
557
558VBOX_DI_VBAPP_DYLIBS = \
559 $(foreach qtmod, $(VBOX_DI_VBAPP_QTMODS), Frameworks/$(qtmod)VBox.framework/Versions/4/$(qtmod)VBox) \
560 MacOS/VBoxDD.dylib \
561 MacOS/VBoxDD2.dylib \
562 MacOS/VBoxDDU.dylib \
563 MacOS/VBoxREM.dylib \
564 MacOS/VBoxRT.dylib \
565 MacOS/VBoxSharedFolders.dylib \
566 MacOS/VBoxSharedClipboard.dylib \
567 MacOS/VBoxGuestPropSvc.dylib \
568 MacOS/VBoxVMM.dylib \
569 MacOS/VBoxXPCOM.dylib \
570 MacOS/VBoxXPCOMC.dylib \
571 MacOS/components/VBoxC.dylib \
572 MacOS/components/VBoxSVCM.dylib \
573 MacOS/components/VBoxXPCOMIPCC.dylib \
574 MacOS/accessible/libqtaccessiblewidgets.dylib
575ifdef VBOX_WITH_GUEST_CONTROL
576 VBOX_DI_VBAPP_DYLIBS += \
577 MacOS/VBoxGuestControlSvc.dylib
578endif
579ifdef VBOX_WITH_VRDP
580 VBOX_DI_VBAPP_DYLIBS += \
581 MacOS/VBoxVRDP.dylib \
582 MacOS/VRDPAuth.dylib \
583 MacOS/VRDPAuthSimple.dylib
584endif
585ifdef VBOX_WITH_CROGL
586 VBOX_DI_VBAPP_DYLIBS += \
587 MacOS/VBoxOGLhostcrutil.dylib \
588 MacOS/VBoxOGLhosterrorspu.dylib \
589 MacOS/VBoxOGLrenderspu.dylib \
590 MacOS/VBoxSharedCrOpenGL.dylib
591endif
592ifdef VBOX_WITH_DEBUGGER_GUI
593 VBOX_DI_VBAPP_DYLIBS += \
594 MacOS/VBoxDbg.dylib
595endif
596ifdef VBOX_WITH_HARDENING
597 VBOX_DI_VBAPP_DYLIBS += \
598 MacOS/VirtualBox.dylib \
599 MacOS/VBoxNetDHCP.dylib \
600 MacOS/VBoxHeadless.dylib
601endif
602ifdef VBOX_WITH_HDDPARALLELS_INSTALL
603 VBOX_DI_VBAPP_DYLIBS += \
604 MacOS/VBoxHDDParallels.dylib
605endif
606if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
607 VBOX_DI_VBAPP_DYLIBS += \
608 MacOS/VBoxPython2_6.so
609endif
610
611VBOX_DI_VBAPP_DYLIBS.x86 := \
612 MacOS/VBoxREM32.dylib \
613 MacOS/VBoxREM64.dylib
614ifdef VBOX_WITH_PYTHON
615 VBOX_DI_VBAPP_DYLIBS.x86 += \
616 MacOS/VBoxPython2_5.so \
617 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
618endif
619
620VBOX_DI_VBAPP_DYLIBS.amd64 :=
621if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
622 VBOX_DI_VBAPP_DYLIBS.amd64 += \
623 MacOS/VBoxPython2_6.so
624endif
625
626if defined(VBOX_WITH_JXPCOM)
627 VBOX_DI_VBAPP_DYLIBS += \
628 MacOS/libvboxjxpcom.jnilib
629endif
630
631if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
632 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
633endif
634if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
635 $(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))
636endif
637
638VBOX_DI_VBAPP_PROGS = \
639 MacOS/VBoxManage \
640 MacOS/VBoxSVC \
641 MacOS/VBoxHeadless \
642 MacOS/VBoxXPCOMIPCD \
643 MacOS/VirtualBox \
644 MacOS/VirtualBoxVM \
645 MacOS/VBoxNetAdpCtl \
646 MacOS/VBoxNetDHCP
647ifdef VBOX_WITH_WEBSERVICES
648 VBOX_DI_VBAPP_PROGS += \
649 MacOS/vboxwebsrv
650endif
651
652VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
653 MacOS/VMMR0.r0 \
654 MacOS/VBoxDDR0.r0 \
655 MacOS/VBoxDD2R0.r0
656
657VBOX_DI_VBAPP_OTHER_BINS = \
658 MacOS/VMMGC.gc \
659 MacOS/VBoxDDGC.gc \
660 MacOS/VBoxDD2GC.gc
661
662VBOX_DI_VBAPP_MISC_FILES = \
663 Resources/VirtualBoxVM.app/Contents/Info.plist \
664 Resources/VirtualBoxVM.app/Contents/PkgInfo \
665 Info.plist \
666 PkgInfo \
667 Resources/virtualbox.icns \
668 MacOS/components/VBoxXPCOMBase.xpt \
669 MacOS/components/VirtualBox_XPCOM.xpt
670ifdef VBOX_WITH_DOCS_PACKING
671VBOX_DI_VBAPP_MISC_FILES += \
672 MacOS/UserManual.pdf
673endif
674ifdef VBOX_WITH_ADDITIONS_PACKING
675VBOX_DI_VBAPP_MISC_FILES += \
676 MacOS/VBoxGuestAdditions.iso
677endif
678ifdef VBOX_WITH_EFIFW_PACKING
679VBOX_DI_VBAPP_MISC_FILES += \
680 MacOS/VBoxEFI32.fd \
681 MacOS/VBoxEFI64.fd
682endif
683ifdef VBOX_WITH_COCOA_QT
684VBOX_DI_VBAPP_MISC_FILES += \
685 Frameworks/QtGuiVBox.framework/Versions/4/Resources/qt_menu.nib/classes.nib \
686 Frameworks/QtGuiVBox.framework/Versions/4/Resources/qt_menu.nib/info.nib \
687 Frameworks/QtGuiVBox.framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib
688endif
689
690VBOX_DI_VBAPP_SYMLINKS = \
691 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
692 Resources/VirtualBoxVM.app/Contents/Resources=>../../../Resources/ \
693 $(foreach qtmod, $(VBOX_DI_VBAPP_QTMODS), Frameworks/$(qtmod)VBox.framework/$(qtmod)VBox=>Versions/4/$(qtmod)VBox)
694ifdef VBOX_WITH_COCOA_QT
695VBOX_DI_VBAPP_SYMLINKS += \
696 Frameworks/QtGuiVBox.framework/Resources=>Versions/4/Resources/
697endif
698
699ifdef VBOX_WITH_PYTHON
700 # Python XPCOM glue
701 VBOX_DI_VBAPP_PYTHON_FILES = \
702 $(foreach f,$(notdir $(wildcard $(VBOX_PATH_DIST)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
703 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
704 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
705 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
706 sdk/bindings/xpcom/python/xpcom/server/factory.py \
707 sdk/bindings/xpcom/python/xpcom/server/loader.py \
708 sdk/bindings/xpcom/python/xpcom/server/module.py \
709 sdk/bindings/xpcom/python/xpcom/server/policy.py \
710 sdk/installer/vboxapisetup.py \
711 sdk/installer/vboxapi/__init__.py \
712 sdk/installer/vboxapi/VirtualBox_constants.py
713endif
714
715
716# (The dependencies are including way too much here because I'm lazy.)
717$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
718 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
719 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST) \
720 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
721 $(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)\
722 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
723 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
724 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
725 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
726 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
727 \
728 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
729 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
730 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
731 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
732 \
733 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
734 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
735 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
736 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
737 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
738 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
739 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
740 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
741 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
742 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
743 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
744 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
745 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
746 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
747 $(call MSG_TOOL,PackageMaker,,,$@)
748 @# Cleanup any previously failed attempts.
749 sudo rm -Rf \
750 $@ \
751 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
752 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
753 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
754 @# Correct directory permissions are important.
755 $(MKDIR) -p \
756 $(@D) \
757 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
758 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
759 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
760 $(MKDIR) -p -m 0775 \
761 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
762 $(MKDIR) -p -m 0755 $(sort \
763 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents \
764 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS \
765 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/components \
766 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls \
767 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/accessible \
768 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources \
769 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \
770 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \
771 $(if-expr defined(VBOX_WITH_PYTHON), \
772 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \
773 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer \
774 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer/vboxapi \
775 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/ \
776 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom \
777 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python \
778 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
779 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
780 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
781 $(if-expr defined(VBOX_WITH_JXPCOM), \
782 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java,) \
783 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/,$(dir \
784 $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES) \
785 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "amd64",$(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64),) \
786 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86", $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86),) \
787 ))\
788 )
789 @# Create the .lproj language directories
790 $(MKDIR) -p -m 0755 \
791 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
792 @# Install all supported language files
793 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
794 ,$(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))
795 @# Install the python stuff
796ifdef VBOX_WITH_PYTHON
797 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
798 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(f)$(NLTAB) )
799 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS
800endif
801ifdef VBOX_WITH_JXPCOM
802 $(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
803endif
804 @# Copy misc files.
805 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
806 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
807ifdef VBOX_WITH_COMBINED_PACKAGE
808 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.x86) \
809 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
810 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.amd64) \
811 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
812endif
813ifdef VBOX_WITH_DOCS_PACKING
814 $(foreach f,$(VBOX_ADD_MANUALS) \
815 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(NLTAB))
816endif
817 @# Create symlinks.
818ifdef VBOX_WITH_COMBINED_PACKAGE
819 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.amd64) $(VBOX_DI_VBAPP_SYMLINKS.x86) \
820 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
821else
822 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
823 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
824endif
825 @# Copy the dylibs.
826ifdef VBOX_WITH_COMBINED_PACKAGE
827 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) \
828 ,$(VBOX_DI_LIPO) -create \
829 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) \
830 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) \
831 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
832 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.x86) \
833 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
834 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.amd64) \
835 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
836else
837 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
838 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
839endif
840 @# Copy the other binaries.
841ifdef VBOX_WITH_COMBINED_PACKAGE
842 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
843 ,$(VBOX_DI_LIPO) -create \
844 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \
845 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \
846 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
847 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) \
848 ,$(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) \
849 $(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))
850else
851 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
852 ,$(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))
853endif
854 @# Copy the binaries.
855ifdef VBOX_WITH_COMBINED_PACKAGE
856 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
857 ,$(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) \
858 $(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))
859else
860 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
861 ,$(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))
862endif
863 @# Create symlinks for all the binaries (corrected by postflight and the VirtualBox StartupItem to hardlinks).
864ifdef VBOX_WITH_COMBINED_PACKAGE
865 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \
866 ,$(LN) -s $(bin)-x86 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB))
867else
868 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \
869 ,$(LN) -s $(bin)-$(KBUILD_TARGET_ARCH) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB))
870endif
871 @# Strip programs and dylibs.
872if1of ($(KBUILD_TYPE), release)
873 ifdef VBOX_WITH_COMBINED_PACKAGE
874 strip -SXru \
875 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_DYLIBS.amd64) \
876 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)) \
877 $(foreach bin, $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \
878 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin))
879 else
880 strip -SXru \
881 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
882 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)) \
883 $(foreach bin, $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \
884 ,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin))
885 endif
886endif
887 @## @todo Strip the .r0 and .gc modules as well?
888#ifdef VBOX_WITH_HARDENING - disabled temporarily
889if 1
890 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
891 $(foreach qtmod, $(VBOX_DI_VBAPP_QTMODS) \
892 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod)VBox.framework/Versions/4/$(qtmod)VBox \
893 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Frameworks/$(qtmod)VBox.framework/Versions/4/$(qtmod)VBox$(NLTAB) )
894 $(foreach f, \
895 $(VBOX_DI_VBAPP_DYLIBS) \
896 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), \
897 $(VBOX_DI_VBAPP_DYLIBS.x86) \
898 $(VBOX_DI_VBAPP_DYLIBS.amd64) \
899 $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) \
900 $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \
901 ,$(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
902 $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \
903 ) \
904 ,install_name_tool \
905 $(foreach qtmod, $(VBOX_DI_VBAPP_QTMODS), \
906 -change @executable_path/../Frameworks/$(qtmod)VBox.framework/Versions/4/$(qtmod)VBox \
907 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod)VBox.framework/Versions/4/$(qtmod)VBox \
908 -change $(qtmod)VBox.framework/Versions/4/$(qtmod)VBox \
909 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod)VBox.framework/Versions/4/$(qtmod)VBox \
910 ) \
911 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
912endif
913 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
914 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
915ifdef VBOX_WITH_HARDENING
916 ifdef VBOX_WITH_COMBINED_PACKAGE
917 sudo chmod u+s \
918 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
919 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-x86 \
920 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-amd64)
921 else
922 sudo chmod u+s \
923 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
924 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-$(KBUILD_TARGET_ARCH))
925 endif
926endif
927 @# Do keyword replacement in the package info and description files.
928 $(SED) \
929 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
930 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
931 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
932 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
933 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
934 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
935 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
936 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
937 $(VBOX_PATH_DI_SRC)/VirtualBox/Info.plist
938 $(SED) \
939 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
940 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
941 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
942 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
943 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
944 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
945 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
946 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist \
947 $(VBOX_PATH_DI_SRC)/VirtualBox/Description.plist
948 @# Copy the resources.
949 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj/License.rtf
950 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
951 ,$(MKDIR) -p \
952 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
953 $(SED) \
954 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
955 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
956 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
957 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
958 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
959 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
960 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
961 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
962 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)$(NLTAB) \
963 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
964 )
965 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
966 @# Build the package.
967 $(VBOX_PACKAGEMAKER) -build -v \
968 -p $@ \
969 -f $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
970 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
971 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
972 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist
973 @# Cleanup
974 sudo rm -Rf \
975 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
976 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
977 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
978
979#
980# The VirtualBox CLI wrapper scripts.
981#
982$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
983 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
984 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
985 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
986 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST) \
987 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
988 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
989 $(call MSG_TOOL,PackageMaker,,,$@)
990 @# Cleanup any previously failed attempts.
991 sudo rm -Rf \
992 $@ \
993 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
994 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
995 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
996 @# Correct directory permissions are important.
997 $(MKDIR) -p \
998 $(@D) \
999 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1000 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1001 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
1002 $(MKDIR) -p -m 0755 \
1003 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
1004 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin
1005 @# Generate the wrapper scripts.
1006 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox '#!/bin/bash'
1007 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
1008 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage '#!/bin/bash'
1009 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
1010 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP '#!/bin/bash'
1011 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1012 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless '#!/bin/bash'
1013 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1014ifdef VBOX_WITH_WEBSERVICES
1015 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv '#!/bin/bash'
1016 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
1017endif
1018 @# Set the correct owners and file permissions.
1019 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/*
1020 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
1021 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
1022 @# Do keyword replacement in the package info and description files.
1023 $(SED) \
1024 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1025 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1026 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1027 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1028 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1029 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1030 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1031 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1032 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Info.plist
1033 $(SED) \
1034 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1035 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1036 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1037 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1038 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1039 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1040 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1041 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist \
1042 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Description.plist
1043 @# Copy the resources.
1044 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj/License.rtf
1045 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
1046 ,$(MKDIR) -p \
1047 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
1048 $(SED) \
1049 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1050 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1051 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1052 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1053 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1054 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1055 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1056 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
1057 $(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)$(NLTAB) \
1058 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
1059 )
1060 @# Build the package.
1061 $(VBOX_PACKAGEMAKER) -build -v \
1062 -p $@ \
1063 -f $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1064 -r $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1065 -i $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1066 -d $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist
1067 @# Cleanup
1068 sudo rm -Rf \
1069 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1070 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1071 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1072
1073
1074ifndef VBOX_OSE
1075 include $(VBOX_PATH_DI_SRC)/Bundle.kmk
1076endif
1077
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