VirtualBox

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

Last change on this file since 43244 was 43244, checked in by vboxsync, 12 years ago

Installer/darwin: Fixed bug introduced in r80322 where we would end up using the 32-bit VMMGC.gc module on 64-bit hosts, resulting in triple faults because of serious structure layout differences.

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