VirtualBox

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

Last change on this file since 76612 was 76612, checked in by vboxsync, 6 years ago

Darwin installer: Fixed missing CLI wrapper to VirtualBoxVM.

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