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