VirtualBox

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

Last change on this file since 56284 was 56284, checked in by vboxsync, 9 years ago

s/VMMGC.gc/VMMRC.rc/g s/VBoxDDGC.gc/VBoxDDRC.rc/g s/VBoxDD2GC.gc/VBoxDD2RC.rc/g

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 40.4 KB
Line 
1# $Id: Makefile.kmk 56284 2015-06-09 10:46:34Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X.
4#
5
6#
7# Copyright (C) 2006-2012 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#
23# Globals
24#
25VBOX_PATH_DI_SRC := $(PATH_SUB_CURRENT)
26VBOX_DI_OUT_DIR := $(PATH_TARGET)/Installer/darwin
27BLDDIRS += $(VBOX_DI_OUT_DIR)
28
29VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST)/$1
30ifeq ($(KBUILD_TARGET_ARCH),x86)
31 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST)/$1
32 VBOX_DI_FN_DEP_64 =
33else
34 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST)/$1
35 VBOX_DI_FN_DEP_32 =
36endif
37VBOX_PATH_DIST_OTHER = $(error VBOX_PATH_DIST_OTHER used in a non-combined package deal)
38
39# Unset this to speed up things during makefile hacking.
40VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
41
42# The location of the pkgbuild program.
43ifndef VBOX_PKGBUILD
44 VBOX_PKGBUILD := pkgbuild
45endif
46
47# The location of the productbuild program.
48ifndef VBOX_PRODUCTBUILD
49 VBOX_PRODUCTBUILD := productbuild
50endif
51
52# Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
53ifndef VBOX_PATH_PACK_TMP
54 VBOX_PATH_PACK_TMP := $(VBOX_DI_OUT_DIR)
55endif
56
57# Shorthand for $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app
58VBOX_PATH_VBOX_APP_TMP := $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app
59
60
61#
62# Install the darwin docs/license.
63#
64INSTALLS += darwin-docs
65darwin-docs_INST = $(INST_DIST)
66darwin-docs_MODE = a+r,u+w
67darwin-docs_SOURCES = \
68 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
69
70
71#
72# The packing.
73#
74PACKING += $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg
75#OTHER_CLEAN = TODO
76
77
78include $(FILE_KBUILD_SUB_FOOTER)
79
80
81#
82# We're running commands as root here, take some care and assertion
83# a sane environment.
84#
85ifeq ($(strip $(VBOX_PATH_DIST)),)
86 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
87endif
88ifeq ($(strip $(VBOX_PATH_DIST)),/)
89 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
90endif
91ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
92 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
93endif
94ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
95 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
96endif
97
98
99# Check for additional manuals
100VBOX_ADD_MANUALS := $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_$(f).pdf)
101
102VBOX_ADD_MANUAL_de_DE := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_de_DE.pdf,$(VBOX_ADD_MANUALS))
103VBOX_ADD_MANUAL_fr_FR := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_fr_FR.pdf,$(VBOX_ADD_MANUALS))
104
105#
106# The disk image.
107#
108$(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg: \
109 $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg \
110 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \
111 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \
112 $$(wildcard $(VBOX_PATH_DI_SRC)/DiskImage/*) \
113 $(if $(VBOX_WITH_DOCS_PACKING), \
114 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf \
115 $(VBOX_ADD_MANUALS)) \
116 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
117 $(call MSG_TOOL,hdiutil,,,$@)
118 @# Cleanup any previously failed attempts and various trash.
119 sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp
120 $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
121 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
122 sudo rm -Rf \
123 $@ \
124 $(VBOX_PATH_PACK_TMP)/DiskImage/
125 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage
126 @# Remove .dmg packages from old depend builds
127 $(QUIET)$(RM) -f $(wildcard $(VBOX_PATH_DIST)/VirtualBox-*-r*.dmg)
128 @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO)
129 $(INSTALL) $(VBOX_PATH_DI_SRC)/DiskImage/VirtualBox_Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/
130if defined(VBOX_SIGNING_MODE) && defined(VBOX_NOT_OSX_105)
131 $(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox_Uninstall.tool,org.virtualbox.dmg.uninstaller)
132endif
133ifeq (1,1)
134 @# Pedantic mode...
135 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store
136 $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background
137 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff
138 ifdef VBOX_WITH_BUNDLED_INSTALLER
139 $(if $(VBOX_WITH_DOCS_PACKING), \
140 $(INSTALL) -m 644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/User\ Manual.pdf$(NLTAB) \
141 $(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)) \
142 $(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)))
143 # Rename the main package
144 else
145 $(if $(VBOX_WITH_DOCS_PACKING), $(INSTALL) $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/)
146 $(LN) -s /Applications/ $(VBOX_PATH_PACK_TMP)/DiskImage/Applications
147 endif
148endif
149 @# Change the owners.
150 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
151 @# Create the image.
152 sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" "$@"
153 @# Change (back) the owner so it can be deleted by the user.
154 sudo chown "$(shell whoami)" "$@"
155 sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
156
157#
158# The meta-package.
159#
160$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg: \
161 $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \
162 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
163 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \
164 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
165 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
166 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
167 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
168 $(call MSG_TOOL,productbuild,,,$@)
169 @# Cleanup any previously failed attempts.
170 sudo rm -Rf \
171 $@ \
172 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
173 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
174 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
175 @# Correct directory permissions are important.
176 $(MKDIR) -p \
177 $(@D) \
178 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
179 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
180 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj
181 @# Do keyword replacement in the package info and description files.
182 $(SED) \
183 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
184 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
185 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
186 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
187 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
188 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
189 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
190 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Welcome.rtf \
191 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.rtf
192 @# Copy the resources.
193 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Conclusion.rtf
194 $(SED) \
195 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
196 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
197 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
198 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Localizable.strings \
199 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
200 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/background.tif
201 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
202 $(MKDIR) -p \
203 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
204 $(SED) \
205 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
206 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
207 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
208 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
209 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
210 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
211 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VIRTUALBOX_CONCLUSION_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Conclusion.rtf$(NLTAB) \
212 $(SED) \
213 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
214 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
215 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
216 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
217 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
218 )
219 @# Build the package.
220 $(VBOX_PRODUCTBUILD) \
221 --distribution $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist \
222 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
223 --resources $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
224 --identifier org.VirtualBox.mpkg.virtualbox \
225 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
226 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
227 $@
228 @# Cleanup.
229 sudo rm -Rf \
230 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
231 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
232 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
233
234
235#
236# The VirtualBox Kernel extensions.
237#
238VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB
239VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
240
241$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
242 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
243 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
244 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
245 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
246 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
247 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
248 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
249 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
250 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
251 $(call MSG_TOOL,pkgbuild,,,$@)
252 @# Cleanup any previously failed attempts.
253 sudo rm -Rf \
254 $@ \
255 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
256 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
257 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
258 @# Correct directory permissions are important.
259 $(MKDIR) -p \
260 $(@D) \
261 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
262 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
263 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
264 $(MKDIR) -p -m 0755 \
265 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
266 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons \
267 $(foreach kext,$(VBOX_DI_KEXTS), \
268 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext \
269 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents \
270 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS )
271 @# Copy the launch daemon bits.
272 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/VirtualBoxStartup.sh $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
273 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/org.virtualbox.startup.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
274 @# Copy the common files (Info.plist).
275 $(foreach kext,$(VBOX_DI_KEXTS), \
276 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/)
277 @# Copy the binaries and invoking lipo.
278 $(foreach kext,$(VBOX_DI_KEXTS), \
279 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/)
280 @# Signed the kext bundles.
281ifdef VBOX_SIGNING_MODE
282 $(foreach kext,$(VBOX_DI_KEXTS) \
283 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/$(kext),org.virtualbox.app.kext.$(kext)) )
284 $(foreach kext,$(VBOX_DI_KEXTS), \
285 $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext,org.virtualbox.app.kext.$(kext)) )
286## @TODO check why this fails on the build box: $(foreach kext,$(VBOX_DI_KEXTS), $(NLTAB)codesign --verify --verbose=1 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext )
287endif
288 @# Set the correct owners.
289 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/
290 @# Do keyword replacement in the package info and description files.
291 $(SED) \
292 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
293 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
294 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
295 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
296 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
297 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
298 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
299 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
300 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/PkgBuildComponent.plist
301 @# Copy the resources.
302 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
303 @# Build the package.
304 $(VBOX_PKGBUILD) \
305 --root $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/ \
306 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
307 --script $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
308 --identifier org.virtualbox.pkg.vboxkexts \
309 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
310 --install-location "/Library/Application Support/VirtualBox" \
311 --ownership preserve \
312 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
313 $@
314 @# Cleanup
315 sudo chown -R "$(shell whoami)" \
316 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root
317 sudo rm -Rf \
318 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
319 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
320 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
321
322
323#
324# Figure out which languages that we support and construct
325# .qm and .lproj lists for these.
326#
327include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
328VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
329VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
330
331
332#
333# The VirtualBox Application.
334#
335
336VBOX_DI_VBAPP_DYLIBS = \
337 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \
338 MacOS/VBoxDD.dylib \
339 MacOS/VBoxDD2.dylib \
340 MacOS/VBoxDDU.dylib \
341 MacOS/VBoxREM.dylib \
342 MacOS/VBoxRT.dylib \
343 $(if $(VBOX_WITH_SHARED_FOLDERS),MacOS/VBoxSharedFolders.dylib,) \
344 $(if $(VBOX_WITH_SHARED_CLIPBOARD),MacOS/VBoxSharedClipboard.dylib,) \
345 $(if $(VBOX_WITH_DRAG_AND_DROP),MacOS/VBoxDragAndDropSvc.dylib,) \
346 $(if $(VBOX_WITH_GUEST_PROPS),MacOS/VBoxGuestPropSvc.dylib,) \
347 MacOS/VBoxHostChannel.dylib \
348 MacOS/VBoxVMM.dylib \
349 MacOS/VBoxXPCOM.dylib \
350 MacOS/VBoxXPCOMC.dylib \
351 MacOS/components/VBoxC.dylib \
352 MacOS/components/VBoxSVCM.dylib \
353 MacOS/components/VBoxXPCOMIPCC.dylib \
354 MacOS/VBoxAuth.dylib \
355 MacOS/VBoxAuthSimple.dylib \
356 $(if $(VBOX_WITH_GUEST_CONTROL),MacOS/VBoxGuestControlSvc.dylib,)
357ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
358 VBOX_DI_VBAPP_DYLIBS += \
359 MacOS/accessible/libqtaccessiblewidgets.dylib
360endif
361if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
362 VBOX_DI_VBAPP_DYLIBS += \
363 MacOS/VBoxVRDP.dylib
364endif
365ifdef VBOX_WITH_CROGL
366 VBOX_DI_VBAPP_DYLIBS += \
367 MacOS/VBoxOGLhostcrutil.dylib \
368 MacOS/VBoxOGLhosterrorspu.dylib \
369 MacOS/VBoxOGLrenderspu.dylib \
370 MacOS/VBoxSharedCrOpenGL.dylib
371endif
372ifdef VBOX_WITH_DEBUGGER_GUI
373 VBOX_DI_VBAPP_DYLIBS += \
374 MacOS/VBoxDbg.dylib \
375 MacOS/DbgPlugInDiggers.dylib
376endif
377ifdef VBOX_WITH_HARDENING
378 VBOX_DI_VBAPP_DYLIBS += \
379 MacOS/VirtualBox.dylib \
380 MacOS/VBoxNetDHCP.dylib \
381 MacOS/VBoxNetNAT.dylib \
382 MacOS/VBoxHeadless.dylib
383endif
384ifdef VBOX_WITH_HDDPARALLELS_INSTALL
385 VBOX_DI_VBAPP_DYLIBS += \
386 MacOS/VBoxHDDParallels.dylib
387endif
388if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
389 VBOX_DI_VBAPP_DYLIBS += \
390 MacOS/VBoxPython2_6.so
391endif
392if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7)
393 VBOX_DI_VBAPP_DYLIBS += \
394 MacOS/VBoxPython2_7.so
395endif
396ifdef VBOX_WITH_VMSVGA3D
397 VBOX_DI_VBAPP_DYLIBS += \
398 MacOS/VBoxSVGA3D.dylib \
399 MacOS/VBoxSVGA3DObjC.dylib
400endif
401
402VBOX_DI_VBAPP_DYLIBS.x86 := \
403 MacOS/VBoxREM32.dylib \
404 MacOS/VBoxREM64.dylib
405ifdef VBOX_WITH_PYTHON
406 VBOX_DI_VBAPP_DYLIBS.x86 += \
407 MacOS/VBoxPython2_5.so \
408 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
409endif
410
411VBOX_DI_VBAPP_DYLIBS.amd64 :=
412if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
413 VBOX_DI_VBAPP_DYLIBS.amd64 += \
414 MacOS/VBoxPython2_6.so
415endif
416
417if defined(VBOX_WITH_JXPCOM)
418 VBOX_DI_VBAPP_DYLIBS += \
419 MacOS/libvboxjxpcom.jnilib
420endif
421
422if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
423 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
424endif
425if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
426 $(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))
427endif
428
429VBOX_DI_VBAPP_PROGS = \
430 MacOS/VBoxManage \
431 MacOS/VBoxSVC \
432 MacOS/VBoxHeadless \
433 MacOS/VBoxXPCOMIPCD \
434 MacOS/VBoxNetAdpCtl \
435 MacOS/VBoxNetDHCP \
436 MacOS/VBoxNetNAT \
437 MacOS/VBoxExtPackHelperApp \
438 MacOS/VBoxBalloonCtrl \
439 MacOS/VBoxAutostart \
440 MacOS/VirtualBoxVM \
441 $(if $(VBOX_WITH_WEBSERVICES),MacOS/vboxwebsrv) \
442 MacOS/VirtualBox \
443 $(if $(VBOX_WITH_DTRACE),MacOS/VBoxDTrace,)
444
445VBOX_DI_VBAPP_UNIVERSAL_PROGS = \
446 MacOS/vmstarter \
447 $(if $(VBOX_WITH_VBOX_IMG)$(VBOX_WITH_TESTCASES),MacOS/vbox-img,)
448
449VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
450 MacOS/VMMR0.r0 \
451 MacOS/VBoxDDR0.r0 \
452 MacOS/VBoxDD2R0.r0
453
454VBOX_DI_VBAPP_OTHER_BINS = \
455 MacOS/VMMRC.rc \
456 MacOS/VBoxDDRC.rc \
457 MacOS/VBoxDD2RC.rc
458
459VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES = \
460 Resources/virtualbox.icns \
461 Resources/virtualbox.png \
462 Resources/virtualbox-vbox.icns \
463 Resources/virtualbox-vbox-extpack.icns \
464 Resources/virtualbox-ovf.icns \
465 Resources/virtualbox-ova.icns \
466 Resources/virtualbox-vdi.icns \
467 Resources/virtualbox-vmdk.icns \
468 Resources/virtualbox-vhd.icns \
469 Resources/virtualbox-hdd.icns
470
471VBOX_DI_VBAPP_MISC_FILES = \
472 Info.plist \
473 PkgInfo \
474 $(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES) \
475 MacOS/components/VBoxXPCOMBase.xpt \
476 MacOS/components/VirtualBox_XPCOM.xpt \
477 Resources/VirtualBoxVM.app/Contents/Info.plist \
478 Resources/VirtualBoxVM.app/Contents/PkgInfo \
479 $(addprefix Resources/VirtualBoxVM.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES)) \
480 Resources/vmstarter.app/Contents/Info.plist \
481 Resources/vmstarter.app/Contents/PkgInfo \
482 $(addprefix Resources/vmstarter.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES))
483ifdef VBOX_WITH_DOCS_PACKING
484VBOX_DI_VBAPP_MISC_FILES += \
485 MacOS/UserManual.pdf
486endif
487ifdef VBOX_WITH_ADDITIONS_PACKING
488 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
489 VBOX_DI_VBAPP_MISC_FILES += \
490 MacOS/VBoxGuestAdditions.iso
491 endif
492endif
493ifdef VBOX_WITH_EFIFW_PACKING
494VBOX_DI_VBAPP_MISC_FILES += \
495 MacOS/VBoxEFI32.fd \
496 MacOS/VBoxEFI64.fd
497endif
498VBOX_DI_VBAPP_MISC_FILES += \
499 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \
500 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \
501 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib \
502 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/Resources/Info.plist)
503
504VBOX_DI_VBAPP_SYMLINKS = \
505 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
506 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
507 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
508 ,Frameworks/$(qtmod).framework/Versions/Current=>4 )
509ifndef VBOX_NOT_OSX_105
510VBOX_DI_VBAPP_SYMLINKS += $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
511 ,Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod) \
512 Frameworks/$(qtmod).framework/Resources=>Versions/4/Resources/ )
513endif
514
515ifdef VBOX_WITH_PYTHON
516 # Python XPCOM glue
517 VBOX_DI_VBAPP_PYTHON_FILES = \
518 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
519 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
520endif
521
522
523# (The dependencies are including way too much here because I'm lazy.)
524$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
525 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
526 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
527 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES)\
528 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
529 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
530 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
531 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
532 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
533 \
534 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
535 $(VBOX_BRAND_LICENSE_TXT) \
536 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
537 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
538 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
539 \
540 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
541 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
542 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
543 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
544 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
545 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
546 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
547 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
548 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
549 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
550 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
551 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
552 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
553 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
554 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
555 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
556 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
557 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist \
558 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist \
559 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh \
560 $(if-expr defined(VBOX_WITH_DTRACE), \
561 $(foreach f, $(VBOXINST_DTRACE_LIB_ARCH_FILES), \
562 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/lib/x86/$f) \
563 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/lib/amd64/$f)) \
564 $(foreach f, $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES), \
565 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/testcase/x86/$f) \
566 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/testcase/amd64/$f)) \
567 $(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
568 ,) \
569 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
570 $(call MSG_TOOL,pkgbuild,,,$@)
571 @# Cleanup any previously failed attempts.
572 sudo rm -Rf \
573 $@ \
574 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
575 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
576 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
577 @# Correct directory permissions are important.
578 $(MKDIR) -p \
579 $(@D) \
580 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
581 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
582 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
583 $(MKDIR) -p -m 0775 \
584 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
585 $(MKDIR) -p -m 0755 $(sort \
586 $(VBOX_PATH_VBOX_APP_TMP)/Contents \
587 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS \
588 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/components \
589 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls \
590 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/accessible \
591 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources \
592 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app \
593 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app/Contents \
594 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app \
595 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app/Contents \
596 $(if-expr defined(VBOX_WITH_PYTHON), \
597 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk \
598 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer \
599 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer/vboxapi \
600 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/ \
601 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom \
602 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python \
603 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
604 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
605 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
606 $(if-expr defined(VBOX_WITH_JXPCOM), \
607 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/java,) \
608 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/,$(dir \
609 $(VBOX_DI_VBAPP_DYLIBS) \
610 $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
611 $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
612 $(VBOX_DI_VBAPP_OTHER_BINS) \
613 $(VBOX_DI_VBAPP_PROGS) \
614 $(VBOX_DI_VBAPP_MISC_FILES) \
615 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
616 $(VBOX_DI_VBAPP_MISC_FILES.$(KBUILD_TARGET_ARCH)) \
617 ))\
618 )
619# Create the .lproj language directories
620 $(MKDIR) -p -m 0755 \
621 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
622# Install all supported language files
623 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
624 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls/$(f)$(NLTAB))
625ifdef VBOX_WITH_WEBSERVICES
626 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
627endif
628 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
629 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
630 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
631# Install the python bridge stuff
632ifdef VBOX_WITH_PYTHON
633 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
634 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(f)$(NLTAB) )
635 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS
636endif
637# Install the java bridge stuff
638ifdef VBOX_WITH_JXPCOM
639 $(INSTALL) -m 0755 $(VBOX_PATH_DIST)/sdk/bindings/xpcom/java/vboxjxpcom.jar $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar
640endif
641# Copy misc files.
642 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
643 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
644 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/LICENSE
645ifdef VBOX_WITH_DOCS_PACKING
646 $(foreach f,$(VBOX_ADD_MANUALS) \
647 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(NLTAB))
648endif
649 @# Create symlinks.
650 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
651 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
652 @# Copy the dylibs.
653 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
654 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib)$(NLTAB))
655 @# Copy the other binaries.
656 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) \
657 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
658 @# Create/copy the universal executable binaries.
659 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
660 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
661 @# Copy the binaries.
662 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
663 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(prog)$(NLTAB))
664#ifdef VBOX_WITH_HARDENING - disabled temporarily
665if 1
666 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
667 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
668 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
669 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(NLTAB) )
670 $(foreach f, \
671 $(VBOX_DI_VBAPP_DYLIBS) \
672 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
673 $(VBOX_DI_VBAPP_PROGS) \
674 ,install_name_tool \
675 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), \
676 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
677 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
678 -change $(VBOX_PATH_QT4)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
679 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
680 -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \
681 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
682 -change $(qtmod).framework/Versions/4/$(qtmod) \
683 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
684 ) \
685 $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
686endif
687ifdef VBOX_WITH_DTRACE
688 @# DTrace library, testcases and scripts.
689 $(MKDIR) -p -m 0755 -- \
690 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/ \
691 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/ \
692 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/scripts/
693 $(foreach file, $(addprefix lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
694 $(addprefix testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
695 $(addprefix scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
696 ,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/$(file) \
697 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/$(file)$(NLTAB))
698endif
699
700 @# Signed the binaries and the application bundle.
701ifdef VBOX_SIGNING_MODE
702 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
703 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod),org.virtualbox.app.frameworks.$(qtmod)) )
704 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
705 ,$(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/4,org.virtualbox.app.frameworks.$(qtmod)) )
706 $(foreach dylib, \
707 $(VBOX_DI_VBAPP_DYLIBS) \
708 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
709 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib),org.virtualbox.app.macos.$(notdir $(dylib))) )
710 $(foreach bin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
711 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
712 ifdef VBOX_NOT_OSX_105 ## @todo Move as much stuff out of MacOS/ as possible!!
713 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS)\
714 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
715 $(foreach bin, $(filter-out MacOS/VirtualBox,$(VBOX_DI_VBAPP_PROGS)) \
716 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
717 $(foreach file, $(if-expr defined(VBOX_WITH_WEBSERVICES),MacOS/org.virtualbox.vboxwebsrv.plist,) \
718 MacOS/org.virtualbox.vboxballoonctrl.plist \
719 MacOS/org.virtualbox.vboxautostart.plist \
720 MacOS/VBoxAutostartDarwin.sh \
721 $(if-expr defined(VBOX_WITH_PYTHON),$(addprefix MacOS/, $(VBOX_DI_VBAPP_PYTHON_FILES) vboxshell.py),) \
722 $(if-expr defined(VBOX_WITH_JXPCOM),MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar,) \
723 $(filter MacOS/%,$(VBOX_DI_VBAPP_MISC_FILES)) \
724 $(if-expr defined(VBOX_WITH_DOCS_PACKING),$(addprefix MacOS/,$(VBOX_ADD_MANUALS)),) \
725 $(if-expr defined(VBOX_WITH_DTRACE),\
726 $(addprefix MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
727 $(addprefix MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
728 $(addprefix MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) ,) \
729 $(addprefix MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
730 , $(NLTAB)$(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(file),org.virtualbox.app.$(tolower $(subst $(SP),,$(subst /,.,$(file))))) )
731
732 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app,,)
733 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app,,)
734 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP),,--deep)
735 else
736 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) \
737 , $(NLTAB)$(call VBOX_SIGN_VMM_MOD_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
738 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) \
739 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
740 endif
741endif
742 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
743 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
744ifdef VBOX_WITH_HARDENING
745 sudo chmod u+s \
746 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT,\
747 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(bin))
748endif
749 @# Do keyword replacement in the package info and description files.
750 $(SED) \
751 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
752 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
753 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
754 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
755 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
756 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
757 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
758 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
759 $(VBOX_PATH_DI_SRC)/VirtualBox/PkgBuildComponent.plist
760 @# Copy the resources.
761 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/preflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
762 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
763 @# Build the package.
764 $(VBOX_PKGBUILD) \
765 --root $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/ \
766 --component-plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
767 --script $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
768 --identifier org.virtualbox.pkg.virtualbox \
769 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
770 --install-location /Applications/ \
771 --ownership preserve \
772 $(if-expr defined(VBOX_NOT_OSX_105),--preserve-xattr,) \
773 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
774 $@
775 @# Cleanup
776 sudo chown -R "$(shell whoami)" \
777 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
778 sudo chmod -R a-s \
779 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
780 sudo rm -Rf \
781 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
782 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
783 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
784
785#
786# The VirtualBox CLI wrapper scripts.
787#
788$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
789 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
790 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
791 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
792 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
793 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
794 $(call MSG_TOOL,pkgbuild,,,$@)
795 @# Cleanup any previously failed attempts.
796 sudo rm -Rf \
797 $@ \
798 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
799 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
800 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
801 @# Correct directory permissions are important.
802 $(MKDIR) -p \
803 $(@D) \
804 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
805 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
806 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
807 $(MKDIR) -p -m 0755 \
808 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
809 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin
810 @# Generate the wrapper scripts.
811 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox \
812 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
813 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage \
814 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
815 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP \
816 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
817 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless \
818 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
819ifdef VBOX_WITH_WEBSERVICES
820 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv \
821 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
822endif
823if defined(VBOX_WITH_VBOX_IMG) || defined(VBOX_WITH_TESTCASES)
824 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vbox-img \
825 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vbox-img "$$@"'
826endif
827 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxBalloonCtrl \
828 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl "$$@"'
829 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxAutostart \
830 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart "$$@"'
831ifdef VBOX_WITH_DTRACE
832 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxDTrace \
833 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxDTrace "$$@"'
834endif
835 @# Set the correct owners and file permissions.
836 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/*
837 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
838 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
839 @# Build the package.
840 $(VBOX_PKGBUILD) \
841 --root $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin \
842 --identifier org.virtualbox.pkg.virtualboxcli \
843 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
844 --install-location /usr/bin \
845 --ownership preserve \
846 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
847 $@
848 @# Cleanup
849 sudo chown -R "$(shell whoami)" \
850 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
851 sudo rm -Rf \
852 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
853 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
854 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
855
856
857#
858# Aliases.
859#
860VBoxKEXTs.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg
861VirtualBoxCLI.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg
862VirtualBox.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg
863VirtualBox.mpkg: $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg
864VirtualBox.dmg: $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg
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