VirtualBox

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

Last change on this file since 53280 was 53280, checked in by vboxsync, 10 years ago

Pack VBoxSVGA3D on darwin.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 46.1 KB
Line 
1# $Id: Makefile.kmk 53280 2014-11-10 08:34:39Z 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/VBoxKEXTs.pkg \
169 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
170 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \
171 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
172 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
173 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
174 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
175 $(call MSG_TOOL,productbuild,,,$@)
176 @# Cleanup any previously failed attempts.
177 sudo rm -Rf \
178 $@ \
179 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
180 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
181 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
182 @# Correct directory permissions are important.
183 $(MKDIR) -p \
184 $(@D) \
185 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
186 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
187 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj
188 @# Do keyword replacement in the package info and description files.
189 $(SED) \
190 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
191 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
192 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
193 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
194 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
195 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
196 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
197 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Welcome.rtf \
198 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.rtf
199 @# Copy the resources.
200 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Conclusion.rtf
201 $(SED) \
202 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
203 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
204 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
205 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Localizable.strings \
206 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
207 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/background.tif
208 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
209 $(MKDIR) -p \
210 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
211 $(SED) \
212 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
213 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
214 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
215 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
216 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
217 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
218 $(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) \
219 $(SED) \
220 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
221 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
222 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
223 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
224 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
225 )
226 @# Build the package.
227 $(VBOX_PRODUCTBUILD) \
228 --distribution $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist \
229 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
230 --resources $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
231 --identifier org.VirtualBox.mpkg.virtualbox \
232 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
233 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
234 $@
235 @# Cleanup.
236 sudo rm -Rf \
237 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
238 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
239 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
240
241
242#
243# The VirtualBox Kernel extensions.
244#
245VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB
246VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
247
248$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
249 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
250 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
251 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
252 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
253 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
254 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
255 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
256 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
257 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
258 $(call MSG_TOOL,pkgbuild,,,$@)
259 @# Cleanup any previously failed attempts.
260 sudo rm -Rf \
261 $@ \
262 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
263 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
264 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
265 @# Correct directory permissions are important.
266 $(MKDIR) -p \
267 $(@D) \
268 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
269 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
270 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
271 $(MKDIR) -p -m 0755 \
272 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
273 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons \
274 $(foreach kext,$(VBOX_DI_KEXTS), \
275 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext \
276 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents \
277 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS )
278 @# Copy the launch daemon bits.
279 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/VirtualBoxStartup.sh $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
280 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/org.virtualbox.startup.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
281 @# Copy the common files (Info.plist).
282 $(foreach kext,$(VBOX_DI_KEXTS), \
283 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/)
284 @# Copy the binaries and invoking lipo.
285ifdef VBOX_WITH_COMBINED_PACKAGE
286 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), \
287 $(NLTAB)$(VBOX_DI_LIPO) -create \
288 $(VBOX_PATH_DIST_32)/$(kext).kext/Contents/MacOS/$(kext) \
289 $(VBOX_PATH_DIST_64)/$(kext).kext/Contents/MacOS/$(kext) \
290 -output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/$(kext))
291else
292 $(foreach kext,$(VBOX_DI_KEXTS), \
293 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/)
294endif
295 @# Signed the kext bundles.
296ifdef VBOX_SIGNING_MODE
297 $(foreach kext,$(VBOX_DI_KEXTS) \
298 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/$(kext),org.virtualbox.app.kext.$(kext)) )
299 $(foreach kext,$(VBOX_DI_KEXTS), \
300 $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext,org.virtualbox.app.kext.$(kext)) )
301## @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 )
302endif
303 @# Set the correct owners.
304 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/
305 @# Do keyword replacement in the package info and description files.
306 $(SED) \
307 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
308 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
309 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
310 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
311 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
312 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
313 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
314 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
315 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/PkgBuildComponent.plist
316 @# Copy the resources.
317 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
318 @# Build the package.
319 $(VBOX_PKGBUILD) \
320 --root $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/ \
321 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
322 --script $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
323 --identifier org.virtualbox.pkg.vboxkexts \
324 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
325 --install-location "/Library/Application Support/VirtualBox" \
326 --ownership preserve \
327 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
328 $@
329 @# Cleanup
330 sudo chown -R "$(shell whoami)" \
331 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root
332 sudo rm -Rf \
333 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
334 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
335 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
336
337
338#
339# Figure out which languages that we support and construct
340# .qm and .lproj lists for these.
341#
342include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
343VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
344VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
345
346
347#
348# The VirtualBox Application.
349#
350
351VBOX_DI_VBAPP_DYLIBS = \
352 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \
353 MacOS/VBoxDD.dylib \
354 MacOS/VBoxDD2.dylib \
355 MacOS/VBoxDDU.dylib \
356 MacOS/VBoxREM.dylib \
357 MacOS/VBoxRT.dylib \
358 $(if $(VBOX_WITH_SHARED_FOLDERS),MacOS/VBoxSharedFolders.dylib,) \
359 $(if $(VBOX_WITH_SHARED_CLIPBOARD),MacOS/VBoxSharedClipboard.dylib,) \
360 $(if $(VBOX_WITH_DRAG_AND_DROP),MacOS/VBoxDragAndDropSvc.dylib,) \
361 $(if $(VBOX_WITH_GUEST_PROPS),MacOS/VBoxGuestPropSvc.dylib,) \
362 MacOS/VBoxHostChannel.dylib \
363 MacOS/VBoxVMM.dylib \
364 MacOS/VBoxXPCOM.dylib \
365 MacOS/VBoxXPCOMC.dylib \
366 MacOS/components/VBoxC.dylib \
367 MacOS/components/VBoxSVCM.dylib \
368 MacOS/components/VBoxXPCOMIPCC.dylib \
369 MacOS/VBoxAuth.dylib \
370 MacOS/VBoxAuthSimple.dylib \
371 $(if $(VBOX_WITH_GUEST_CONTROL),MacOS/VBoxGuestControlSvc.dylib,)
372ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
373 VBOX_DI_VBAPP_DYLIBS += \
374 MacOS/accessible/libqtaccessiblewidgets.dylib
375endif
376if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
377 VBOX_DI_VBAPP_DYLIBS += \
378 MacOS/VBoxVRDP.dylib
379endif
380ifdef VBOX_WITH_CROGL
381 VBOX_DI_VBAPP_DYLIBS += \
382 MacOS/VBoxOGLhostcrutil.dylib \
383 MacOS/VBoxOGLhosterrorspu.dylib \
384 MacOS/VBoxOGLrenderspu.dylib \
385 MacOS/VBoxSharedCrOpenGL.dylib
386endif
387ifdef VBOX_WITH_DEBUGGER_GUI
388 VBOX_DI_VBAPP_DYLIBS += \
389 MacOS/VBoxDbg.dylib
390endif
391ifdef VBOX_WITH_HARDENING
392 VBOX_DI_VBAPP_DYLIBS += \
393 MacOS/VirtualBox.dylib \
394 MacOS/VBoxNetDHCP.dylib \
395 MacOS/VBoxNetNAT.dylib \
396 MacOS/VBoxHeadless.dylib
397endif
398ifdef VBOX_WITH_HDDPARALLELS_INSTALL
399 VBOX_DI_VBAPP_DYLIBS += \
400 MacOS/VBoxHDDParallels.dylib
401endif
402if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
403 VBOX_DI_VBAPP_DYLIBS += \
404 MacOS/VBoxPython2_6.so
405endif
406if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7)
407 VBOX_DI_VBAPP_DYLIBS += \
408 MacOS/VBoxPython2_7.so
409endif
410ifdef VBOX_WITH_VMSVGA3D
411 VBOX_DI_VBAPP_DYLIBS += \
412 MacOS/VBoxSVGA3D.dylib
413endif
414
415VBOX_DI_VBAPP_DYLIBS.x86 := \
416 MacOS/VBoxREM32.dylib \
417 MacOS/VBoxREM64.dylib
418ifdef VBOX_WITH_PYTHON
419 VBOX_DI_VBAPP_DYLIBS.x86 += \
420 MacOS/VBoxPython2_5.so \
421 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
422endif
423
424VBOX_DI_VBAPP_DYLIBS.amd64 :=
425if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
426 VBOX_DI_VBAPP_DYLIBS.amd64 += \
427 MacOS/VBoxPython2_6.so
428endif
429
430if defined(VBOX_WITH_JXPCOM)
431 VBOX_DI_VBAPP_DYLIBS += \
432 MacOS/libvboxjxpcom.jnilib
433endif
434
435if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
436 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
437endif
438if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
439 $(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))
440endif
441
442VBOX_DI_VBAPP_PROGS = \
443 MacOS/VBoxManage \
444 MacOS/VBoxSVC \
445 MacOS/VBoxHeadless \
446 MacOS/VBoxXPCOMIPCD \
447 MacOS/VBoxNetAdpCtl \
448 MacOS/VBoxNetDHCP \
449 MacOS/VBoxNetNAT \
450 MacOS/VBoxExtPackHelperApp \
451 MacOS/VBoxBalloonCtrl \
452 MacOS/VBoxAutostart \
453 MacOS/VirtualBoxVM \
454 $(if $(VBOX_WITH_WEBSERVICES),MacOS/vboxwebsrv) \
455 MacOS/VirtualBox
456
457VBOX_DI_VBAPP_UNIVERSAL_PROGS = \
458 MacOS/vmstarter \
459 $(if $(VBOX_WITH_VBOX_IMG)$(VBOX_WITH_TESTCASES),MacOS/vbox-img,)
460
461VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
462 MacOS/VMMR0.r0 \
463 MacOS/VBoxDDR0.r0 \
464 MacOS/VBoxDD2R0.r0
465
466VBOX_DI_VBAPP_OTHER_BINS = \
467 MacOS/VMMGC.gc \
468 MacOS/VBoxDDGC.gc \
469 MacOS/VBoxDD2GC.gc
470
471VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES = \
472 Resources/virtualbox.icns \
473 Resources/virtualbox.png \
474 Resources/virtualbox-vbox.icns \
475 Resources/virtualbox-vbox-extpack.icns \
476 Resources/virtualbox-ovf.icns \
477 Resources/virtualbox-ova.icns \
478 Resources/virtualbox-vdi.icns \
479 Resources/virtualbox-vmdk.icns \
480 Resources/virtualbox-vhd.icns \
481 Resources/virtualbox-hdd.icns
482
483VBOX_DI_VBAPP_MISC_FILES = \
484 Info.plist \
485 PkgInfo \
486 $(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES) \
487 MacOS/components/VBoxXPCOMBase.xpt \
488 MacOS/components/VirtualBox_XPCOM.xpt \
489 Resources/VirtualBoxVM.app/Contents/Info.plist \
490 Resources/VirtualBoxVM.app/Contents/PkgInfo \
491 $(addprefix Resources/VirtualBoxVM.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES)) \
492 Resources/vmstarter.app/Contents/Info.plist \
493 Resources/vmstarter.app/Contents/PkgInfo \
494 $(addprefix Resources/vmstarter.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES))
495ifdef VBOX_WITH_DOCS_PACKING
496VBOX_DI_VBAPP_MISC_FILES += \
497 MacOS/UserManual.pdf
498endif
499ifdef VBOX_WITH_ADDITIONS_PACKING
500 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
501 VBOX_DI_VBAPP_MISC_FILES += \
502 MacOS/VBoxGuestAdditions.iso
503 endif
504endif
505ifdef VBOX_WITH_EFIFW_PACKING
506VBOX_DI_VBAPP_MISC_FILES += \
507 MacOS/VBoxEFI32.fd \
508 MacOS/VBoxEFI64.fd
509endif
510VBOX_DI_VBAPP_MISC_FILES += \
511 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \
512 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \
513 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib
514
515VBOX_DI_VBAPP_SYMLINKS = \
516 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
517 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
518 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod)) \
519 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Resources=>Versions/4/Resources/
520
521ifdef VBOX_WITH_PYTHON
522 # Python XPCOM glue
523 VBOX_DI_VBAPP_PYTHON_FILES = \
524 $(foreach f,$(notdir $(wildcard $(VBOX_PATH_DIST)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
525 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
526 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
527 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
528 sdk/bindings/xpcom/python/xpcom/server/factory.py \
529 sdk/bindings/xpcom/python/xpcom/server/loader.py \
530 sdk/bindings/xpcom/python/xpcom/server/module.py \
531 sdk/bindings/xpcom/python/xpcom/server/policy.py \
532 sdk/installer/vboxapisetup.py \
533 sdk/installer/vboxapi/__init__.py \
534 sdk/installer/vboxapi/VirtualBox_constants.py
535endif
536
537
538# (The dependencies are including way too much here because I'm lazy.)
539$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
540 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
541 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
542 $(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)\
543 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
544 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
545 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
546 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
547 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
548 \
549 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
550 $(VBOX_BRAND_LICENSE_TXT) \
551 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
552 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
553 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
554 \
555 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
556 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
557 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
558 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
559 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
560 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
561 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
562 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
563 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
564 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
565 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
566 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
567 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
568 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
569 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
570 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
571 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
572 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist \
573 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist \
574 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh \
575 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
576 $(call MSG_TOOL,pkgbuild,,,$@)
577 @# Cleanup any previously failed attempts.
578 sudo rm -Rf \
579 $@ \
580 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
581 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
582 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
583 @# Correct directory permissions are important.
584 $(MKDIR) -p \
585 $(@D) \
586 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
587 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
588 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
589 $(MKDIR) -p -m 0775 \
590 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
591 $(MKDIR) -p -m 0755 $(sort \
592 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents \
593 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS \
594 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/components \
595 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls \
596 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/accessible \
597 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources \
598 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \
599 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \
600 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app \
601 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app/Contents \
602 $(if-expr defined(VBOX_WITH_PYTHON), \
603 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \
604 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer \
605 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer/vboxapi \
606 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/ \
607 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom \
608 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python \
609 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
610 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
611 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
612 $(if-expr defined(VBOX_WITH_JXPCOM), \
613 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java,) \
614 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/,$(dir \
615 $(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) \
616 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "amd64",$(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64),) \
617 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86", $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86),) \
618 ))\
619 )
620 @# Create the .lproj language directories
621 $(MKDIR) -p -m 0755 \
622 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
623 @# Install all supported language files
624 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
625 ,$(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))
626ifdef VBOX_WITH_WEBSERVICES
627 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
628endif
629 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
630 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
631 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
632 @# Install the python stuff
633ifdef VBOX_WITH_PYTHON
634 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
635 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(f)$(NLTAB) )
636 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS
637endif
638ifdef VBOX_WITH_JXPCOM
639 $(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
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_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
644ifdef VBOX_WITH_COMBINED_PACKAGE
645 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.x86) \
646 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
647 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.amd64) \
648 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
649endif
650 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/LICENSE
651ifdef VBOX_WITH_DOCS_PACKING
652 $(foreach f,$(VBOX_ADD_MANUALS) \
653 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(NLTAB))
654endif
655 @# Create symlinks.
656ifdef VBOX_WITH_COMBINED_PACKAGE
657 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.amd64) $(VBOX_DI_VBAPP_SYMLINKS.x86) \
658 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
659else
660 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
661 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
662endif
663 @# Copy the dylibs.
664ifdef VBOX_WITH_COMBINED_PACKAGE
665 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) \
666 ,$(VBOX_DI_LIPO) -create \
667 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) \
668 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) \
669 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
670 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.x86) \
671 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
672 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.amd64) \
673 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
674else
675 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
676 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
677endif
678 @# Copy the other binaries.
679ifdef VBOX_WITH_COMBINED_PACKAGE
680 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
681 ,$(VBOX_DI_LIPO) -create \
682 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \
683 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \
684 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
685 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS), \
686 $(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 \
687 $(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 )
688else
689 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
690 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
691 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) \
692 ,$(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))
693endif
694 @# Create/copy the universal executable binaries.
695ifdef VBOX_WITH_COMBINED_PACKAGE
696 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
697 ,$(VBOX_DI_LIPO) -create \
698 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \
699 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \
700 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
701else
702 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
703 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
704endif
705 @# Copy the binaries.
706ifdef VBOX_WITH_COMBINED_PACKAGE
707 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
708 ,$(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) \
709 $(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))
710else
711 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
712 ,$(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))
713endif
714#ifdef VBOX_WITH_HARDENING - disabled temporarily
715if 1
716 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
717 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
718 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
719 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(NLTAB) )
720 $(foreach f, \
721 $(VBOX_DI_VBAPP_DYLIBS) \
722 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), \
723 $(VBOX_DI_VBAPP_DYLIBS.x86) \
724 $(VBOX_DI_VBAPP_DYLIBS.amd64) \
725 $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) \
726 $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \
727 ,$(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
728 $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \
729 ) \
730 ,install_name_tool \
731 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), \
732 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
733 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
734 -change $(VBOX_PATH_QT4)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
735 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
736 -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \
737 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
738 -change $(qtmod).framework/Versions/4/$(qtmod) \
739 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
740 ) \
741 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
742endif
743 @# Signed the binaries and the application bundle.
744 @# Note #1 - We cannot sign the application binary here, since we switch to match the kernel bitness.
745 @# Note #2 - Must sign -amd64/-x86 suffixed binaries without the suffix, or verification fails. (Too lazy to do this for *.gc.)
746ifdef VBOX_SIGNING_MODE
747 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
748 ,$(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)) )
749 $(foreach dylib, \
750 $(VBOX_DI_VBAPP_DYLIBS) \
751 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), \
752 $(VBOX_DI_VBAPP_DYLIBS.x86) \
753 $(VBOX_DI_VBAPP_DYLIBS.amd64) \
754 ,$(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) ) \
755 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib),org.virtualbox.app.macos.$(notdir $(dylib))) )
756 $(foreach bin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
757 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
758 ifdef VBOX_NOT_OSX_105 # Still being hacked on, everything needs to be signed that lives in Contents/MacOS, guess we have to MOVE files out.
759 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
760 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
761 $(foreach arch, $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), amd64 x86, $(KBUILD_TARGET_ARCH)) \
762 , $(foreach other, $(VBOX_DI_VBAPP_OTHER_BINS) \
763 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(other)-$(arch),org.virtualbox.app.macos.$(notdir $(other))-$(arch)) ) )
764 $(foreach other, $(filter MacOS/%,$(VBOX_DI_VBAPP_MISC_FILES)) \
765 , $(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))) )
766 else
767 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
768 , $(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))) )
769 $(foreach arch, $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), amd64 x86, $(KBUILD_TARGET_ARCH)) \
770 , $(foreach other, $(VBOX_DI_VBAPP_OTHER_BINS) \
771 , $(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)) ) )
772 endif
773 $(foreach arch, $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), amd64 x86, $(KBUILD_TARGET_ARCH)) \
774 , $(foreach bin, $(VBOX_DI_VBAPP_PROGS) \
775 , \
776 $(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) \
777 $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) \
778 $(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) \
779 ))
780 ifdef VBOX_NOT_OSX_105 # requires codesign+framworks from Lion or later. Snow Leopard codesign says object file format invalid or unsuitable.
781 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app,)
782 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app,)
783 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app,)
784 endif
785endif
786 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
787 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
788ifdef VBOX_WITH_HARDENING
789 ifdef VBOX_WITH_COMBINED_PACKAGE
790 sudo chmod u+s \
791 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT,\
792 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-x86 \
793 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-amd64)
794 else
795 sudo chmod u+s \
796 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT,\
797 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-$(KBUILD_TARGET_ARCH))
798 endif
799endif
800 @# Do keyword replacement in the package info and description files.
801 $(SED) \
802 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
803 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
804 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
805 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
806 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
807 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
808 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
809 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
810 $(VBOX_PATH_DI_SRC)/VirtualBox/PkgBuildComponent.plist
811 @# Copy the resources.
812 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/preflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
813 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
814 @# Build the package.
815 $(VBOX_PKGBUILD) \
816 --root $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/ \
817 --component-plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
818 --script $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
819 --identifier org.virtualbox.pkg.virtualbox \
820 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
821 --install-location /Applications/ \
822 --ownership preserve \
823 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
824 $@
825 @# Cleanup
826 sudo chown -R "$(shell whoami)" \
827 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
828 sudo chmod -R a-s \
829 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
830 sudo rm -Rf \
831 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
832 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
833 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
834
835#
836# The VirtualBox CLI wrapper scripts.
837#
838$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
839 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
840 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
841 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
842 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
843 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
844 $(call MSG_TOOL,pkgbuild,,,$@)
845 @# Cleanup any previously failed attempts.
846 sudo rm -Rf \
847 $@ \
848 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
849 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
850 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
851 @# Correct directory permissions are important.
852 $(MKDIR) -p \
853 $(@D) \
854 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
855 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
856 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
857 $(MKDIR) -p -m 0755 \
858 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
859 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin
860 @# Generate the wrapper scripts.
861 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox \
862 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
863 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage \
864 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
865 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP \
866 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
867 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless \
868 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
869ifdef VBOX_WITH_WEBSERVICES
870 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv \
871 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
872endif
873if defined(VBOX_WITH_VBOX_IMG) || defined(VBOX_WITH_TESTCASES)
874 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vbox-img \
875 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vbox-img "$$@"'
876endif
877 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxBalloonCtrl \
878 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl "$$@"'
879 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxAutostart \
880 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart "$$@"'
881 @# Set the correct owners and file permissions.
882 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/*
883 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
884 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
885 @# Build the package.
886 $(VBOX_PKGBUILD) \
887 --root $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin \
888 --identifier org.virtualbox.pkg.virtualboxcli \
889 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
890 --install-location /usr/bin \
891 --ownership preserve \
892 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
893 $@
894 @# Cleanup
895 sudo chown -R "$(shell whoami)" \
896 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
897 sudo rm -Rf \
898 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
899 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
900 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
901
902
903#
904# Aliases.
905#
906VBoxKEXTs.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg
907VirtualBoxCLI.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg
908VirtualBox.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg
909VirtualBox.mpkg: $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg
910VirtualBox.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