VirtualBox

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

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

Installer rework, second part.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 58.9 KB
Line 
1# $Id: Makefile.kmk 42744 2012-08-10 08:21:34Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X.
4#
5
6#
7# Copyright (C) 2006-2012 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Include sub-makefiles.
23#
24ifndef VBOX_OSE
25 include $(PATH_SUB_CURRENT)/InstallerPlugins/Makefile.kmk
26endif
27
28
29#
30# Globals
31#
32VBOX_PATH_DI_SRC := $(PATH_SUB_CURRENT)
33VBOX_DI_OUT_DIR := $(PATH_TARGET)/Installer/darwin
34BLDDIRS += $(VBOX_DI_OUT_DIR)
35
36ifdef VBOX_WITH_COMBINED_PACKAGE
37 ifeq ($(KBUILD_TARGET_ARCH),x86)
38 VBOX_PATH_DIST_32 = $(VBOX_PATH_DIST)
39 VBOX_PATH_DIST_64 = $(PATH_OUT_BASE)/darwin.amd64/$(KBUILD_TYPE)/dist
40 else
41 VBOX_PATH_DIST_64 = $(VBOX_PATH_DIST)
42 VBOX_PATH_DIST_32 = $(PATH_OUT_BASE)/darwin.x86/$(KBUILD_TYPE)/dist
43 endif
44 VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST_32)/$1 $(VBOX_PATH_DIST_64)/$2
45 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST_32)/$1
46 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST_64)/$1
47 VBOX_DI_LIPO = lipo
48else
49 VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST)/$1
50 ifeq ($(KBUILD_TARGET_ARCH),x86)
51 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST)/$1
52 VBOX_DI_FN_DEP_64 =
53 else
54 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST)/$1
55 VBOX_DI_FN_DEP_32 =
56 endif
57endif
58
59# Unset this to speed up things during makefile hacking.
60VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
61
62# The location of the PackageMaker program.
63ifndef VBOX_PACKAGEMAKER
64 VBOX_PACKAGEMAKER := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/darwin.x86/packagemaker/v*/PackageMaker.app/Contents/MacOS/PackageMaker)) \
65 /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker)
66endif
67
68# The location of the pkgbuild program.
69ifndef VBOX_PKGBUILD
70 VBOX_PKGBUILD := pkgbuild
71endif
72
73# The location of the productbuild program.
74ifndef VBOX_PRODUCTBUILD
75 VBOX_PRODUCTBUILD := productbuild
76endif
77
78# Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
79ifndef VBOX_PATH_PACK_TMP
80 VBOX_PATH_PACK_TMP := $(VBOX_DI_OUT_DIR)
81endif
82
83# These tools are necessary
84## @Todo rename to VBOX_DI_XYZ these conflict with other globals.
85TAR=/usr/bin/tar
86ZIP=/usr/bin/zip
87GZIP=/usr/bin/gzip
88BZIP2=/usr/bin/bzip2
89GREP=/usr/bin/grep
90XARGS=/usr/bin/xargs
91UNZIP=/usr/bin/unzip
92AWK=/usr/bin/awk
93HDIUTIL=/usr/bin/hdiutil
94
95#
96# Install the darwin docs/license.
97#
98INSTALLS += darwin-docs
99darwin-docs_INST = $(INST_DIST)
100darwin-docs_MODE = a+r,u+w
101darwin-docs_SOURCES = \
102 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
103
104
105#
106# The packing.
107#
108PACKING += $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg
109ifdef VBOX_WITH_BUNDLED_INSTALLER
110 PACKING += $(VBOX_PATH_DIST)/VBoxMacBundleInstaller-$(KBUILD_TARGET_ARCH).zip
111endif
112ifdef VBOX_WITH_BUNDLED_ISO
113iso: $(if $(eq $(filter CD,$(VBOX_BRAND_MEDIA)),CD),$(VBOX_PATH_DIST)/VirtualBox.iso,) \
114 $(if $(eq $(filter DVD,$(VBOX_BRAND_MEDIA)),DVD),$(VBOX_PATH_DIST)/VirtualBoxBundle.iso,)
115endif
116#OTHER_CLEAN = TODO
117
118
119include $(FILE_KBUILD_SUB_FOOTER)
120
121
122#
123# We're running commands as root here, take some care and assertion
124# a sane environment.
125#
126ifeq ($(strip $(VBOX_PATH_DIST)),)
127 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
128endif
129ifeq ($(strip $(VBOX_PATH_DIST)),/)
130 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
131endif
132ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
133 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
134endif
135ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
136 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
137endif
138
139
140# Check for additional manuals
141VBOX_ADD_MANUALS := $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_$(f).pdf)
142
143VBOX_ADD_MANUAL_de_DE := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_de_DE.pdf,$(VBOX_ADD_MANUALS))
144VBOX_ADD_MANUAL_fr_FR := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_fr_FR.pdf,$(VBOX_ADD_MANUALS))
145
146#
147# The disk image.
148#
149$(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg: \
150 $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg \
151 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \
152 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \
153 $$(wildcard $(VBOX_PATH_DI_SRC)/DiskImage/*) \
154 $(if $(VBOX_WITH_DOCS_PACKING), \
155 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf \
156 $(VBOX_ADD_MANUALS)) \
157 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
158 $(call MSG_TOOL,hdiutil,,,$@)
159 @# Cleanup any previously failed attempts and various trash.
160 sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp
161 $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
162 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
163 sudo rm -Rf \
164 $@ \
165 $(VBOX_PATH_PACK_TMP)/DiskImage/
166 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage
167 @# Remove .dmg packages from old depend builds
168 $(QUIET)$(RM) -f $(wildcard $(VBOX_PATH_DIST)/VirtualBox-*-r*.dmg)
169 @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO)
170 $(INSTALL) $(VBOX_PATH_DI_SRC)/DiskImage/VirtualBox_Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/
171ifeq (1,1)
172 @# Pedantic mode...
173 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store
174 $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background
175 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff
176 ifdef VBOX_WITH_BUNDLED_INSTALLER
177 $(if $(VBOX_WITH_DOCS_PACKING), \
178 $(INSTALL) -m 644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/User\ Manual.pdf$(NLTAB) \
179 $(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)) \
180 $(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)))
181 # Rename the main package
182 else
183 $(if $(VBOX_WITH_DOCS_PACKING), $(INSTALL) $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/)
184 $(LN) -s /Applications/ $(VBOX_PATH_PACK_TMP)/DiskImage/Applications
185 endif
186endif
187 @# Change the owners.
188 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
189 @# Create the image.
190 sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" "$@"
191 @# Change (back) the owner so it can be deleted by the user.
192 sudo chown "$(shell whoami)" "$@"
193 sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
194
195#
196# The meta-package.
197#
198$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg: \
199 $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg \
200 $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \
201 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
202 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \
203 $$(RegistrationPane_1_TARGET) \
204 $(if $(VBOX_OSE), , \
205 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist \
206 $$(wildcard $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/*.lproj/*.strings \
207 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/*.lproj/RegistrationPane.nib/*.nib)) \
208 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
209 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
210 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
211 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF) \
212 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) \
213 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS)) \
214 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
215 $(call MSG_TOOL,PackageMaker,,,$@)
216 @# Cleanup any previously failed attempts.
217 sudo rm -Rf \
218 $@ \
219 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \
220 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
221 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res
222 @# Correct directory permissions are important.
223 $(MKDIR) -p \
224 $(@D) \
225 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
226 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
227 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj
228 @# Do keyword replacement in the package info and description files.
229ifdef VBOX_USE_PACKAGEMAKER
230 $(SED) \
231 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
232 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
233 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
234 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
235 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
236 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
237 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
238 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \
239 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Info.plist
240 $(SED) \
241 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
242 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
243 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
244 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
245 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
246 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
247 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
248 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \
249 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Description.plist
250endif # !VBOX_USE_PACKAGEMAKER
251 $(SED) \
252 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
253 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
254 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
255 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
256 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
257 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
258 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
259 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Welcome.rtf \
260 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.rtf
261 @# Copy the resources.
262 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Conclusion.rtf
263 $(SED) \
264 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
265 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
266 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
267 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/English.lproj/Localizable.strings \
268 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
269 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/background.tif
270 $(INSTALL) -m 0766 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/checkforrunningvms $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/checkforrunningvms
271 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
272 $(MKDIR) -p \
273 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
274 $(SED) \
275 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
276 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
277 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
278 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
279 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
280 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
281 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VIRTUALBOX_CONCLUSION_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Conclusion.rtf$(NLTAB) \
282 $(SED) \
283 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
284 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
285 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
286 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
287 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
288 )
289 @# Build the package.
290ifdef VBOX_USE_PACKAGEMAKER
291 $(VBOX_PACKAGEMAKER) -build -v \
292 -p $@ \
293 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
294 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Info.plist \
295 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc/Description.plist \
296 -mi $(VBOX_PATH_PACK_TMP)/Packages
297 @# Copy the plugins.
298 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist $@/Contents/
299ifndef VBOX_OSE
300 $(MKDIR) -p $@/Contents/Plugins/
301ifdef VBOX_WITH_SERIALNUMBER_INSTALL
302 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist
303else
304 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/InstallerSections.plist $@/Contents/Plugins/InstallerSections.plist.off
305endif
306 @# Copy the Registration Pane plugin.
307 $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/
308 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Info.plist $@/Contents/Plugins/RegistrationPane.bundle/Contents/
309 $(INSTALL) -m 0644 $(RegistrationPane_1_TARGET) $@/Contents/Plugins/RegistrationPane.bundle/Contents/MacOS/
310 $(MKDIR) -p $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib
311 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/InfoPlist.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/
312 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/Localizable.strings $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/
313 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/RegistrationPane.nib/classes.nib $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib/
314 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/RegistrationPane.nib/info.nib $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib/
315 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/InstallerPlugins/RegistrationPane/Resources/English.lproj/RegistrationPane.nib/keyedobjects.nib $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/English.lproj/RegistrationPane.nib/
316 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
317 $(MKDIR) -p \
318 $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
319 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_INFOPLIST_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/InfoPlist.strings$(NLTAB) \
320 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_REGISTRATIONPANE_LOCALIZABLE_STRINGS) $@/Contents/Plugins/RegistrationPane.bundle/Contents/Resources/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings$(NLTAB) \
321 )
322endif
323else # !VBOX_USE_PACKAGEMAKER
324 $(VBOX_PRODUCTBUILD) \
325 --distribution $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist \
326 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
327 --resources $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res \
328 --identifier org.virtualbox.mpkg.virtualbox \
329 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
330 $@
331endif # !VBOX_USE_PACKAGEMAKER
332 @# Cleanup.
333 sudo rm -Rf \
334 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.root \
335 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.desc \
336 $(VBOX_PATH_PACK_TMP)/VirtualBox.mpkg.res
337
338VirtualBox.mpkg: $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.mpkg
339
340#
341# The VirtualBox Kernel extensions.
342#
343VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB
344VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
345
346$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
347 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
348 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
349 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
350 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
351 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
352 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
353 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
354 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
355 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
356 $(call MSG_TOOL,PackageMaker,,,$@)
357 @# Cleanup any previously failed attempts.
358 sudo rm -Rf \
359 $@ \
360 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
361 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
362 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
363 @# Correct directory permissions are important.
364 $(MKDIR) -p \
365 $(@D) \
366 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
367 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
368 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
369 $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
370 $(MKDIR) -p -m 0755 \
371 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions \
372 $(foreach kext,$(VBOX_DI_KEXTS), \
373 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext \
374 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
375 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
376 @# Copy the common files (Info.plist).
377 $(foreach kext,$(VBOX_DI_KEXTS), \
378 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/)
379 @# Copy the binaries and invoking lipo.
380ifdef VBOX_WITH_COMBINED_PACKAGE
381 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), \
382 $(NLTAB)$(VBOX_DI_LIPO) -create \
383 $(VBOX_PATH_DIST_32)/$(kext).kext/Contents/MacOS/$(kext) \
384 $(VBOX_PATH_DIST_64)/$(kext).kext/Contents/MacOS/$(kext) \
385 -output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
386else
387 $(foreach kext,$(VBOX_DI_KEXTS), \
388 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/)
389endif
390 @# Set the correct owners.
391 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library
392 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions
393 @# Do keyword replacement in the package info and description files.
394ifdef VBOX_USE_PACKAGEMAKER
395 $(SED) \
396 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
397 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
398 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
399 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
400 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
401 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
402 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
403 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
404 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Info.plist
405 $(SED) \
406 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
407 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
408 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
409 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
410 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
411 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
412 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
413 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist \
414 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/Description.plist
415 $(SED) \
416 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
417 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
418 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
419 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/ReadMe.html \
420 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/ReadMe.html
421else
422 $(SED) \
423 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
424 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
425 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
426 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
427 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
428 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
429 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
430 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
431 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/PkgBuildComponent.plist
432endif
433 @# Copy the resources.
434 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/InstallationCheck $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
435 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
436ifdef VBOX_USE_PACKAGEMAKER
437 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
438 $(MKDIR) -p \
439 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
440 $(SED) \
441 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
442 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
443 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
444 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
445 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
446 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
447 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
448 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
449 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST)$(NLTAB) \
450 $(SED) \
451 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
452 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
453 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
454 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/ReadMe.html \
455 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML)$(NLTAB) \
456 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/InstallationCheck.strings$(NLTAB) \
457 )
458 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/English.lproj/InstallationCheck.strings $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj/
459endif
460 @# Build the package.
461ifdef VBOX_USE_PACKAGEMAKER
462 $(VBOX_PACKAGEMAKER) -build -v \
463 -p $@ \
464 -f $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
465 -r $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
466 -i $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Info.plist \
467 -d $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/Description.plist
468else
469 $(VBOX_PKGBUILD) \
470 --root $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/Library/Extensions/ \
471 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
472 --script $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
473 --identifier org.virtualbox.pkg.vboxkexts \
474 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
475 --install-location /Library/Extensions/ \
476 --ownership preserve \
477 $@
478endif
479 @# Cleanup
480 sudo rm -Rf \
481 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
482 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
483 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
484
485
486#
487# The VirtualBox Startupitems.
488#
489$(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg: \
490 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/* \
491 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/*.lproj/*) \
492 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/* \
493 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/*.lproj/*) \
494 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
495 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)) \
496 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
497 $(call MSG_TOOL,PackageMaker,,,$@)
498 @# Cleanup any previously failed attempts.
499 sudo rm -Rf \
500 $@ \
501 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
502 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
503 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
504 @# Correct directory permissions are important.
505 $(MKDIR) -p \
506 $(@D) \
507 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
508 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
509 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj
510 $(MKDIR) -p -m 0775 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
511 $(MKDIR) -p -m 0755 \
512 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems \
513 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox \
514 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources \
515 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj
516 @# Copy the files.
517 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/StartupParameters.plist $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
518 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/VirtualBox $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
519 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/English.lproj/Localizable.strings $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj/
520 @# Set the correct owners.
521 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
522 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems
523 @# Do keyword replacement in the package info and description files.
524ifdef VBOX_USE_PACKAGEMAKER
525 $(SED) \
526 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
527 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
528 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
529 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
530 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
531 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
532 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
533 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
534 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Info.plist
535 $(SED) \
536 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
537 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
538 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
539 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
540 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
541 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
542 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
543 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist \
544 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/Description.plist
545endif
546 @# Copy the resources.
547ifdef VBOX_USE_PACKAGEMAKER
548 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
549 $(MKDIR) -p \
550 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
551 $(SED) \
552 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
553 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
554 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
555 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
556 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
557 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
558 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
559 --output $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
560 $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)$(NLTAB) \
561 )
562endif
563 @# Build the package.
564ifdef VBOX_USE_PACKAGEMAKER
565 $(VBOX_PACKAGEMAKER) -build -v \
566 -p $@ \
567 -f $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
568 -r $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
569 -i $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Info.plist \
570 -d $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc/Description.plist
571else
572 $(VBOX_PKGBUILD) \
573 --root $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/ \
574 --identifier org.virtualbox.pkg.vboxstartupitems \
575 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
576 --install-location /Library/StartupItems/ \
577 --ownership preserve \
578 $@
579endif
580 @# Cleanup
581 sudo rm -Rf \
582 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
583 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
584 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
585
586
587#
588# Figure out which languages that we support and construct
589# .qm and .lproj lists for these.
590#
591include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
592VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
593VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
594
595
596#
597# The VirtualBox Application.
598#
599
600VBOX_DI_VBAPP_DYLIBS = \
601 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \
602 MacOS/VBoxDD.dylib \
603 MacOS/VBoxDD2.dylib \
604 MacOS/VBoxDDU.dylib \
605 MacOS/VBoxREM.dylib \
606 MacOS/VBoxRT.dylib \
607 MacOS/VBoxSharedFolders.dylib \
608 MacOS/VBoxSharedClipboard.dylib \
609 MacOS/VBoxDragAndDropSvc.dylib \
610 MacOS/VBoxGuestPropSvc.dylib \
611 MacOS/VBoxVMM.dylib \
612 MacOS/VBoxXPCOM.dylib \
613 MacOS/VBoxXPCOMC.dylib \
614 MacOS/components/VBoxC.dylib \
615 MacOS/components/VBoxSVCM.dylib \
616 MacOS/components/VBoxXPCOMIPCC.dylib \
617 MacOS/VBoxAuth.dylib \
618 MacOS/VBoxAuthSimple.dylib
619ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
620 VBOX_DI_VBAPP_DYLIBS += \
621 MacOS/accessible/libqtaccessiblewidgets.dylib
622endif
623ifdef VBOX_WITH_GUEST_CONTROL
624 VBOX_DI_VBAPP_DYLIBS += \
625 MacOS/VBoxGuestControlSvc.dylib
626endif
627if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
628 VBOX_DI_VBAPP_DYLIBS += \
629 MacOS/VBoxVRDP.dylib
630endif
631ifdef VBOX_WITH_CROGL
632 VBOX_DI_VBAPP_DYLIBS += \
633 MacOS/VBoxOGLhostcrutil.dylib \
634 MacOS/VBoxOGLhosterrorspu.dylib \
635 MacOS/VBoxOGLrenderspu.dylib \
636 MacOS/VBoxSharedCrOpenGL.dylib
637endif
638ifdef VBOX_WITH_DEBUGGER_GUI
639 VBOX_DI_VBAPP_DYLIBS += \
640 MacOS/VBoxDbg.dylib
641endif
642ifdef VBOX_WITH_HARDENING
643 VBOX_DI_VBAPP_DYLIBS += \
644 MacOS/VirtualBox.dylib \
645 MacOS/VBoxNetDHCP.dylib \
646 MacOS/VBoxHeadless.dylib
647endif
648ifdef VBOX_WITH_HDDPARALLELS_INSTALL
649 VBOX_DI_VBAPP_DYLIBS += \
650 MacOS/VBoxHDDParallels.dylib
651endif
652if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
653 VBOX_DI_VBAPP_DYLIBS += \
654 MacOS/VBoxPython2_6.so
655endif
656if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7)
657 VBOX_DI_VBAPP_DYLIBS += \
658 MacOS/VBoxPython2_7.so
659endif
660
661VBOX_DI_VBAPP_DYLIBS.x86 := \
662 MacOS/VBoxREM32.dylib \
663 MacOS/VBoxREM64.dylib
664ifdef VBOX_WITH_PYTHON
665 VBOX_DI_VBAPP_DYLIBS.x86 += \
666 MacOS/VBoxPython2_5.so \
667 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
668endif
669
670VBOX_DI_VBAPP_DYLIBS.amd64 :=
671if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
672 VBOX_DI_VBAPP_DYLIBS.amd64 += \
673 MacOS/VBoxPython2_6.so
674endif
675
676if defined(VBOX_WITH_JXPCOM)
677 VBOX_DI_VBAPP_DYLIBS += \
678 MacOS/libvboxjxpcom.jnilib
679endif
680
681if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
682 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
683endif
684if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
685 $(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))
686endif
687
688VBOX_DI_VBAPP_PROGS = \
689 MacOS/VBoxManage \
690 MacOS/VBoxSVC \
691 MacOS/VBoxHeadless \
692 MacOS/VBoxXPCOMIPCD \
693 MacOS/VirtualBox \
694 MacOS/VirtualBoxVM \
695 MacOS/VBoxNetAdpCtl \
696 MacOS/VBoxNetDHCP \
697 MacOS/VBoxExtPackHelperApp \
698 MacOS/VBoxBalloonCtrl \
699 MacOS/VBoxAutostart
700ifdef VBOX_WITH_WEBSERVICES
701 VBOX_DI_VBAPP_PROGS += \
702 MacOS/vboxwebsrv
703endif
704
705VBOX_DI_VBAPP_UNIVERSAL_PROGS = \
706 MacOS/vmstarter
707
708VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
709 MacOS/VMMR0.r0 \
710 MacOS/VBoxDDR0.r0 \
711 MacOS/VBoxDD2R0.r0
712
713VBOX_DI_VBAPP_OTHER_BINS = \
714 MacOS/VMMGC.gc \
715 MacOS/VBoxDDGC.gc \
716 MacOS/VBoxDD2GC.gc
717
718VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES = \
719 Resources/virtualbox.icns \
720 Resources/virtualbox.png \
721 Resources/virtualbox-vbox.icns \
722 Resources/virtualbox-vbox-extpack.icns \
723 Resources/virtualbox-ovf.icns \
724 Resources/virtualbox-ova.icns \
725 Resources/virtualbox-vdi.icns \
726 Resources/virtualbox-vmdk.icns \
727 Resources/virtualbox-vhd.icns \
728 Resources/virtualbox-hdd.icns
729
730VBOX_DI_VBAPP_MISC_FILES = \
731 Info.plist \
732 PkgInfo \
733 $(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES) \
734 MacOS/components/VBoxXPCOMBase.xpt \
735 MacOS/components/VirtualBox_XPCOM.xpt \
736 Resources/VirtualBoxVM.app/Contents/Info.plist \
737 Resources/VirtualBoxVM.app/Contents/PkgInfo \
738 $(addprefix Resources/VirtualBoxVM.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES)) \
739 Resources/vmstarter.app/Contents/Info.plist \
740 Resources/vmstarter.app/Contents/PkgInfo \
741 $(addprefix Resources/vmstarter.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES))
742ifdef VBOX_WITH_DOCS_PACKING
743VBOX_DI_VBAPP_MISC_FILES += \
744 MacOS/UserManual.pdf
745endif
746ifdef VBOX_WITH_ADDITIONS_PACKING
747 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
748 VBOX_DI_VBAPP_MISC_FILES += \
749 MacOS/VBoxGuestAdditions.iso
750 endif
751endif
752ifdef VBOX_WITH_EFIFW_PACKING
753VBOX_DI_VBAPP_MISC_FILES += \
754 MacOS/VBoxEFI32.fd \
755 MacOS/VBoxEFI64.fd
756endif
757ifdef VBOX_WITH_COCOA_QT
758VBOX_DI_VBAPP_MISC_FILES += \
759 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \
760 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \
761 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib
762endif
763
764VBOX_DI_VBAPP_SYMLINKS = \
765 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
766 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
767 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod))
768ifdef VBOX_WITH_COCOA_QT
769VBOX_DI_VBAPP_SYMLINKS += \
770 Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Resources=>Versions/4/Resources/
771endif
772
773ifdef VBOX_WITH_PYTHON
774 # Python XPCOM glue
775 VBOX_DI_VBAPP_PYTHON_FILES = \
776 $(foreach f,$(notdir $(wildcard $(VBOX_PATH_DIST)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
777 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
778 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
779 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
780 sdk/bindings/xpcom/python/xpcom/server/factory.py \
781 sdk/bindings/xpcom/python/xpcom/server/loader.py \
782 sdk/bindings/xpcom/python/xpcom/server/module.py \
783 sdk/bindings/xpcom/python/xpcom/server/policy.py \
784 sdk/installer/vboxapisetup.py \
785 sdk/installer/vboxapi/__init__.py \
786 sdk/installer/vboxapi/VirtualBox_constants.py
787endif
788
789
790# (The dependencies are including way too much here because I'm lazy.)
791$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
792 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
793 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
794 $(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)\
795 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
796 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
797 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
798 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
799 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
800 \
801 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
802 $(VBOX_BRAND_LICENSE_TXT) \
803 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
804 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
805 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
806 \
807 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
808 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
809 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
810 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
811 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
812 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
813 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
814 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
815 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
816 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
817 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
818 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
819 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
820 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
821 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
822 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
823 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
824 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist \
825 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist \
826 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh \
827 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
828 $(call MSG_TOOL,PackageMaker,,,$@)
829 @# Cleanup any previously failed attempts.
830 sudo rm -Rf \
831 $@ \
832 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
833 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
834 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
835 @# Correct directory permissions are important.
836 $(MKDIR) -p \
837 $(@D) \
838 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
839 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
840 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
841 $(MKDIR) -p -m 0775 \
842 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
843 $(MKDIR) -p -m 0755 $(sort \
844 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents \
845 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS \
846 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/components \
847 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/nls \
848 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/accessible \
849 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources \
850 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \
851 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \
852 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app \
853 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app/Contents \
854 $(if-expr defined(VBOX_WITH_PYTHON), \
855 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \
856 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer \
857 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/installer/vboxapi \
858 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/ \
859 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom \
860 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python \
861 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
862 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
863 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
864 $(if-expr defined(VBOX_WITH_JXPCOM), \
865 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk/bindings/xpcom/java,) \
866 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/,$(dir \
867 $(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) \
868 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "amd64",$(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64),) \
869 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86", $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86),) \
870 ))\
871 )
872 @# Create the .lproj language directories
873 $(MKDIR) -p -m 0755 \
874 $(addprefix $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
875 @# Install all supported language files
876 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
877 ,$(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))
878ifdef VBOX_WITH_WEBSERVICES
879 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
880endif
881 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
882 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
883 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/
884 @# Install the python stuff
885ifdef VBOX_WITH_PYTHON
886 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
887 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(f)$(NLTAB) )
888 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS
889endif
890ifdef VBOX_WITH_JXPCOM
891 $(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
892endif
893 @# Copy misc files.
894 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
895 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
896ifdef VBOX_WITH_COMBINED_PACKAGE
897 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.x86) \
898 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
899 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES.amd64) \
900 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
901endif
902 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/LICENSE
903ifdef VBOX_WITH_DOCS_PACKING
904 $(foreach f,$(VBOX_ADD_MANUALS) \
905 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(NLTAB))
906endif
907 @# Create symlinks.
908ifdef VBOX_WITH_COMBINED_PACKAGE
909 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.amd64) $(VBOX_DI_VBAPP_SYMLINKS.x86) \
910 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
911else
912 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
913 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
914endif
915 @# Copy the dylibs.
916ifdef VBOX_WITH_COMBINED_PACKAGE
917 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) \
918 ,$(VBOX_DI_LIPO) -create \
919 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) \
920 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) \
921 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
922 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.x86) \
923 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
924 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS.amd64) \
925 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
926else
927 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
928 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(dylib)$(NLTAB))
929endif
930 @# Copy the other binaries.
931ifdef VBOX_WITH_COMBINED_PACKAGE
932 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
933 ,$(VBOX_DI_LIPO) -create \
934 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \
935 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \
936 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
937 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) \
938 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)-x86$(NLTAB) \
939 $(INSTALL) -m 0644 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)-amd64$(NLTAB))
940else
941 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
942 ,$(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))
943endif
944 @# Create/copy the universal executable binaries.
945ifdef VBOX_WITH_COMBINED_PACKAGE
946 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
947 ,$(VBOX_DI_LIPO) -create \
948 $(VBOX_PATH_DIST_32)/VirtualBox.app/Contents/$(otherbin) \
949 $(VBOX_PATH_DIST_64)/VirtualBox.app/Contents/$(otherbin) \
950 -output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)$(NLTAB))
951else
952 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
953 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(otherbin)-$(KBUILD_TARGET_ARCH)$(NLTAB))
954endif
955 @# Copy the binaries.
956ifdef VBOX_WITH_COMBINED_PACKAGE
957 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
958 ,$(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) \
959 $(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))
960else
961 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
962 ,$(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))
963endif
964 @# Create symlinks for all the binaries (corrected by postflight and the VirtualBox StartupItem to hardlinks).
965ifdef VBOX_WITH_COMBINED_PACKAGE
966 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \
967 ,$(LN) -s $(bin)-x86 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB))
968else
969 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) \
970 ,$(LN) -s $(bin)-$(KBUILD_TARGET_ARCH) $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(bin)$(NLTAB))
971endif
972#ifdef VBOX_WITH_HARDENING - disabled temporarily
973if 1
974 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
975 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
976 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
977 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(NLTAB) )
978 $(foreach f, \
979 $(VBOX_DI_VBAPP_DYLIBS) \
980 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE), \
981 $(VBOX_DI_VBAPP_DYLIBS.x86) \
982 $(VBOX_DI_VBAPP_DYLIBS.amd64) \
983 $(addsuffix -x86, $(VBOX_DI_VBAPP_PROGS)) \
984 $(addsuffix -amd64, $(VBOX_DI_VBAPP_PROGS)) \
985 ,$(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
986 $(addsuffix -$(KBUILD_TARGET_ARCH), $(VBOX_DI_VBAPP_PROGS)) \
987 ) \
988 ,install_name_tool \
989 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), \
990 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
991 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
992 -change $(VBOX_PATH_QT4)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
993 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
994 -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \
995 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
996 -change $(qtmod).framework/Versions/4/$(qtmod) \
997 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
998 ) \
999 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/$(f)$(NLTAB) )
1000endif
1001 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
1002 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
1003ifdef VBOX_WITH_HARDENING
1004 ifdef VBOX_WITH_COMBINED_PACKAGE
1005 sudo chmod u+s \
1006 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
1007 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-x86 \
1008 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-amd64)
1009 else
1010 sudo chmod u+s \
1011 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP,\
1012 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/$(bin)-$(KBUILD_TARGET_ARCH))
1013 endif
1014endif
1015 @# Do keyword replacement in the package info and description files.
1016ifdef VBOX_USE_PACKAGEMAKER
1017 $(SED) \
1018 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1019 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1020 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1021 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1022 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1023 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1024 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1025 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
1026 $(VBOX_PATH_DI_SRC)/VirtualBox/Info.plist
1027 $(SED) \
1028 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1029 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1030 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1031 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1032 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1033 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1034 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1035 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist \
1036 $(VBOX_PATH_DI_SRC)/VirtualBox/Description.plist
1037else
1038 $(SED) \
1039 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1040 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1041 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1042 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1043 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1044 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1045 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1046 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
1047 $(VBOX_PATH_DI_SRC)/VirtualBox/PkgBuildComponent.plist
1048endif
1049 @# Copy the resources.
1050ifdef VBOX_USE_PACKAGEMAKER
1051 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
1052 ,$(MKDIR) -p \
1053 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
1054 $(SED) \
1055 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1056 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1057 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1058 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1059 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1060 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1061 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1062 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
1063 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)$(NLTAB) \
1064 )
1065endif
1066 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
1067 @# Build the package.
1068ifdef VBOX_USE_PACKAGEMAKER
1069 $(VBOX_PACKAGEMAKER) -build -v \
1070 -p $@ \
1071 -f $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
1072 -r $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
1073 -i $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Info.plist \
1074 -d $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/Description.plist
1075else
1076 $(VBOX_PKGBUILD) \
1077 --root $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/ \
1078 --component-plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
1079 --script $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
1080 --identifier org.virtualbox.pkg.virtualbox \
1081 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
1082 --install-location /Applications/ \
1083 --ownership preserve \
1084 $@
1085endif
1086 @# Cleanup
1087 sudo rm -Rf \
1088 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
1089 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
1090 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
1091
1092#
1093# The VirtualBox CLI wrapper scripts.
1094#
1095$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
1096 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
1097 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
1098 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
1099 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
1100 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
1101 $(call MSG_TOOL,PackageMaker,,,$@)
1102 @# Cleanup any previously failed attempts.
1103 sudo rm -Rf \
1104 $@ \
1105 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1106 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1107 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1108 @# Correct directory permissions are important.
1109 $(MKDIR) -p \
1110 $(@D) \
1111 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1112 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1113 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
1114 $(MKDIR) -p -m 0755 \
1115 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
1116 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin
1117 @# Generate the wrapper scripts.
1118 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox '#!/bin/bash'
1119 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VirtualBox 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
1120 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage '#!/bin/bash'
1121 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxManage 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
1122 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP '#!/bin/bash'
1123 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxVRDP 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1124 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless '#!/bin/bash'
1125 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxHeadless 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
1126ifdef VBOX_WITH_WEBSERVICES
1127 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv '#!/bin/bash'
1128 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/vboxwebsrv 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
1129endif
1130 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxBalloonCtrl '#!/bin/bash'
1131 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxBalloonCtrl 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl "$$@"'
1132 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxAutostart '#!/bin/bash'
1133 $(APPEND) $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/VBoxAutostart 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart "$$@"'
1134 @# Set the correct owners and file permissions.
1135 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin/*
1136 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
1137 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
1138 @# Do keyword replacement in the package info and description files.
1139ifdef VBOX_USE_PACKAGEMAKER
1140 $(SED) \
1141 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1142 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1143 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1144 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1145 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1146 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1147 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1148 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1149 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Info.plist
1150 $(SED) \
1151 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1152 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1153 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1154 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1155 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1156 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1157 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1158 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist \
1159 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/Description.plist
1160endif
1161 @# Copy the resources.
1162ifdef VBOX_USE_PACKAGEMAKER
1163 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
1164 ,$(MKDIR) -p \
1165 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
1166 $(SED) \
1167 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
1168 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
1169 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
1170 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
1171 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
1172 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
1173 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
1174 --output $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Description.plist \
1175 $(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)$(NLTAB) \
1176 )
1177endif
1178 @# Build the package.
1179ifdef VBOX_USE_PACKAGEMAKER
1180 $(VBOX_PACKAGEMAKER) -build -v \
1181 -p $@ \
1182 -f $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1183 -r $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
1184 -i $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Info.plist \
1185 -d $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc/Description.plist
1186else
1187 $(VBOX_PKGBUILD) \
1188 --root $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/bin \
1189 --identifier org.virtualbox.pkg.virtualboxcli \
1190 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
1191 --install-location /usr/bin \
1192 --ownership preserve \
1193 $@
1194endif
1195 @# Cleanup
1196 sudo rm -Rf \
1197 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1198 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1199 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1200
1201
1202ifndef VBOX_OSE
1203 include $(VBOX_PATH_DI_SRC)/Bundle.kmk
1204endif
1205
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