VirtualBox

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

Last change on this file since 32817 was 32012, checked in by vboxsync, 14 years ago

Installer: unify Qt4 module handling

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 54.7 KB
Line 
1# $Id: Makefile.kmk 32012 2010-08-26 18:23:16Z 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 VBoxUSB
324VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
325
326$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
327 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
328 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
329 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
330 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
331 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
332 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
333 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
334 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS) \
335 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
336 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
337 $(call MSG_TOOL,PackageMaker,,,$@)
338 @# Cleanup any previously failed attempts.
339 sudo rm -Rf \
340 $@ \
341 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
342 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
343 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
344 @# Correct directory permissions are important.
345 $(MKDIR) -p \
346 $(@D) \
347 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
348 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
349 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
350 $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
351 $(MKDIR) -p -m 0755 \
352 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions \
353 $(foreach kext,$(VBOX_DI_KEXTS), \
354 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext \
355 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
356 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
357 @# Copy the common files (Info.plist).
358 $(foreach kext,$(VBOX_DI_KEXTS), \
359 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/)
360 @# Copy the binaries, invoking lipo and strip.
361ifdef VBOX_WITH_COMBINED_PACKAGE
362 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), \
363 $(NLTAB)$(VBOX_DI_LIPO) -create \
364 $(VBOX_PATH_DIST_32)/$(kext).kext/Contents/MacOS/$(kext) \
365 $(VBOX_PATH_DIST_64)/$(kext).kext/Contents/MacOS/$(kext) \
366 -output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
367else
368 $(foreach kext,$(VBOX_DI_KEXTS), \
369 $(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/)
370endif
371if1of ($(KBUILD_TYPE), release)
372 $(foreach kext,$(VBOX_DI_KEXTS), \
373 $(NLTAB)strip -uX $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
374endif
375 @# Set the correct owners.
376 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
377 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions
378 @# Do keyword replacement in the package info and description files.
379 $(SED) \
380 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
381 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
382 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
383 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
384 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
385 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
386 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
387 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
388 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Info.plist
389 $(SED) \
390 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
391 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
392 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
393 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
394 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
395 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
396 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
397 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist \
398 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Description.plist
399 $(SED) \
400 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
401 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
402 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
403 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/ReadMe.html \
404 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/ReadMe.html
405 @# Copy the resources.
406 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/InstallationCheck $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
407 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
408 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/License.rtf
409 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
410 $(MKDIR) -p \
411 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
412 $(SED) \
413 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
414 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
415 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
416 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
417 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
418 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
419 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
420 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
421 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST)$(NLTAB) \
422 $(SED) \
423 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
424 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
425 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
426 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/ReadMe.html \
427 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML)$(NLTAB) \
428 $(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) \
429 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
430 )
431 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/English.lproj/InstallationCheck.strings $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/
432 @# Build the package.
433 $(VBOX_PACKAGEMAKER) -build -v \
434 -p $@ \
435 -f $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
436 -r $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
437 -i $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
438 -d $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist
439 @# Cleanup
440 sudo rm -Rf \
441 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
442 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
443 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
444
445
446#
447# The VirtualBox Startupitems.
448#
449$(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg: \
450 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/* \
451 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/*.lproj/*) \
452 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/* \
453 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/*.lproj/*) \
454 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
455 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST) \
456 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
457 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
458 $(call MSG_TOOL,PackageMaker,,,$@)
459 @# Cleanup any previously failed attempts.
460 sudo rm -Rf \
461 $@ \
462 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
463 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
464 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
465 @# Correct directory permissions are important.
466 $(MKDIR) -p \
467 $(@D) \
468 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
469 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
470 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj
471 $(MKDIR) -p -m 0775 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
472 $(MKDIR) -p -m 0755 \
473 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems \
474 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox \
475 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources \
476 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj
477 @# Copy the files.
478 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/StartupParameters.plist $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
479 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/VirtualBox $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
480 $(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/
481 @# Set the correct owners.
482 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
483 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems
484 @# Do keyword replacement in the package info and description files.
485 $(SED) \
486 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
487 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
488 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
489 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
490 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
491 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
492 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
493 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
494 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Info.plist
495 $(SED) \
496 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
497 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
498 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
499 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
500 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
501 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
502 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
503 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist \
504 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Description.plist
505 @# Copy the resources.
506 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj/License.rtf
507 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
508 $(MKDIR) -p \
509 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
510 $(SED) \
511 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
512 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
513 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
514 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
515 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
516 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
517 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
518 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
519 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)$(NLTAB) \
520 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
521 )
522 @# Build the package.
523 $(VBOX_PACKAGEMAKER) -build -v \
524 -p $@ \
525 -f $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
526 -r $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
527 -i $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
528 -d $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist
529 @# Cleanup
530 sudo rm -Rf \
531 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
532 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
533 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
534
535
536#
537# Figure out which languages that we support and construct
538# .qm and .lproj lists for these.
539#
540include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
541VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
542VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
543
544
545#
546# The VirtualBox Application.
547#
548
549VBOX_DI_VBAPP_DYLIBS = \
550 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \
551 MacOS/VBoxDD.dylib \
552 MacOS/VBoxDD2.dylib \
553 MacOS/VBoxDDU.dylib \
554 MacOS/VBoxREM.dylib \
555 MacOS/VBoxRT.dylib \
556 MacOS/VBoxSharedFolders.dylib \
557 MacOS/VBoxSharedClipboard.dylib \
558 MacOS/VBoxGuestPropSvc.dylib \
559 MacOS/VBoxVMM.dylib \
560 MacOS/VBoxXPCOM.dylib \
561 MacOS/VBoxXPCOMC.dylib \
562 MacOS/components/VBoxC.dylib \
563 MacOS/components/VBoxSVCM.dylib \
564 MacOS/components/VBoxXPCOMIPCC.dylib
565ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
566 VBOX_DI_VBAPP_DYLIBS += \
567 MacOS/accessible/libqtaccessiblewidgets.dylib
568endif
569ifdef VBOX_WITH_GUEST_CONTROL
570 VBOX_DI_VBAPP_DYLIBS += \
571 MacOS/VBoxGuestControlSvc.dylib
572endif
573ifdef VBOX_WITH_VRDP
574 VBOX_DI_VBAPP_DYLIBS += \
575 MacOS/VBoxVRDP.dylib \
576 MacOS/VRDPAuth.dylib \
577 MacOS/VRDPAuthSimple.dylib
578endif
579ifdef VBOX_WITH_CROGL
580 VBOX_DI_VBAPP_DYLIBS += \
581 MacOS/VBoxOGLhostcrutil.dylib \
582 MacOS/VBoxOGLhosterrorspu.dylib \
583 MacOS/VBoxOGLrenderspu.dylib \
584 MacOS/VBoxSharedCrOpenGL.dylib
585endif
586ifdef VBOX_WITH_DEBUGGER_GUI
587 VBOX_DI_VBAPP_DYLIBS += \
588 MacOS/VBoxDbg.dylib
589endif
590ifdef VBOX_WITH_HARDENING
591 VBOX_DI_VBAPP_DYLIBS += \
592 MacOS/VirtualBox.dylib \
593 MacOS/VBoxNetDHCP.dylib \
594 MacOS/VBoxHeadless.dylib
595endif
596ifdef VBOX_WITH_HDDPARALLELS_INSTALL
597 VBOX_DI_VBAPP_DYLIBS += \
598 MacOS/VBoxHDDParallels.dylib
599endif
600if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
601 VBOX_DI_VBAPP_DYLIBS += \
602 MacOS/VBoxPython2_6.so
603endif
604
605VBOX_DI_VBAPP_DYLIBS.x86 := \
606 MacOS/VBoxREM32.dylib \
607 MacOS/VBoxREM64.dylib
608ifdef VBOX_WITH_PYTHON
609 VBOX_DI_VBAPP_DYLIBS.x86 += \
610 MacOS/VBoxPython2_5.so \
611 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
612endif
613
614VBOX_DI_VBAPP_DYLIBS.amd64 :=
615if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
616 VBOX_DI_VBAPP_DYLIBS.amd64 += \
617 MacOS/VBoxPython2_6.so
618endif
619
620if defined(VBOX_WITH_JXPCOM)
621 VBOX_DI_VBAPP_DYLIBS += \
622 MacOS/libvboxjxpcom.jnilib
623endif
624
625if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
626 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
627endif
628if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
629 $(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))
630endif
631
632VBOX_DI_VBAPP_PROGS = \
633 MacOS/VBoxManage \
634 MacOS/VBoxSVC \
635 MacOS/VBoxHeadless \
636 MacOS/VBoxXPCOMIPCD \
637 MacOS/VirtualBox \
638 MacOS/VirtualBoxVM \
639 MacOS/VBoxNetAdpCtl \
640 MacOS/VBoxNetDHCP
641ifdef VBOX_WITH_WEBSERVICES
642 VBOX_DI_VBAPP_PROGS += \
643 MacOS/vboxwebsrv
644endif
645
646VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
647 MacOS/VMMR0.r0 \
648 MacOS/VBoxDDR0.r0 \
649 MacOS/VBoxDD2R0.r0
650
651VBOX_DI_VBAPP_OTHER_BINS = \
652 MacOS/VMMGC.gc \
653 MacOS/VBoxDDGC.gc \
654 MacOS/VBoxDD2GC.gc
655
656VBOX_DI_VBAPP_MISC_FILES = \
657 Resources/VirtualBoxVM.app/Contents/Info.plist \
658 Resources/VirtualBoxVM.app/Contents/PkgInfo \
659 Info.plist \
660 PkgInfo \
661 Resources/virtualbox.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 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod))
690ifdef VBOX_WITH_COCOA_QT
691VBOX_DI_VBAPP_SYMLINKS += \
692 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Resources=>Versions/4/Resources/
693endif
694
695ifdef VBOX_WITH_PYTHON
696 # Python XPCOM glue
697 VBOX_DI_VBAPP_PYTHON_FILES = \
698 $(foreach f,$(notdir $(wildcard $(VBOX_PATH_DIST)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
699 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
700 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
701 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
702 sdk/bindings/xpcom/python/xpcom/server/factory.py \
703 sdk/bindings/xpcom/python/xpcom/server/loader.py \
704 sdk/bindings/xpcom/python/xpcom/server/module.py \
705 sdk/bindings/xpcom/python/xpcom/server/policy.py \
706 sdk/installer/vboxapisetup.py \
707 sdk/installer/vboxapi/__init__.py \
708 sdk/installer/vboxapi/VirtualBox_constants.py
709endif
710
711
712# (The dependencies are including way too much here because I'm lazy.)
713$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
714 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
715 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST) \
716 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
717 $(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)\
718 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
719 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
720 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
721 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
722 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
723 \
724 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
725 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
726 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
727 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
728 \
729 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
730 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
731 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
732 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
733 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
734 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
735 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
736 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
737 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
738 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
739 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
740 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
741 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
742 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
743 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
744 $(call MSG_TOOL,PackageMaker,,,$@)
745 @# Cleanup any previously failed attempts.
746 sudo rm -Rf \
747 $@ \
748 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
749 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
750 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
751 @# Correct directory permissions are important.
752 $(MKDIR) -p \
753 $(@D) \
754 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
755 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
756 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
757 $(MKDIR) -p -m 0775 \
758 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
759 $(MKDIR) -p -m 0755 $(sort \
760 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents \
761 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS \
762 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/components \
763 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls \
764 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/accessible \
765 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources \
766 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \
767 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \
768 $(if-expr defined(VBOX_WITH_PYTHON), \
769 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \
770 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer \
771 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer/vboxapi \
772 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/ \
773 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom \
774 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python \
775 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
776 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
777 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
778 $(if-expr defined(VBOX_WITH_JXPCOM), \
779 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java,) \
780 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/,$(dir \
781 $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES) \
782 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "amd64",$(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64),) \
783 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86", $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86),) \
784 ))\
785 )
786 @# Create the .lproj language directories
787 $(MKDIR) -p -m 0755 \
788 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
789 @# Install all supported language files
790 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
791 ,$(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))
792ifdef VBOX_WITH_WEBSERVICES
793 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
794endif
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_QT4_MOD_NAMES) \
892 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
893 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(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_QT4_MOD_NAMES), \
906 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
907 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
908 -change $(VBOX_PATH_QT4)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
909 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
910 -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \
911 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
912 -change $(qtmod).framework/Versions/4/$(qtmod) \
913 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
914 ) \
915 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
916endif
917 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
918 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
919ifdef VBOX_WITH_HARDENING
920 ifdef VBOX_WITH_COMBINED_PACKAGE
921 sudo chmod u+s \
922 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
923 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-x86 \
924 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-amd64)
925 else
926 sudo chmod u+s \
927 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
928 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-$(KBUILD_TARGET_ARCH))
929 endif
930endif
931 @# Do keyword replacement in the package info and description files.
932 $(SED) \
933 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
934 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
935 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
936 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
937 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
938 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
939 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
940 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
941 $(VBOX_PATH_DI_SRC)/VirtualBox/Info.plist
942 $(SED) \
943 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
944 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
945 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
946 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
947 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
948 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
949 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
950 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist \
951 $(VBOX_PATH_DI_SRC)/VirtualBox/Description.plist
952 @# Copy the resources.
953 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj/License.rtf
954 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
955 ,$(MKDIR) -p \
956 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
957 $(SED) \
958 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
959 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
960 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
961 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
962 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
963 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
964 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
965 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
966 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)$(NLTAB) \
967 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
968 )
969 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
970 @# Build the package.
971 $(VBOX_PACKAGEMAKER) -build -v \
972 -p $@ \
973 -f $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
974 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
975 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
976 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist
977 @# Cleanup
978 sudo rm -Rf \
979 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
980 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
981 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
982
983#
984# The VirtualBox CLI wrapper scripts.
985#
986$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
987 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
988 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
989 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
990 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST) \
991 $(VBOX_BRAND_$(f)_LICENSE_RTF)) \
992 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
993 $(call MSG_TOOL,PackageMaker,,,$@)
994 @# Cleanup any previously failed attempts.
995 sudo rm -Rf \
996 $@ \
997 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
998 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
999 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1000 @# Correct directory permissions are important.
1001 $(MKDIR) -p \
1002 $(@D) \
1003 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1004 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1005 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
1006 $(MKDIR) -p -m 0755 \
1007 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
1008 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin
1009 @# Generate the wrapper scripts.
1010 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox '#!/bin/bash'
1011 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
1012 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage '#!/bin/bash'
1013 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
1014 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP '#!/bin/bash'
1015 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1016 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless '#!/bin/bash'
1017 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1018ifdef VBOX_WITH_WEBSERVICES
1019 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv '#!/bin/bash'
1020 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
1021endif
1022 @# Set the correct owners and file permissions.
1023 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/*
1024 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
1025 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
1026 @# Do keyword replacement in the package info and description files.
1027 $(SED) \
1028 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1029 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1030 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1031 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1032 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1033 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1034 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1035 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1036 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Info.plist
1037 $(SED) \
1038 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1039 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1040 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1041 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1042 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1043 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1044 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1045 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist \
1046 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Description.plist
1047 @# Copy the resources.
1048 $(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj/License.rtf
1049 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
1050 ,$(MKDIR) -p \
1051 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
1052 $(SED) \
1053 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1054 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1055 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1056 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1057 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1058 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1059 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1060 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
1061 $(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)$(NLTAB) \
1062 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_LICENSE_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/License.rtf$(NLTAB) \
1063 )
1064 @# Build the package.
1065 $(VBOX_PACKAGEMAKER) -build -v \
1066 -p $@ \
1067 -f $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1068 -r $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1069 -i $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1070 -d $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist
1071 @# Cleanup
1072 sudo rm -Rf \
1073 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1074 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1075 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1076
1077
1078ifndef VBOX_OSE
1079 include $(VBOX_PATH_DI_SRC)/Bundle.kmk
1080endif
1081
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