VirtualBox

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

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

Sign binaries when packing mac OS X.

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