VirtualBox

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

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

Installer/darwin: Cleaned out the package maker bits.

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