VirtualBox

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

Last change on this file since 62873 was 62523, checked in by vboxsync, 8 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.3 KB
Line 
1# $Id: Makefile.kmk 62523 2016-07-22 19:17:44Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X Guest Additions.
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
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 += $(VBOX_PATH_DIST)/VBoxDarwinAdditions.dmg
75#OTHER_CLEAN = TODO
76
77
78include $(FILE_KBUILD_SUB_FOOTER)
79
80
81#
82# We're running commands as root here, take some care and assertion
83# a sane environment.
84#
85ifeq ($(strip $(VBOX_PATH_DIST)),)
86 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
87endif
88ifeq ($(strip $(VBOX_PATH_DIST)),/)
89 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
90endif
91ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
92 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
93endif
94ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
95 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
96endif
97
98#
99# The disk image.
100#
101$(VBOX_PATH_DIST)/VBoxDarwinAdditions.dmg: \
102 $(VBOX_PATH_PACK_TMP)/DiskImage/VBoxGuestAdditions.pkg \
103 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \
104 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \
105 $$(wildcard $(VBOX_ADD_PATH_DI_SRC)/DiskImage/*) \
106 $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool \
107 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
108 $(call MSG_TOOL,hdiutil,,,$@)
109 @# Cleanup any previously failed attempts and various trash.
110 sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp
111 $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
112 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VBoxGuestAdditions.pkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
113 sudo rm -Rf \
114 $@ \
115 $(VBOX_PATH_PACK_TMP)/DiskImage/
116 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage
117 @# Remove .dmg packages from old depend builds
118 $(QUIET)$(RM) -f $(wildcard $(VBOX_PATH_DIST)/VBoxDarwinAdditions-*-r*.dmg)
119 @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO)
120 $(INSTALL) $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/
121ifeq (1,1)
122 @# Pedantic mode...
123 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store
124 $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background
125 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff
126endif
127 @# Change the owners.
128 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
129 @# Create the image.
130 sudo hdiutil create -format UDBZ -volname "VirtualBox Guest Additions" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" "$@"
131 @# Change (back) the owner so it can be deleted by the user.
132 sudo chown "$(shell whoami)" "$@"
133 sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
134
135#
136# The meta-package.
137#
138
139$(VBOX_PATH_PACK_TMP)/DiskImage/VBoxGuestAdditions.pkg: \
140 $(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsKEXTs.pkg \
141 $(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsToolsAndServices.pkg \
142 $$(wildcard $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/* \
143 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/*.lproj/*) \
144 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
145 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Welcome.rtf \
146 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Conclusion.rtf \
147 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
148 $(call MSG_TOOL,productbuild,,,$@)
149 @# Cleanup any previously failed attempts.
150 sudo rm -Rf \
151 $@ \
152 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.root \
153 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
154 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res
155 @# Correct directory permissions are important.
156 $(MKDIR) -p \
157 $(@D) \
158 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
159 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res \
160 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj
161
162 @# Do keyword replacement in the package info and description files.
163 $(SED) \
164 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
165 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
166 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
167 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
168 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
169 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
170 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
171 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj/Welcome.rtf \
172 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Welcome.rtf
173 @# Copy the resources.
174 $(INSTALL) -m 0644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj/Conclusion.rtf
175
176 $(SED) \
177 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
178 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
179 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
180 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/English.lproj/Localizable.strings \
181 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/Localizable.strings
182 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/background.tif
183
184 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
185 $(MKDIR) -p \
186 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
187 $(SED) \
188 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
189 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
190 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
191 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
192 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
193 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
194 $(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) \
195 $(SED) \
196 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
197 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
198 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
199 --output $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
200 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
201 )
202
203 @# Build the package.
204 $(VBOX_PRODUCTBUILD) \
205 --distribution $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditions_mpkg/distribution.dist \
206 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
207 --resources $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res \
208 --identifier org.VirtualBox.mpkg.GuestAdditions \
209 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
210 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
211 $@
212
213 @# Cleanup.
214 sudo rm -Rf \
215 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.root \
216 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.desc \
217 $(VBOX_PATH_PACK_TMP)/VBoxDarwinAdditions.dist.res
218
219VBoxDarwinAdditions.pkg:: $(VBOX_PATH_PACK_TMP)/DiskImage/VBoxDarwinAdditions.pkg
220
221#
222# The VirtualBox Kernel extensions.
223#
224VBOX_ADD_DI_KEXTS_UNIVERSAL = VBoxGuest
225VBOX_ADD_DI_KEXTS = $(VBOX_ADD_DI_KEXTS_UNIVERSAL)
226
227$(VBOX_PATH_PACK_TMP)/Packages/VBoxGuestAdditionsKEXTs.pkg: \
228 $(foreach kext,$(VBOX_ADD_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
229 $(foreach kext,$(VBOX_ADD_DI_KEXTS), $(VBOX_PATH_DIST)/additions/$(kext).kext/Contents/Info.plist) \
230 $$(wildcard $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/* \
231 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/*.lproj/*) \
232 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
233 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
234 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
235 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
236 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/postflight \
237 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/PkgBuildComponent.plist \
238 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
239 $(call MSG_TOOL,pkgbuild,,,$@)
240 @# Cleanup any previously failed attempts.
241 sudo rm -Rf \
242 $@ \
243 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root \
244 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
245 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
246 @# Correct directory permissions are important.
247 $(MKDIR) -p \
248 $(@D) \
249 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
250 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res \
251 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res/English.lproj
252 $(MKDIR) -p -m 1775 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library
253 $(MKDIR) -p -m 0755 \
254 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions \
255 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
256 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext \
257 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents \
258 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS )
259 @# Copy the common files (Info.plist).
260 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
261 $(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/)
262 @# Copy the binaries and invoking lipo.
263ifdef VBOX_WITH_COMBINED_PACKAGE
264 $(foreach kext,$(VBOX_ADD_DI_KEXTS_UNIVERSAL), \
265 $(NLTAB)$(VBOX_DI_LIPO) -create \
266 $(VBOX_PATH_DIST_32)/additions/$(kext).kext/Contents/MacOS/$(kext) \
267 $(VBOX_PATH_DIST_64)/additions/$(kext).kext/Contents/MacOS/$(kext) \
268 -output $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext/Contents/MacOS/$(kext))
269else
270 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
271 $(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/)
272endif
273 @# Signed the kext bundles.
274ifdef VBOX_SIGNING_MODE
275 $(foreach kext,$(VBOX_ADD_DI_KEXTS), \
276 $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/$(kext).kext,) )
277endif
278 @# Set the correct owners.
279 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library
280 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions
281
282 # Copy package internal files
283 $(INSTALL) $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/PkgBuildComponent.plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc/PkgBuildComponent.plist
284
285 # Copy installer scripts
286 $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
287
288 @# Build the package.
289 $(VBOX_PKGBUILD) \
290 --root $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root/Library/Extensions/ \
291 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc/PkgBuildComponent.plist \
292 --script $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res \
293 --identifier org.virtualbox.pkg.additions.kexts \
294 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
295 --install-location /Library/Extensions/ \
296 --ownership preserve \
297 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
298 $@
299 @# Cleanup
300 sudo rm -Rf \
301 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.root \
302 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.desc \
303 $(VBOX_PATH_PACK_TMP)/VBoxGuestAdditionsKEXTs.pkg.res
304
305#
306# The VirtualBox Guest Additions Tools & Services.
307#
308
309VBOX_GA_PKG=VBoxGuestAdditionsToolsAndServices.pkg
310VBOX_DI_VB_GA_BINARIES=VBoxClient VBoxControl VBoxService
311$(VBOX_PATH_PACK_TMP)/Packages/$(VBOX_GA_PKG): \
312 $(foreach f, $(VBOX_DI_VB_GA_BINARIES)\
313 ,$(call VBOX_DI_FN_DEP_BOTH,$(f)) ) \
314 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxclient.plist \
315 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxservice.plist \
316 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper \
317 $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool \
318 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
319 $(call MSG_TOOL,pkgbuild,,,$@)
320 @# Cleanup any previously failed attempts.
321 sudo rm -Rf \
322 $@ \
323 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root \
324 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
325 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res
326 @# Correct directory permissions are important.
327 $(MKDIR) -p \
328 $(@D) \
329 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
330 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res \
331 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res/English.lproj
332
333 @# Create directory structure within a package w/ proper permittions
334 $(MKDIR) -p -m 0775 \
335 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions" \
336 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchAgents" \
337 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchDaemons"
338
339 @# Install binaries
340ifdef VBOX_WITH_COMBINED_PACKAGE
341 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
342 ,$(VBOX_DI_LIPO) -create \
343 $(VBOX_PATH_DIST_32)/additions/$(binary) \
344 $(VBOX_PATH_DIST_64)/additions/$(binary) \
345 -output "$(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 $(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" \
348 $(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" )
349else
350 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
351 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/additions/$(binary) "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/$(binary)"$(NLTAB))
352 $(foreach binary, $(VBOX_DI_VB_GA_BINARIES) \
353 ,$(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))
354endif
355 # Add Uninstall.tool
356 $(INSTALL) $(VBOX_ADD_PATH_DI_SRC)/DiskImage/Uninstall.tool "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/" \
357
358 @# Install launchd stuff
359 $(INSTALL) -m 0755 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper \
360 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/Application Support/VirtualBox Guest Additions/"
361 $(INSTALL) -m 644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxclient.plist \
362 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchAgents/"
363 $(INSTALL) -m 644 $(VBOX_ADD_PATH_DI_SRC)/VBoxGuestAdditionsToolsAndServices/org.virtualbox.additions.vboxservice.plist \
364 "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/LaunchDaemons/"
365
366 @# Correct ownership
367 sudo chown -R root:wheel "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/"
368
369 @# Build the package.
370 $(VBOX_PKGBUILD) \
371 --root "$(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root/Library/" \
372 --script $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).res \
373 --identifier org.virtualbox.pkg.additions.tools-and-services \
374 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
375 --install-location "/Library/" \
376 --ownership preserve \
377 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
378 $@
379 @# Cleanup
380 sudo rm -Rf \
381 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).root \
382 $(VBOX_PATH_PACK_TMP)/$(VBOX_GA_PKG).desc \
383 $(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