VirtualBox

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

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

Install VBoxDTrace scripts/libs/testcases.

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