VirtualBox

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

Last change on this file since 83675 was 83675, checked in by vboxsync, 5 years ago

GAs/darwin/Installer: Add previously missing executable signing (just kexts were signed), and introduce the usual central code signing support (which also includes notarization).

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