1 | # $Id: Makefile.kmk 76027 2018-12-06 20:00:04Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Install misc stuff and create dist packages for Mac OS X Guest Additions.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2017 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_ADD_PATH_DI_SRC := $(PATH_SUB_CURRENT)
|
---|
26 | VBOX_ADD_DI_OUT_DIR := $(PATH_TARGET)/additions/Installer
|
---|
27 | BLDDIRS += $(VBOX_ADD_DI_OUT_DIR)
|
---|
28 |
|
---|
29 | ifdef 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
|
---|
41 | else
|
---|
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
|
---|
50 | endif
|
---|
51 |
|
---|
52 | # Unset this to speed up things during makefile hacking.
|
---|
53 | VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
|
---|
54 |
|
---|
55 | # The location of the pkgbuild program.
|
---|
56 | ifndef VBOX_PKGBUILD
|
---|
57 | VBOX_PKGBUILD := pkgbuild
|
---|
58 | endif
|
---|
59 |
|
---|
60 | # The location of the productbuild program.
|
---|
61 | ifndef VBOX_PRODUCTBUILD
|
---|
62 | VBOX_PRODUCTBUILD := productbuild
|
---|
63 | endif
|
---|
64 |
|
---|
65 | # Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
|
---|
66 | ifndef VBOX_PATH_PACK_TMP
|
---|
67 | VBOX_PATH_PACK_TMP := $(VBOX_ADD_DI_OUT_DIR)
|
---|
68 | endif
|
---|
69 |
|
---|
70 |
|
---|
71 | #
|
---|
72 | # The packing.
|
---|
73 | #
|
---|
74 | PACKING += \
|
---|
75 | $(PATH_STAGE)/$(INST_ADDITIONS)VBoxGuestAdditions.pkg \
|
---|
76 | $(PATH_STAGE)/$(INST_ADDITIONS)VBoxDarwinAdditionsUninstall.tool
|
---|
77 |
|
---|
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 | # 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)osx/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 $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
|
---|
189 | $@
|
---|
190 |
|
---|
191 | @# Cleanup.
|
---|
192 | sudo rm -Rf \
|
---|
193 | $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.root \
|
---|
194 | $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
|
---|
195 | $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res
|
---|
196 |
|
---|
197 | VBoxDarwinAdditions.pkg:: $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.pkg
|
---|
198 |
|
---|
199 | #
|
---|
200 | # The VirtualBox Kernel extensions.
|
---|
201 | #
|
---|
202 | VBOX_ADD_DI_KEXTS_UNIVERSAL = VBoxGuest
|
---|
203 | VBOX_ADD_DI_KEXTS = $(VBOX_ADD_DI_KEXTS_UNIVERSAL)
|
---|
204 |
|
---|
205 | $(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsKEXTs.pkg: \
|
---|
206 | $(foreach kext,$(VBOX_ADD_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
|
---|
207 | $(foreach kext,$(VBOX_ADD_DI_KEXTS), $(VBOX_PATH_DIST)/additions/$(kext).kext/Contents/Info.plist) \
|
---|
208 | $$(wildcard $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/* \
|
---|
209 | $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/*.lproj/*) \
|
---|
210 | $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
|
---|
211 | $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
|
---|
212 | $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
|
---|
213 | $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
|
---|
214 | $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/postflight \
|
---|
215 | $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/PkgBuildComponent.plist \
|
---|
216 | $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
|
---|
217 | $(call MSG_TOOL,pkgbuild,,,$@)
|
---|
218 | @# Cleanup any previously failed attempts.
|
---|
219 | sudo rm -Rf \
|
---|
220 | $@ \
|
---|
221 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root \
|
---|
222 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
|
---|
223 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
|
---|
224 | @# Correct directory permissions are important.
|
---|
225 | $(MKDIR) -p \
|
---|
226 | $(@D) \
|
---|
227 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
|
---|
228 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res \
|
---|
229 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res/English.lproj
|
---|
230 | $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library
|
---|
231 | $(MKDIR) -p -m 0755 \
|
---|
232 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions \
|
---|
233 | $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
|
---|
234 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext \
|
---|
235 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
|
---|
236 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
|
---|
237 | @# Copy the common files (Info.plist).
|
---|
238 | $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
|
---|
239 | $(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/)
|
---|
240 | @# Copy the binaries and invoking lipo.
|
---|
241 | ifdef VBOX_WITH_COMBINED_PACKAGE
|
---|
242 | $(foreach kext,$(VBOX_ADD_DI_KEXTS_UNIVERSAL), \
|
---|
243 | $(NLTAB)$(VBOX_DI_LIPO) -create \
|
---|
244 | $(VBOX_PATH_DIST_32)/additions/$(kext).kext/Contents/MacOS/$(kext) \
|
---|
245 | $(VBOX_PATH_DIST_64)/additions/$(kext).kext/Contents/MacOS/$(kext) \
|
---|
246 | -output $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
|
---|
247 | else
|
---|
248 | $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
|
---|
249 | $(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/)
|
---|
250 | endif
|
---|
251 | @# Signed the kext bundles.
|
---|
252 | ifdef VBOX_SIGNING_MODE
|
---|
253 | $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
|
---|
254 | $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext,) )
|
---|
255 | endif
|
---|
256 | @# Set the correct owners.
|
---|
257 | sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library
|
---|
258 | sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions
|
---|
259 |
|
---|
260 | # Copy package internal files
|
---|
261 | $(INSTALL) $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/PkgBuildComponent.plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc/PkgBuildComponent.plist
|
---|
262 |
|
---|
263 | # Copy installer scripts
|
---|
264 | $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
|
---|
265 |
|
---|
266 | @# Build the package.
|
---|
267 | $(VBOX_PKGBUILD) \
|
---|
268 | --root $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/ \
|
---|
269 | --component-plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc/PkgBuildComponent.plist \
|
---|
270 | --script $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res \
|
---|
271 | --identifier org.virtualbox.pkg.additions.kexts \
|
---|
272 | --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
273 | --install-location /Library/Extensions/ \
|
---|
274 | --ownership preserve \
|
---|
275 | $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
|
---|
276 | $@
|
---|
277 | @# Cleanup
|
---|
278 | sudo rm -Rf \
|
---|
279 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root \
|
---|
280 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
|
---|
281 | $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
|
---|
282 |
|
---|
283 | #
|
---|
284 | # The VirtualBox Guest Additions Tools & Services.
|
---|
285 | #
|
---|
286 |
|
---|
287 | VBOX_GA_PKG=VBoxGuestAdditionsToolsAndServices.pkg
|
---|
288 | VBOX_DI_VB_GA_BINARIES=VBoxClient VBoxControl VBoxService
|
---|
289 | $(VBOX_PATH_PACK_TMP)/Packages/$(VBOX_GA_PKG): \
|
---|
290 | $(foreach f, $(VBOX_DI_VB_GA_BINARIES)\
|
---|
291 | ,$(call VBOX_DI_FN_DEP_BOTH,$(f)) ) \
|
---|
292 | $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxclient.plist \
|
---|
293 | $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxservice.plist \
|
---|
294 | $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper \
|
---|
295 | $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool \
|
---|
296 | $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
|
---|
297 | $(call MSG_TOOL,pkgbuild,,,$@)
|
---|
298 | @# Cleanup any previously failed attempts.
|
---|
299 | sudo rm -Rf \
|
---|
300 | $@ \
|
---|
301 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root \
|
---|
302 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
|
---|
303 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res
|
---|
304 | @# Correct directory permissions are important.
|
---|
305 | $(MKDIR) -p \
|
---|
306 | $(@D) \
|
---|
307 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
|
---|
308 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res \
|
---|
309 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res/English.lproj
|
---|
310 |
|
---|
311 | @# Create directory structure within a package w/ proper permittions
|
---|
312 | $(MKDIR) -p -m 0775 \
|
---|
313 | "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions" \
|
---|
314 | "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchAgents" \
|
---|
315 | "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchDaemons"
|
---|
316 |
|
---|
317 | @# Install binaries
|
---|
318 | ifdef VBOX_WITH_COMBINED_PACKAGE
|
---|
319 | $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
|
---|
320 | ,$(VBOX_DI_LIPO) -create \
|
---|
321 | $(VBOX_PATH_DIST_32)/additions/$(binary) \
|
---|
322 | $(VBOX_PATH_DIST_64)/additions/$(binary) \
|
---|
323 | -output "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)"$(NLTAB))
|
---|
324 | $(foreach binary, $(VBOX_DI_VB_GA_BINARIES), \
|
---|
325 | $(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" \
|
---|
326 | $(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" )
|
---|
327 | else
|
---|
328 | $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
|
---|
329 | ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/additions/$(binary) "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)"$(NLTAB))
|
---|
330 | $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
|
---|
331 | ,$(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))
|
---|
332 | endif
|
---|
333 | # Add Uninstall.tool
|
---|
334 | $(INSTALL) $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/" \
|
---|
335 |
|
---|
336 | @# Install launchd stuff
|
---|
337 | $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper \
|
---|
338 | "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/"
|
---|
339 | $(INSTALL) -m 644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxclient.plist \
|
---|
340 | "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchAgents/"
|
---|
341 | $(INSTALL) -m 644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxservice.plist \
|
---|
342 | "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchDaemons/"
|
---|
343 |
|
---|
344 | @# Correct ownership
|
---|
345 | sudo chown -R root:wheel "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/"
|
---|
346 |
|
---|
347 | @# Build the package.
|
---|
348 | $(VBOX_PKGBUILD) \
|
---|
349 | --root "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/" \
|
---|
350 | --script $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res \
|
---|
351 | --identifier org.virtualbox.pkg.additions.tools-and-services \
|
---|
352 | --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
353 | --install-location "/Library/" \
|
---|
354 | --ownership preserve \
|
---|
355 | $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
|
---|
356 | $@
|
---|
357 | @# Cleanup
|
---|
358 | sudo rm -Rf \
|
---|
359 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root \
|
---|
360 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
|
---|
361 | $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res
|
---|