VirtualBox

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

Last change on this file since 100255 was 99029, checked in by vboxsync, 23 months ago

*.kmk: Command indent fixes by scm. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.0 KB
Line 
1# $Id: Makefile.kmk 99029 2023-03-17 20:53:10Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X Guest Additions.
4#
5
6#
7# Copyright (C) 2006-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31
32#
33# Globals
34#
35VBOX_ADD_PATH_DI_SRC := $(PATH_SUB_CURRENT)
36VBOX_ADD_DI_OUT_DIR := $(PATH_TARGET)/additions/Installer
37BLDDIRS += $(VBOX_ADD_DI_OUT_DIR)
38
39ifdef VBOX_WITH_COMBINED_PACKAGE
40 ifeq ($(KBUILD_TARGET_ARCH),x86)
41 VBOX_PATH_DIST_32 = $(VBOX_PATH_DIST)/additions
42 VBOX_PATH_DIST_64 = $(PATH_OUT_BASE)/darwin.amd64/$(KBUILD_TYPE)/dist/additions
43 else
44 VBOX_PATH_DIST_64 = $(VBOX_PATH_DIST)/additions
45 VBOX_PATH_DIST_32 = $(PATH_OUT_BASE)/darwin.x86/$(KBUILD_TYPE)/dist
46 endif
47 VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST_32)/$1 $(VBOX_PATH_DIST_64)/$2
48 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST_32)/$1
49 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST_64)/$1
50 VBOX_DI_LIPO = lipo
51else
52 VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST)/additions/$1
53 ifeq ($(KBUILD_TARGET_ARCH),x86)
54 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST)/additions/$1
55 VBOX_DI_FN_DEP_64 =
56 else
57 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST)/additions/$1
58 VBOX_DI_FN_DEP_32 =
59 endif
60endif
61
62# Unset this to speed up things during makefile hacking.
63VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
64
65# The location of the pkgbuild program.
66ifndef VBOX_PKGBUILD
67 VBOX_PKGBUILD := pkgbuild
68endif
69
70# The location of the productbuild program.
71ifndef VBOX_PRODUCTBUILD
72 VBOX_PRODUCTBUILD := productbuild
73endif
74
75# Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
76ifndef VBOX_PATH_PACK_TMP
77 VBOX_PATH_PACK_TMP := $(VBOX_ADD_DI_OUT_DIR)
78endif
79
80
81#
82# The packing.
83#
84PACKING += \
85 $(PATH_STAGE)/$(INST_ADDITIONS)VBoxGuestAdditions.pkg \
86 $(PATH_STAGE)/$(INST_ADDITIONS)VBoxDarwinAdditionsUninstall.tool
87
88#OTHER_CLEAN = TODO
89
90
91include $(FILE_KBUILD_SUB_FOOTER)
92
93
94#
95# We're running commands as root here, take some care and assertion
96# a sane environment.
97#
98ifeq ($(strip $(VBOX_PATH_DIST)),)
99 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
100endif
101ifeq ($(strip $(VBOX_PATH_DIST)),/)
102 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
103endif
104ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
105 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
106endif
107ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
108 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
109endif
110
111#
112# The packing targets.
113#
114$(PATH_STAGE)/$(INST_ADDITIONS)VBoxGuestAdditions.pkg: $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditions.pkg
115 $(MKDIR) -p "$(@D)"
116 $(INSTALL) -m 0644 -- "$<" "$@"
117
118$(PATH_STAGE)/$(INST_ADDITIONS)VBoxDarwinAdditionsUninstall.tool: $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool
119 $(MKDIR) -p "$(@D)"
120 $(INSTALL) -m 0755 -- "$<" "$@"
121
122
123#
124# The meta-package.
125#
126$(VBOX_PATH_PACK_TMP)/VBoxGuestAdditions.pkg: \
127 $(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsKEXTs.pkg \
128 $(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsToolsAndServices.pkg \
129 $$(wildcard $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/* \
130 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/*.lproj/*) \
131 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
132 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Welcome.rtf \
133 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Conclusion.rtf \
134 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/distribution-$(KBUILD_TARGET_ARCH).dist \
135 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
136 $(call MSG_TOOL,productbuild,,,$@)
137 @# Cleanup any previously failed attempts.
138 sudo rm -Rf \
139 $@ \
140 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.root \
141 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
142 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res
143 @# Correct directory permissions are important.
144 $(MKDIR) -p \
145 $(@D) \
146 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
147 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res \
148 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj
149
150 @# Do keyword replacement in the package info and description files.
151 $(SED) \
152 -e 's+@VBOX_VERSION_STRING@+$(VBOX_VERSION_STRING)+g' \
153 -e 's+@VBOX_VERSION_MAJOR@+$(VBOX_VERSION_MAJOR)+g' \
154 -e 's+@VBOX_VERSION_MINOR@+$(VBOX_VERSION_MINOR)+g' \
155 -e 's+@VBOX_VERSION_BUILD@+$(VBOX_VERSION_BUILD)+g' \
156 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
157 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
158 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
159 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj/Welcome.rtf \
160 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Welcome.rtf
161 @# Copy the resources.
162 $(INSTALL) -m 0644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj/Conclusion.rtf
163
164 $(SED) \
165 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
166 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
167 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
168 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj/Localizable.strings \
169 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Localizable.strings
170 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/background.tif
171
172 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
173 $(MKDIR) -p \
174 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
175 $(SED) \
176 -e 's+@VBOX_VERSION_STRING@+$(VBOX_VERSION_STRING)+g' \
177 -e 's+@VBOX_VERSION_MAJOR@+$(VBOX_VERSION_MAJOR)+g' \
178 -e 's+@VBOX_VERSION_MINOR@+$(VBOX_VERSION_MINOR)+g' \
179 -e 's+@VBOX_VERSION_BUILD@+$(VBOX_VERSION_BUILD)+g' \
180 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
181 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
182 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VIRTUALBOX_CONCLUSION_RTF) $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Conclusion.rtf$(NLTAB) \
183 $(SED) \
184 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
185 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
186 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
187 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
188 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
189 )
190
191 @# Build the package.
192 $(VBOX_PRODUCTBUILD) \
193 --distribution $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/distribution-$(KBUILD_TARGET_ARCH).dist \
194 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
195 --resources $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res \
196 --identifier org.VirtualBox.mpkg.GuestAdditions \
197 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
198 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
199 $@
200ifdef VBOX_SIGNING_MODE
201 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
202 @# Sign the created pkg.
203 $(call VBOX_SIGN_PKG_FN,$@,org.VirtualBox.mpkg.GuestAdditions)
204 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
205 @# Notarize the signed pkg (includes stapling).
206 $(call VBOX_NOTARIZE_FILE_FN,$@,org.virtualbox.VBoxGuestAdditions.$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD).$(VBOX_SVN_REV))
207 endif
208 endif
209endif
210
211 @# Cleanup.
212 sudo rm -Rf \
213 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.root \
214 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
215 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res
216
217VBoxDarwinAdditions.pkg:: $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.pkg
218
219#
220# The VirtualBox Kernel extensions.
221#
222VBOX_ADD_DI_KEXTS_UNIVERSAL = VBoxGuest
223VBOX_ADD_DI_KEXTS = $(VBOX_ADD_DI_KEXTS_UNIVERSAL)
224
225$(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsKEXTs.pkg: \
226 $(foreach kext,$(VBOX_ADD_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
227 $(foreach kext,$(VBOX_ADD_DI_KEXTS), $(VBOX_PATH_DIST)/additions/$(kext).kext/Contents/Info.plist) \
228 $$(wildcard $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/* \
229 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/*.lproj/*) \
230 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
231 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
232 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
233 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
234 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/postflight \
235 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/PkgBuildComponent.plist \
236 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
237 $(call MSG_TOOL,pkgbuild,,,$@)
238 @# Cleanup any previously failed attempts.
239 sudo rm -Rf \
240 $@ \
241 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root \
242 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
243 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
244 @# Correct directory permissions are important.
245 $(MKDIR) -p \
246 $(@D) \
247 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
248 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res \
249 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res/English.lproj
250 $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library
251 $(MKDIR) -p -m 0755 \
252 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions \
253 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
254 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext \
255 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
256 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
257 @# Copy the common files (Info.plist).
258 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
259 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/additions/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/)
260 @# Copy the binaries and invoking lipo.
261ifdef VBOX_WITH_COMBINED_PACKAGE
262 $(foreach kext,$(VBOX_ADD_DI_KEXTS_UNIVERSAL), \
263 $(NLTAB)$(VBOX_DI_LIPO) -create \
264 $(VBOX_PATH_DIST_32)/additions/$(kext).kext/Contents/MacOS/$(kext) \
265 $(VBOX_PATH_DIST_64)/additions/$(kext).kext/Contents/MacOS/$(kext) \
266 -output $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
267else
268 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
269 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/additions/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/)
270endif
271 @# Signed the kext bundles.
272ifdef VBOX_SIGNING_MODE
273 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
274 $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext,) )
275endif
276 @# Set the correct owners.
277 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library
278 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions
279
280 # Copy package internal files
281 $(INSTALL) $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/PkgBuildComponent.plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc/PkgBuildComponent.plist
282
283 # Copy installer scripts
284 $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
285
286 @# Build the package.
287 $(VBOX_PKGBUILD) \
288 --root $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/ \
289 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc/PkgBuildComponent.plist \
290 --script $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res \
291 --identifier org.virtualbox.pkg.additions.kexts \
292 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
293 --install-location /Library/Extensions/ \
294 --ownership preserve \
295 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
296 $@
297ifdef VBOX_SIGNING_MODE
298 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
299 @# Sign the created pkg.
300 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.vboxguestadditionskexts)
301 endif
302endif
303 @# Cleanup
304 sudo rm -Rf \
305 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root \
306 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
307 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
308
309#
310# The VirtualBox Guest Additions Tools & Services.
311#
312
313VBOX_GA_PKG = VBoxGuestAdditionsToolsAndServices.pkg
314VBOX_DI_VB_GA_BINARIES = VBoxClient VBoxControl VBoxService
315$(VBOX_PATH_PACK_TMP)/Packages/$(VBOX_GA_PKG): \
316 $(foreach f, $(VBOX_DI_VB_GA_BINARIES) \
317 ,$(call VBOX_DI_FN_DEP_BOTH,$(f)) ) \
318 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxclient.plist \
319 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxservice.plist \
320 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper \
321 $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool \
322 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
323 $(call MSG_TOOL,pkgbuild,,,$@)
324 @# Cleanup any previously failed attempts.
325 sudo rm -Rf \
326 $@ \
327 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root \
328 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
329 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res
330 @# Correct directory permissions are important.
331 $(MKDIR) -p \
332 $(@D) \
333 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
334 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res \
335 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res/English.lproj
336
337 @# Create directory structure within a package w/ proper permittions
338 $(MKDIR) -p -m 0775 \
339 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions" \
340 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchAgents" \
341 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchDaemons"
342
343 @# Install binaries
344ifdef VBOX_WITH_COMBINED_PACKAGE
345 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
346 ,$(VBOX_DI_LIPO) -create \
347 $(VBOX_PATH_DIST_32)/additions/$(binary) \
348 $(VBOX_PATH_DIST_64)/additions/$(binary) \
349 -output "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)"$(NLTAB))
350 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES), \
351 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST_32)/additions/$(binary) "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)-x86" \
352 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST_64)/additions/$(binary) "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)-amd64" )
353else
354 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
355 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/additions/$(binary) "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)"$(NLTAB))
356 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
357 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/additions/$(binary) "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)-$(KBUILD_TARGET_ARCH)"$(NLTAB))
358endif
359 # Add Uninstall.tool
360 $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/"
361ifdef VBOX_SIGNING_MODE
362 $(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/Uninstall.tool,org.virtualbox.app.guestadditions.uninstaller)
363endif
364
365 @# Install launchd stuff
366 $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper \
367 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/"
368 $(INSTALL) -m 644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxclient.plist \
369 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchAgents/"
370 $(INSTALL) -m 644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxservice.plist \
371 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchDaemons/"
372
373 @# Sign the binaries.
374ifdef VBOX_SIGNING_MODE
375 ifdef VBOX_WITH_COMBINED_PACKAGE
376 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
377 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary),org.virtualbox.app.guestadditions.$(notdir $(binary))) )
378 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
379 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)-x86,org.virtualbox.app.guestadditions.$(notdir $(binary))-x86) )
380 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
381 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)-amd64,org.virtualbox.app.guestadditions.$(notdir $(binary))-amd64) )
382 else
383 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
384 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary),org.virtualbox.app.guestadditions.$(notdir $(binary))) )
385 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
386 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)-$(KBUILD_TARGET_ARCH),org.virtualbox.app.guestadditions.$(notdir $(binary))-$(KBUILD_TARGET_ARCH)) )
387 endif
388endif
389
390 @# Correct ownership
391 sudo chown -R root:wheel "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/"
392
393 @# Build the package.
394 $(VBOX_PKGBUILD) \
395 --root "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/" \
396 --script $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res \
397 --identifier org.virtualbox.pkg.additions.tools-and-services \
398 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
399 --install-location "/Library/" \
400 --ownership preserve \
401 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
402 $@
403ifdef VBOX_SIGNING_MODE
404 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
405 @# Sign the created pkg.
406 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.vboxguestadditions)
407 endif
408endif
409 @# Cleanup
410 sudo rm -Rf \
411 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root \
412 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
413 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res
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