VirtualBox

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

Last change on this file since 34714 was 34684, checked in by vboxsync, 14 years ago

Installer-OSX: install VBoxExtPackHelperApp

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