|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 include $(MOZILLA_DIR)/toolkit/mozapps/installer/package-name.mk |
|
6 |
|
7 # This is how we create the binary packages we release to the public. |
|
8 |
|
9 ifndef MOZ_PKG_FORMAT |
|
10 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) |
|
11 MOZ_PKG_FORMAT = DMG |
|
12 else |
|
13 ifeq (,$(filter-out WINNT, $(OS_ARCH))) |
|
14 MOZ_PKG_FORMAT = ZIP |
|
15 else |
|
16 ifeq (,$(filter-out SunOS, $(OS_ARCH))) |
|
17 MOZ_PKG_FORMAT = BZ2 |
|
18 else |
|
19 ifeq (,$(filter-out gtk2 gtk3 qt, $(MOZ_WIDGET_TOOLKIT))) |
|
20 MOZ_PKG_FORMAT = BZ2 |
|
21 else |
|
22 ifeq (android,$(MOZ_WIDGET_TOOLKIT)) |
|
23 MOZ_PKG_FORMAT = APK |
|
24 else |
|
25 MOZ_PKG_FORMAT = TGZ |
|
26 endif |
|
27 endif |
|
28 endif |
|
29 endif |
|
30 endif |
|
31 endif # MOZ_PKG_FORMAT |
|
32 |
|
33 ifeq ($(OS_ARCH),WINNT) |
|
34 INSTALLER_DIR = windows |
|
35 endif |
|
36 |
|
37 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) |
|
38 ifndef _APPNAME |
|
39 _APPNAME = $(MOZ_MACBUNDLE_NAME) |
|
40 endif |
|
41 ifndef _BINPATH |
|
42 _BINPATH = /$(_APPNAME)/Contents/MacOS |
|
43 endif # _BINPATH |
|
44 ifdef UNIVERSAL_BINARY |
|
45 STAGEPATH = universal/ |
|
46 endif |
|
47 endif |
|
48 |
|
49 PACKAGE_BASE_DIR = $(_ABS_DIST) |
|
50 PACKAGE = $(PKG_PATH)$(PKG_BASENAME)$(PKG_SUFFIX) |
|
51 |
|
52 # By default, the SDK uses the same packaging type as the main bundle, |
|
53 # but on mac it is a .tar.bz2 |
|
54 SDK_PATH = $(PKG_PATH) |
|
55 ifeq ($(MOZ_APP_NAME),xulrunner) |
|
56 SDK_PATH = sdk/ |
|
57 # Don't codesign xulrunner internally |
|
58 MOZ_INTERNAL_SIGNING_FORMAT = |
|
59 endif |
|
60 SDK_SUFFIX = $(PKG_SUFFIX) |
|
61 SDK = $(SDK_PATH)$(PKG_BASENAME).sdk$(SDK_SUFFIX) |
|
62 ifdef UNIVERSAL_BINARY |
|
63 SDK = $(SDK_PATH)$(PKG_BASENAME)-$(TARGET_CPU).sdk$(SDK_SUFFIX) |
|
64 endif |
|
65 |
|
66 # JavaScript Shell packaging |
|
67 ifndef LIBXUL_SDK |
|
68 JSSHELL_BINS = \ |
|
69 $(DIST)/bin/js$(BIN_SUFFIX) \ |
|
70 $(DIST)/bin/$(DLL_PREFIX)mozglue$(DLL_SUFFIX) \ |
|
71 $(NULL) |
|
72 ifndef MOZ_NATIVE_NSPR |
|
73 ifeq ($(_MSC_VER),1400) |
|
74 JSSHELL_BINS += $(DIST)/bin/Microsoft.VC80.CRT.manifest |
|
75 JSSHELL_BINS += $(DIST)/bin/msvcr80.dll |
|
76 JSSHELL_BINS += $(DIST)/bin/msvcp80.dll |
|
77 endif |
|
78 ifeq ($(_MSC_VER),1500) |
|
79 JSSHELL_BINS += $(DIST)/bin/Microsoft.VC90.CRT.manifest |
|
80 JSSHELL_BINS += $(DIST)/bin/msvcr90.dll |
|
81 JSSHELL_BINS += $(DIST)/bin/msvcp90.dll |
|
82 endif |
|
83 ifeq ($(_MSC_VER),1600) |
|
84 JSSHELL_BINS += $(DIST)/bin/msvcr100.dll |
|
85 JSSHELL_BINS += $(DIST)/bin/msvcp100.dll |
|
86 endif |
|
87 ifeq ($(_MSC_VER),1700) |
|
88 JSSHELL_BINS += $(DIST)/bin/msvcr110.dll |
|
89 JSSHELL_BINS += $(DIST)/bin/msvcp110.dll |
|
90 endif |
|
91 ifeq ($(_MSC_VER),1800) |
|
92 JSSHELL_BINS += $(DIST)/bin/msvcr120.dll |
|
93 JSSHELL_BINS += $(DIST)/bin/msvcp120.dll |
|
94 endif |
|
95 ifdef MOZ_FOLD_LIBS |
|
96 JSSHELL_BINS += $(DIST)/bin/$(DLL_PREFIX)nss3$(DLL_SUFFIX) |
|
97 else |
|
98 JSSHELL_BINS += \ |
|
99 $(DIST)/bin/$(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ |
|
100 $(DIST)/bin/$(DLL_PREFIX)plds4$(DLL_SUFFIX) \ |
|
101 $(DIST)/bin/$(DLL_PREFIX)plc4$(DLL_SUFFIX) \ |
|
102 $(NULL) |
|
103 endif # MOZ_FOLD_LIBS |
|
104 endif # MOZ_NATIVE_NSPR |
|
105 ifdef MOZ_SHARED_ICU |
|
106 ifeq ($(OS_TARGET), WINNT) |
|
107 ifdef MOZ_DEBUG |
|
108 JSSHELL_BINS += \ |
|
109 $(DIST)/bin/icudtd$(MOZ_ICU_VERSION).dll \ |
|
110 $(DIST)/bin/icuind$(MOZ_ICU_VERSION).dll \ |
|
111 $(DIST)/bin/icuucd$(MOZ_ICU_VERSION).dll \ |
|
112 $(NULL) |
|
113 else |
|
114 JSSHELL_BINS += \ |
|
115 $(DIST)/bin/icudt$(MOZ_ICU_VERSION).dll \ |
|
116 $(DIST)/bin/icuin$(MOZ_ICU_VERSION).dll \ |
|
117 $(DIST)/bin/icuuc$(MOZ_ICU_VERSION).dll \ |
|
118 $(NULL) |
|
119 endif # MOZ_DEBUG |
|
120 else |
|
121 ifeq ($(OS_TARGET), Darwin) |
|
122 JSSHELL_BINS += \ |
|
123 $(DIST)/bin/libicudata.$(MOZ_ICU_VERSION).dylib \ |
|
124 $(DIST)/bin/libicui18n.$(MOZ_ICU_VERSION).dylib \ |
|
125 $(DIST)/bin/libicuuc.$(MOZ_ICU_VERSION).dylib \ |
|
126 $(NULL) |
|
127 else |
|
128 JSSHELL_BINS += \ |
|
129 $(DIST)/bin/libicudata.so.$(MOZ_ICU_VERSION) \ |
|
130 $(DIST)/bin/libicui18n.so.$(MOZ_ICU_VERSION) \ |
|
131 $(DIST)/bin/libicuuc.so.$(MOZ_ICU_VERSION) \ |
|
132 $(NULL) |
|
133 endif # Darwin |
|
134 endif # WINNT |
|
135 endif # MOZ_STATIC_JS |
|
136 MAKE_JSSHELL = $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/dozip.py $(PKG_JSSHELL) $(abspath $(JSSHELL_BINS)) |
|
137 endif # LIBXUL_SDK |
|
138 |
|
139 _ABS_DIST = $(abspath $(DIST)) |
|
140 JARLOG_DIR = $(abspath $(DEPTH)/jarlog/) |
|
141 JARLOG_FILE_AB_CD = $(JARLOG_DIR)/$(AB_CD).log |
|
142 |
|
143 TAR_CREATE_FLAGS := --exclude=.mkdir.done $(TAR_CREATE_FLAGS) |
|
144 CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \ |
|
145 --mode=go-w --exclude=.mkdir.done -f |
|
146 UNPACK_TAR = tar -xf- |
|
147 |
|
148 ifeq ($(MOZ_PKG_FORMAT),TAR) |
|
149 PKG_SUFFIX = .tar |
|
150 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) > $(PACKAGE) |
|
151 INNER_UNMAKE_PACKAGE = $(UNPACK_TAR) < $(UNPACKAGE) |
|
152 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk > $(SDK) |
|
153 endif |
|
154 ifeq ($(MOZ_PKG_FORMAT),TGZ) |
|
155 PKG_SUFFIX = .tar.gz |
|
156 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) | gzip -vf9 > $(PACKAGE) |
|
157 INNER_UNMAKE_PACKAGE = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR) |
|
158 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | gzip -vf9 > $(SDK) |
|
159 endif |
|
160 ifeq ($(MOZ_PKG_FORMAT),BZ2) |
|
161 PKG_SUFFIX = .tar.bz2 |
|
162 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) |
|
163 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - -C $(STAGEPATH)$(MOZ_PKG_DIR) $(_APPNAME) | bzip2 -vf > $(PACKAGE) |
|
164 else |
|
165 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) | bzip2 -vf > $(PACKAGE) |
|
166 endif |
|
167 INNER_UNMAKE_PACKAGE = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR) |
|
168 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK) |
|
169 endif |
|
170 ifeq ($(MOZ_PKG_FORMAT),ZIP) |
|
171 ifdef MOZ_EXTERNAL_SIGNING_FORMAT |
|
172 # We can't use signcode on zip files |
|
173 MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT)) |
|
174 endif |
|
175 PKG_SUFFIX = .zip |
|
176 INNER_MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_DIR) \ |
|
177 -x \*/.mkdir.done |
|
178 INNER_UNMAKE_PACKAGE = $(UNZIP) $(UNPACKAGE) |
|
179 MAKE_SDK = $(ZIP) -r9D $(SDK) $(MOZ_APP_NAME)-sdk |
|
180 endif |
|
181 ifeq ($(MOZ_PKG_FORMAT),SFX7Z) |
|
182 PKG_SUFFIX = .exe |
|
183 INNER_MAKE_PACKAGE = rm -f app.7z && \ |
|
184 mv $(MOZ_PKG_DIR) core && \ |
|
185 $(CYGWIN_WRAPPER) 7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d25 \ |
|
186 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 && \ |
|
187 mv core $(MOZ_PKG_DIR) && \ |
|
188 cat $(SFX_HEADER) app.7z > $(PACKAGE) && \ |
|
189 chmod 0755 $(PACKAGE) |
|
190 INNER_UNMAKE_PACKAGE = $(CYGWIN_WRAPPER) 7z x $(UNPACKAGE) core && \ |
|
191 mv core $(MOZ_PKG_DIR) |
|
192 endif |
|
193 |
|
194 #Create an RPM file |
|
195 ifeq ($(MOZ_PKG_FORMAT),RPM) |
|
196 PKG_SUFFIX = .rpm |
|
197 MOZ_NUMERIC_APP_VERSION = $(shell echo $(MOZ_PKG_VERSION) | sed 's/[^0-9.].*//' ) |
|
198 MOZ_RPM_RELEASE = $(shell echo $(MOZ_PKG_VERSION) | sed 's/[0-9.]*//' ) |
|
199 |
|
200 RPMBUILD_TOPDIR=$(_ABS_DIST)/rpmbuild |
|
201 RPMBUILD_RPMDIR=$(_ABS_DIST) |
|
202 RPMBUILD_SRPMDIR=$(_ABS_DIST) |
|
203 RPMBUILD_SOURCEDIR=$(RPMBUILD_TOPDIR)/SOURCES |
|
204 RPMBUILD_SPECDIR=$(topsrcdir)/toolkit/mozapps/installer/linux/rpm |
|
205 RPMBUILD_BUILDDIR=$(_ABS_DIST)/.. |
|
206 |
|
207 SPEC_FILE = $(RPMBUILD_SPECDIR)/mozilla.spec |
|
208 RPM_INCIDENTALS=$(topsrcdir)/toolkit/mozapps/installer/linux/rpm |
|
209 |
|
210 RPM_CMD = \ |
|
211 echo Creating RPM && \ |
|
212 $(PYTHON) -m mozbuild.action.preprocessor \ |
|
213 -DMOZ_APP_NAME=$(MOZ_APP_NAME) \ |
|
214 -DMOZ_APP_DISPLAYNAME='$(MOZ_APP_DISPLAYNAME)' \ |
|
215 $(RPM_INCIDENTALS)/mozilla.desktop \ |
|
216 -o $(RPMBUILD_SOURCEDIR)/$(MOZ_APP_NAME).desktop && \ |
|
217 rm -rf $(_ABS_DIST)/$(TARGET_CPU) && \ |
|
218 $(RPMBUILD) -bb \ |
|
219 $(SPEC_FILE) \ |
|
220 --target $(TARGET_CPU) \ |
|
221 --buildroot $(RPMBUILD_TOPDIR)/BUILDROOT \ |
|
222 --define 'moz_app_name $(MOZ_APP_NAME)' \ |
|
223 --define 'moz_app_displayname $(MOZ_APP_DISPLAYNAME)' \ |
|
224 --define 'moz_app_version $(MOZ_APP_VERSION)' \ |
|
225 --define 'moz_numeric_app_version $(MOZ_NUMERIC_APP_VERSION)' \ |
|
226 --define 'moz_rpm_release $(MOZ_RPM_RELEASE)' \ |
|
227 --define 'buildid $(BUILDID)' \ |
|
228 --define 'moz_source_repo $(MOZ_SOURCE_REPO)' \ |
|
229 --define 'moz_source_stamp $(MOZ_SOURCE_STAMP)' \ |
|
230 --define 'moz_branding_directory $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)' \ |
|
231 --define '_topdir $(RPMBUILD_TOPDIR)' \ |
|
232 --define '_rpmdir $(RPMBUILD_RPMDIR)' \ |
|
233 --define '_sourcedir $(RPMBUILD_SOURCEDIR)' \ |
|
234 --define '_specdir $(RPMBUILD_SPECDIR)' \ |
|
235 --define '_srcrpmdir $(RPMBUILD_SRPMDIR)' \ |
|
236 --define '_builddir $(RPMBUILD_BUILDDIR)' \ |
|
237 --define '_prefix $(prefix)' \ |
|
238 --define '_libdir $(libdir)' \ |
|
239 --define '_bindir $(bindir)' \ |
|
240 --define '_datadir $(datadir)' \ |
|
241 --define '_installdir $(installdir)' |
|
242 |
|
243 ifdef ENABLE_TESTS |
|
244 RPM_CMD += \ |
|
245 --define 'createtests yes' \ |
|
246 --define '_testsinstalldir $(shell basename $(installdir))' |
|
247 endif |
|
248 |
|
249 ifdef INSTALL_SDK |
|
250 RPM_CMD += \ |
|
251 --define 'createdevel yes' \ |
|
252 --define '_idldir $(idldir)' \ |
|
253 --define '_sdkdir $(sdkdir)' \ |
|
254 --define '_includedir $(includedir)' |
|
255 endif |
|
256 |
|
257 #For each of the main, tests, sdk rpms we want to make sure that |
|
258 #if they exist that they are in objdir/dist/ and that they get |
|
259 #uploaded and that they are beside the other build artifacts |
|
260 MAIN_RPM= $(MOZ_APP_NAME)-$(MOZ_NUMERIC_APP_VERSION)-$(MOZ_RPM_RELEASE).$(BUILDID).$(TARGET_CPU)$(PKG_SUFFIX) |
|
261 UPLOAD_EXTRA_FILES += $(MAIN_RPM) |
|
262 RPM_CMD += && mv $(TARGET_CPU)/$(MAIN_RPM) $(_ABS_DIST)/ |
|
263 |
|
264 ifdef ENABLE_TESTS |
|
265 TESTS_RPM=$(MOZ_APP_NAME)-tests-$(MOZ_NUMERIC_APP_VERSION)-$(MOZ_RPM_RELEASE).$(BUILDID).$(TARGET_CPU)$(PKG_SUFFIX) |
|
266 UPLOAD_EXTRA_FILES += $(TESTS_RPM) |
|
267 RPM_CMD += && mv $(TARGET_CPU)/$(TESTS_RPM) $(_ABS_DIST)/ |
|
268 endif |
|
269 |
|
270 ifdef INSTALL_SDK |
|
271 SDK_RPM=$(MOZ_APP_NAME)-devel-$(MOZ_NUMERIC_APP_VERSION)-$(MOZ_RPM_RELEASE).$(BUILDID).$(TARGET_CPU)$(PKG_SUFFIX) |
|
272 UPLOAD_EXTRA_FILES += $(SDK_RPM) |
|
273 RPM_CMD += && mv $(TARGET_CPU)/$(SDK_RPM) $(_ABS_DIST)/ |
|
274 endif |
|
275 |
|
276 INNER_MAKE_PACKAGE = $(RPM_CMD) |
|
277 #Avoiding rpm repacks, going to try creating/uploading xpi in rpm files instead |
|
278 INNER_UNMAKE_PACKAGE = $(error Try using rpm2cpio and cpio) |
|
279 |
|
280 endif #Create an RPM file |
|
281 |
|
282 |
|
283 ifeq ($(MOZ_PKG_FORMAT),APK) |
|
284 |
|
285 JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar |
|
286 include $(MOZILLA_DIR)/config/android-common.mk |
|
287 |
|
288 # DEBUG_JARSIGNER is defined by android-common.mk and always debug |
|
289 # signs. We want to release sign if possible. |
|
290 ifdef MOZ_SIGN_CMD |
|
291 RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar |
|
292 else |
|
293 RELEASE_JARSIGNER := $(DEBUG_JARSIGNER) |
|
294 endif |
|
295 |
|
296 DIST_FILES = |
|
297 |
|
298 # Place the files in the order they are going to be opened by the linker |
|
299 DIST_FILES += libmozalloc.so |
|
300 ifndef MOZ_FOLD_LIBS |
|
301 DIST_FILES += \ |
|
302 libnspr4.so \ |
|
303 libplc4.so \ |
|
304 libplds4.so \ |
|
305 libmozsqlite3.so \ |
|
306 libnssutil3.so \ |
|
307 $(NULL) |
|
308 endif |
|
309 DIST_FILES += libnss3.so |
|
310 ifndef MOZ_FOLD_LIBS |
|
311 DIST_FILES += \ |
|
312 libssl3.so \ |
|
313 libsmime3.so \ |
|
314 $(NULL) |
|
315 endif |
|
316 DIST_FILES += \ |
|
317 libxul.so \ |
|
318 libnssckbi.so \ |
|
319 libfreebl3.so \ |
|
320 libsoftokn3.so \ |
|
321 resources.arsc \ |
|
322 AndroidManifest.xml \ |
|
323 chrome \ |
|
324 components \ |
|
325 defaults \ |
|
326 modules \ |
|
327 hyphenation \ |
|
328 res \ |
|
329 lib \ |
|
330 extensions \ |
|
331 application.ini \ |
|
332 package-name.txt \ |
|
333 platform.ini \ |
|
334 greprefs.js \ |
|
335 browserconfig.properties \ |
|
336 blocklist.xml \ |
|
337 chrome.manifest \ |
|
338 update.locale \ |
|
339 removed-files \ |
|
340 distribution \ |
|
341 $(NULL) |
|
342 |
|
343 NON_DIST_FILES = \ |
|
344 classes.dex \ |
|
345 $(NULL) |
|
346 |
|
347 UPLOAD_EXTRA_FILES += gecko-unsigned-unaligned.apk |
|
348 |
|
349 DIST_FILES += $(MOZ_CHILD_PROCESS_NAME) |
|
350 |
|
351 GECKO_APP_AP_PATH = $(abspath $(DEPTH)/mobile/android/base) |
|
352 |
|
353 ifdef ENABLE_TESTS |
|
354 INNER_ROBOCOP_PACKAGE=echo |
|
355 INNER_BACKGROUND_TESTS_PACKAGE=echo |
|
356 ifeq ($(MOZ_BUILD_APP),mobile/android) |
|
357 UPLOAD_EXTRA_FILES += robocop.apk |
|
358 UPLOAD_EXTRA_FILES += fennec_ids.txt |
|
359 UPLOAD_EXTRA_FILES += geckoview_library/geckoview_library.zip |
|
360 UPLOAD_EXTRA_FILES += geckoview_library/geckoview_assets.zip |
|
361 UPLOAD_EXTRA_FILES += ../embedding/android/geckoview_example/geckoview_example.apk |
|
362 |
|
363 # Robocop/Robotium tests, Android Background tests, and Fennec need to |
|
364 # be signed with the same key, which means release signing them all. |
|
365 |
|
366 # $(1) is the full path to input: foo-debug-unsigned-unaligned.apk. |
|
367 # $(2) is the full path to output: foo.apk. |
|
368 RELEASE_SIGN_ANDROID_APK = \ |
|
369 cp $(1) $(2)-unaligned.apk && \ |
|
370 $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \ |
|
371 $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \ |
|
372 $(RM) $(2)-unaligned.apk |
|
373 |
|
374 ROBOCOP_PATH = $(abspath $(_ABS_DIST)/../build/mobile/robocop) |
|
375 # Normally, $(NSINSTALL) would be used instead of cp, but INNER_ROBOCOP_PACKAGE |
|
376 # is used in a series of commands that run under a "cd something", while |
|
377 # $(NSINSTALL) is relative. |
|
378 INNER_ROBOCOP_PACKAGE= \ |
|
379 cp $(GECKO_APP_AP_PATH)/fennec_ids.txt $(_ABS_DIST) && \ |
|
380 $(call RELEASE_SIGN_ANDROID_APK,$(ROBOCOP_PATH)/robocop-debug-unsigned-unaligned.apk,$(_ABS_DIST)/robocop.apk) |
|
381 |
|
382 BACKGROUND_TESTS_PATH = $(abspath $(_ABS_DIST)/../mobile/android/tests/background/junit3) |
|
383 INNER_BACKGROUND_TESTS_PACKAGE= \ |
|
384 $(call RELEASE_SIGN_ANDROID_APK,$(BACKGROUND_TESTS_PATH)/background-junit3-debug-unsigned-unaligned.apk,$(_ABS_DIST)/background-junit3.apk) |
|
385 |
|
386 BROWSER_TESTS_PATH = $(abspath $(_ABS_DIST)/../mobile/android/tests/browser/junit3) |
|
387 INNER_BROWSER_TESTS_PACKAGE= \ |
|
388 $(call RELEASE_SIGN_ANDROID_APK,$(BROWSER_TESTS_PATH)/browser-junit3-debug-unsigned-unaligned.apk,$(_ABS_DIST)/browser-junit3.apk) |
|
389 endif |
|
390 else |
|
391 INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Android Robocop for you' |
|
392 INNER_BACKGROUND_TESTS_PACKAGE=echo 'Testing is disabled - No Android Background JUnit 3 tests for you' |
|
393 INNER_BROWSER_TESTS_PACKAGE=echo 'Testing is disabled - No Android Browser JUnit 3tests for you' |
|
394 endif |
|
395 |
|
396 # Create geckoview_library/geckoview_{assets,library}.zip for third-party GeckoView consumers. |
|
397 ifdef NIGHTLY_BUILD |
|
398 ifndef MOZ_DISABLE_GECKOVIEW |
|
399 INNER_MAKE_GECKOVIEW_LIBRARY= \ |
|
400 $(MAKE) -C ../mobile/android/geckoview_library package |
|
401 INNER_MAKE_GECKOVIEW_EXAMPLE= \ |
|
402 $(MAKE) -C ../embedding/android/geckoview_example package |
|
403 else |
|
404 INNER_MAKE_GECKOVIEW_LIBRARY=echo 'GeckoView library packaging is disabled' |
|
405 INNER_MAKE_GECKOVIEW_EXAMPLE=echo 'GeckoView example packaging is disabled' |
|
406 endif |
|
407 else |
|
408 INNER_MAKE_GECKOVIEW_LIBRARY=echo 'GeckoView library packaging is only enabled on Nightly' |
|
409 INNER_MAKE_GECKOVIEW_EXAMPLE=echo 'GeckoView example packaging is only enabled on Nightly' |
|
410 endif |
|
411 |
|
412 ifdef MOZ_OMX_PLUGIN |
|
413 DIST_FILES += libomxplugin.so libomxplugingb.so libomxplugingb235.so \ |
|
414 libomxpluginhc.so libomxpluginfroyo.so libomxpluginkk.so |
|
415 endif |
|
416 |
|
417 SO_LIBRARIES := $(filter %.so,$(DIST_FILES)) |
|
418 # These libraries are placed in the assets/ directory by packager.py. |
|
419 ASSET_SO_LIBRARIES := $(addprefix assets/,$(filter-out libmozglue.so $(MOZ_CHILD_PROCESS_NAME),$(SO_LIBRARIES))) |
|
420 |
|
421 DIST_FILES := $(filter-out $(SO_LIBRARIES),$(DIST_FILES)) |
|
422 NON_DIST_FILES += libmozglue.so $(MOZ_CHILD_PROCESS_NAME) $(ASSET_SO_LIBRARIES) |
|
423 |
|
424 ifdef MOZ_ENABLE_SZIP |
|
425 # These libraries are szipped in-place in the assets/ directory. |
|
426 SZIP_LIBRARIES := $(ASSET_SO_LIBRARIES) |
|
427 endif |
|
428 |
|
429 # Fennec's OMNIJAR_NAME can include a directory; for example, it might |
|
430 # be "assets/omni.ja". This path specifies where the omni.ja file |
|
431 # lives in the APK, but should not root the resources it contains |
|
432 # under assets/ (i.e., resources should not live at chrome://assets/). |
|
433 # packager.py writes /omni.ja in order to be consistent with the |
|
434 # layout expected by language repacks. Therefore, we move it to the |
|
435 # correct path here, in INNER_MAKE_PACKAGE. See comment about |
|
436 # OMNIJAR_NAME in configure.in. |
|
437 |
|
438 # OMNIJAR_DIR is './' for "omni.ja", 'assets/' for "assets/omni.ja". |
|
439 OMNIJAR_DIR := $(dir $(OMNIJAR_NAME)) |
|
440 OMNIJAR_NAME := $(notdir $(OMNIJAR_NAME)) |
|
441 |
|
442 # We force build an ap_ that does not check dependencies below. |
|
443 # Language repacks take advantage of this unchecked dependency ap_ to |
|
444 # insert additional resources (translated strings) into the ap_ |
|
445 # without the build system's participation. This can do the wrong |
|
446 # thing if there are resource changes in between build time and |
|
447 # package time. We try to prevent mismatched resources by erroring |
|
448 # out if the compiled resource IDs are not the same as the resource |
|
449 # IDs being packaged. If we're doing a single locale repack, however, |
|
450 # we don't have a complete object directory, so we can't compare |
|
451 # resource IDs. |
|
452 |
|
453 # A note on the res/ directory. We unzip the ap_ during packaging, |
|
454 # which produces the res/ directory. This directory is then included |
|
455 # in the final package. When we unpack (during locale repacks), we |
|
456 # need to remove the res/ directory because these resources confuse |
|
457 # the l10n packaging script that updates omni.ja: the script tries to |
|
458 # localize the contents of the res/ directory, which fails. Instead, |
|
459 # after the l10n packaging script completes, we build the ap_ |
|
460 # described above (which includes freshly localized Android resources) |
|
461 # and the res/ directory is taken from the ap_ as part of the regular |
|
462 # packaging. |
|
463 |
|
464 PKG_SUFFIX = .apk |
|
465 INNER_MAKE_PACKAGE = \ |
|
466 $(if $(ALREADY_SZIPPED),,$(foreach lib,$(SZIP_LIBRARIES),host/bin/szip $(MOZ_SZIP_FLAGS) $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/$(lib) && )) \ |
|
467 make -C $(GECKO_APP_AP_PATH) gecko-nodeps.ap_ && \ |
|
468 cp $(GECKO_APP_AP_PATH)/gecko-nodeps.ap_ $(_ABS_DIST)/gecko.ap_ && \ |
|
469 ( (test ! -f $(GECKO_APP_AP_PATH)/R.txt && echo "*** Warning: The R.txt that is being packaged might not agree with the R.txt that was built. This is normal during l10n repacks.") || \ |
|
470 diff $(GECKO_APP_AP_PATH)/R.txt $(GECKO_APP_AP_PATH)/gecko-nodeps/R.txt >/dev/null || \ |
|
471 (echo "*** Error: The R.txt that was built and the R.txt that is being packaged are not the same. Rebuild mobile/android/base and re-package." && exit 1)) && \ |
|
472 ( cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && \ |
|
473 mkdir -p lib/$(ANDROID_CPU_ARCH) && \ |
|
474 mv libmozglue.so $(MOZ_CHILD_PROCESS_NAME) lib/$(ANDROID_CPU_ARCH) && \ |
|
475 unzip -o $(_ABS_DIST)/gecko.ap_ && \ |
|
476 rm $(_ABS_DIST)/gecko.ap_ && \ |
|
477 $(ZIP) $(if $(MOZ_ENABLE_SZIP),-0 )$(_ABS_DIST)/gecko.ap_ $(ASSET_SO_LIBRARIES) && \ |
|
478 $(ZIP) -r9D $(_ABS_DIST)/gecko.ap_ $(DIST_FILES) -x $(NON_DIST_FILES) $(SZIP_LIBRARIES) && \ |
|
479 $(if $(filter-out ./,$(OMNIJAR_DIR)), \ |
|
480 mkdir -p $(OMNIJAR_DIR) && mv $(OMNIJAR_NAME) $(OMNIJAR_DIR) && ) \ |
|
481 $(ZIP) -0 $(_ABS_DIST)/gecko.ap_ $(OMNIJAR_DIR)$(OMNIJAR_NAME)) && \ |
|
482 rm -f $(_ABS_DIST)/gecko.apk && \ |
|
483 cp $(_ABS_DIST)/gecko.ap_ $(_ABS_DIST)/gecko.apk && \ |
|
484 $(ZIP) -j0 $(_ABS_DIST)/gecko.apk $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/classes.dex && \ |
|
485 cp $(_ABS_DIST)/gecko.apk $(_ABS_DIST)/gecko-unsigned-unaligned.apk && \ |
|
486 $(RELEASE_JARSIGNER) $(_ABS_DIST)/gecko.apk && \ |
|
487 $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/gecko.apk $(PACKAGE) && \ |
|
488 $(INNER_ROBOCOP_PACKAGE) && \ |
|
489 $(INNER_BACKGROUND_TESTS_PACKAGE) && \ |
|
490 $(INNER_BROWSER_TESTS_PACKAGE) && \ |
|
491 $(INNER_MAKE_GECKOVIEW_LIBRARY) && \ |
|
492 $(INNER_MAKE_GECKOVIEW_EXAMPLE) |
|
493 |
|
494 # Language repacks root the resources contained in assets/omni.ja |
|
495 # under assets/, but the repacks expect them to be rooted at /. |
|
496 # Therefore, we we move the omnijar back to / so the resources are |
|
497 # under the root here, in INNER_UNMAKE_PACKAGE. See comments about |
|
498 # OMNIJAR_NAME earlier in this file and in configure.in. |
|
499 |
|
500 INNER_UNMAKE_PACKAGE = \ |
|
501 mkdir $(MOZ_PKG_DIR) && \ |
|
502 ( cd $(MOZ_PKG_DIR) && \ |
|
503 $(UNZIP) $(UNPACKAGE) && \ |
|
504 mv lib/$(ANDROID_CPU_ARCH)/libmozglue.so . && \ |
|
505 mv lib/$(ANDROID_CPU_ARCH)/*plugin-container* $(MOZ_CHILD_PROCESS_NAME) && \ |
|
506 rm -rf lib/$(ANDROID_CPU_ARCH) && \ |
|
507 rm -rf res \ |
|
508 $(if $(filter-out ./,$(OMNIJAR_DIR)), \ |
|
509 && mv $(OMNIJAR_DIR)$(OMNIJAR_NAME) $(OMNIJAR_NAME)) ) |
|
510 endif |
|
511 |
|
512 ifeq ($(MOZ_PKG_FORMAT),DMG) |
|
513 PKG_SUFFIX = .dmg |
|
514 PKG_DMG_FLAGS = |
|
515 ifneq (,$(MOZ_PKG_MAC_DSSTORE)) |
|
516 PKG_DMG_FLAGS += --copy '$(MOZ_PKG_MAC_DSSTORE):/.DS_Store' |
|
517 endif |
|
518 ifneq (,$(MOZ_PKG_MAC_BACKGROUND)) |
|
519 PKG_DMG_FLAGS += --mkdir /.background --copy '$(MOZ_PKG_MAC_BACKGROUND):/.background' |
|
520 endif |
|
521 ifneq (,$(MOZ_PKG_MAC_ICON)) |
|
522 PKG_DMG_FLAGS += --icon '$(MOZ_PKG_MAC_ICON)' |
|
523 endif |
|
524 ifneq (,$(MOZ_PKG_MAC_RSRC)) |
|
525 PKG_DMG_FLAGS += --resource '$(MOZ_PKG_MAC_RSRC)' |
|
526 endif |
|
527 ifneq (,$(MOZ_PKG_MAC_EXTRA)) |
|
528 PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA) |
|
529 endif |
|
530 _ABS_MOZSRCDIR = $(shell cd $(MOZILLA_DIR) && pwd) |
|
531 ifndef PKG_DMG_SOURCE |
|
532 PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_DIR) |
|
533 endif |
|
534 INNER_MAKE_PACKAGE = $(_ABS_MOZSRCDIR)/build/package/mac_osx/pkg-dmg \ |
|
535 --source '$(PKG_DMG_SOURCE)' --target '$(PACKAGE)' \ |
|
536 --volname '$(MOZ_APP_DISPLAYNAME)' $(PKG_DMG_FLAGS) |
|
537 INNER_UNMAKE_PACKAGE = \ |
|
538 set -ex; \ |
|
539 rm -rf $(_ABS_DIST)/unpack.tmp; \ |
|
540 mkdir -p $(_ABS_DIST)/unpack.tmp; \ |
|
541 $(_ABS_MOZSRCDIR)/build/package/mac_osx/unpack-diskimage $(UNPACKAGE) /tmp/$(MOZ_PKG_APPNAME)-unpack $(_ABS_DIST)/unpack.tmp; \ |
|
542 rsync -a '$(_ABS_DIST)/unpack.tmp/$(_APPNAME)' $(MOZ_PKG_DIR); \ |
|
543 test -n '$(MOZ_PKG_MAC_DSSTORE)' && \ |
|
544 rsync -a '$(_ABS_DIST)/unpack.tmp/.DS_Store' '$(MOZ_PKG_MAC_DSSTORE)'; \ |
|
545 test -n '$(MOZ_PKG_MAC_BACKGROUND)' && \ |
|
546 rsync -a '$(_ABS_DIST)/unpack.tmp/.background/$(notdir $(MOZ_PKG_MAC_BACKGROUND))' '$(MOZ_PKG_MAC_BACKGROUND)'; \ |
|
547 test -n '$(MOZ_PKG_MAC_ICON)' && \ |
|
548 rsync -a '$(_ABS_DIST)/unpack.tmp/.VolumeIcon.icns' '$(MOZ_PKG_MAC_ICON)'; \ |
|
549 rm -rf $(_ABS_DIST)/unpack.tmp; \ |
|
550 if test -n '$(MOZ_PKG_MAC_RSRC)' ; then \ |
|
551 cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \ |
|
552 hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \ |
|
553 { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > '$(MOZ_PKG_MAC_RSRC)' || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \ |
|
554 rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \ |
|
555 fi |
|
556 # The plst and blkx resources are skipped because they belong to each |
|
557 # individual dmg and are created by hdiutil. |
|
558 SDK_SUFFIX = .tar.bz2 |
|
559 SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX) |
|
560 ifeq ($(MOZ_APP_NAME),xulrunner) |
|
561 SDK = $(SDK_PATH)$(MOZ_APP_NAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX) |
|
562 endif |
|
563 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK) |
|
564 endif |
|
565 |
|
566 ifdef MOZ_INTERNAL_SIGNING_FORMAT |
|
567 MOZ_SIGN_PREPARED_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_INTERNAL_SIGNING_FORMAT),-f $(f)) $(foreach i,$(SIGN_INCLUDES),-i $(i)) $(foreach x,$(SIGN_EXCLUDES),-x $(x)) |
|
568 ifeq (WINNT,$(OS_ARCH)) |
|
569 MOZ_SIGN_PREPARED_PACKAGE_CMD += --nsscmd '$(_ABS_DIST)/bin/shlibsign$(BIN_SUFFIX) -v -i' |
|
570 endif |
|
571 endif |
|
572 |
|
573 # For final GPG / authenticode signing / dmg signing if required |
|
574 ifdef MOZ_EXTERNAL_SIGNING_FORMAT |
|
575 MOZ_SIGN_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) |
|
576 endif |
|
577 |
|
578 ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD |
|
579 ifeq (Darwin, $(OS_ARCH)) |
|
580 MAKE_PACKAGE = cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) \ |
|
581 && rm $(MOZ_MACBUNDLE_NAME)/Contents/CodeResources \ |
|
582 && cp $(MOZ_MACBUNDLE_NAME)/Contents/_CodeSignature/CodeResources $(MOZ_MACBUNDLE_NAME)/Contents \ |
|
583 && cd $(PACKAGE_BASE_DIR) \ |
|
584 && $(INNER_MAKE_PACKAGE) |
|
585 else |
|
586 MAKE_PACKAGE = $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \ |
|
587 $(MOZ_PKG_DIR) && $(INNER_MAKE_PACKAGE) |
|
588 endif #Darwin |
|
589 |
|
590 else |
|
591 MAKE_PACKAGE = $(INNER_MAKE_PACKAGE) |
|
592 endif |
|
593 |
|
594 ifdef MOZ_SIGN_PACKAGE_CMD |
|
595 MAKE_PACKAGE += && $(MOZ_SIGN_PACKAGE_CMD) '$(PACKAGE)' |
|
596 endif |
|
597 |
|
598 ifdef MOZ_SIGN_CMD |
|
599 MAKE_SDK += && $(MOZ_SIGN_CMD) -f gpg $(SDK) |
|
600 UPLOAD_EXTRA_FILES += $(SDK).asc |
|
601 endif |
|
602 |
|
603 NO_PKG_FILES += \ |
|
604 core \ |
|
605 bsdecho \ |
|
606 js \ |
|
607 js-config \ |
|
608 jscpucfg \ |
|
609 nsinstall \ |
|
610 viewer \ |
|
611 TestGtkEmbed \ |
|
612 elf-dynstr-gc \ |
|
613 mangle* \ |
|
614 maptsv* \ |
|
615 mfc* \ |
|
616 msdump* \ |
|
617 msmap* \ |
|
618 nm2tsv* \ |
|
619 nsinstall* \ |
|
620 res/samples \ |
|
621 res/throbber \ |
|
622 shlibsign* \ |
|
623 ssltunnel* \ |
|
624 certutil* \ |
|
625 pk12util* \ |
|
626 BadCertServer* \ |
|
627 OCSPStaplingServer* \ |
|
628 GenerateOCSPResponse* \ |
|
629 winEmbed.exe \ |
|
630 chrome/chrome.rdf \ |
|
631 chrome/app-chrome.manifest \ |
|
632 chrome/overlayinfo \ |
|
633 components/compreg.dat \ |
|
634 components/xpti.dat \ |
|
635 content_unit_tests \ |
|
636 necko_unit_tests \ |
|
637 *.dSYM \ |
|
638 $(NULL) |
|
639 |
|
640 # browser/locales/Makefile uses this makefile for its variable defs, but |
|
641 # doesn't want the libs:: rule. |
|
642 ifndef PACKAGER_NO_LIBS |
|
643 libs:: make-package |
|
644 endif |
|
645 |
|
646 DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX) -DBIN_SUFFIX=$(BIN_SUFFIX) |
|
647 |
|
648 ifdef MOZ_FOLD_LIBS |
|
649 DEFINES += -DMOZ_FOLD_LIBS=1 |
|
650 endif |
|
651 |
|
652 GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE) |
|
653 |
|
654 # The following target stages files into two directories: one directory for |
|
655 # core files, and one for optional extensions based on the information in |
|
656 # the MOZ_PKG_MANIFEST file. |
|
657 |
|
658 PKG_ARG = , '$(pkg)' |
|
659 |
|
660 installer-stage: prepare-package |
|
661 ifndef MOZ_PKG_MANIFEST |
|
662 $(error MOZ_PKG_MANIFEST unspecified!) |
|
663 endif |
|
664 @rm -rf $(DEPTH)/installer-stage $(DIST)/xpt |
|
665 @echo 'Staging installer files...' |
|
666 @$(NSINSTALL) -D $(DEPTH)/installer-stage/core |
|
667 @cp -av $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/. $(DEPTH)/installer-stage/core |
|
668 @(cd $(DEPTH)/installer-stage/core && $(CREATE_PRECOMPLETE_CMD)) |
|
669 ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD |
|
670 # The && true is necessary to make sure Pymake spins a shell |
|
671 $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(DEPTH)/installer-stage && true |
|
672 endif |
|
673 |
|
674 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) |
|
675 ELF_HACK_FLAGS = --fill |
|
676 endif |
|
677 |
|
678 # MOZ_PKG_MANIFEST is the canonical way to define the package manifest (which |
|
679 # the packager will preprocess), but for a smooth transition, we derive it |
|
680 # from the now deprecated MOZ_PKG_MANIFEST_P when MOZ_PKG_MANIFEST is not |
|
681 # defined. |
|
682 ifndef MOZ_PKG_MANIFEST |
|
683 ifdef MOZ_PKG_MANIFEST_P |
|
684 MOZ_PKG_MANIFEST := $(MOZ_PKG_MANIFEST_P) |
|
685 endif # MOZ_PKG_MANIFEST_P |
|
686 endif # MOZ_PKG_MANIFEST |
|
687 |
|
688 # For smooth transition of comm-central |
|
689 ifndef MOZ_PACKAGER_FORMAT |
|
690 ifeq ($(MOZ_CHROME_FILE_FORMAT),flat) |
|
691 ifdef MOZ_OMNIJAR |
|
692 MOZ_PACKAGER_FORMAT := omni |
|
693 else |
|
694 MOZ_PACKAGER_FORMAT := flat |
|
695 endif |
|
696 endif |
|
697 endif |
|
698 ifndef MOZ_PACKAGER_FORMAT |
|
699 MOZ_PACKAGER_FORMAT = $(error MOZ_PACKAGER_FORMAT is not set) |
|
700 endif |
|
701 |
|
702 ifneq (android,$(MOZ_WIDGET_TOOLKIT)) |
|
703 OPTIMIZEJARS = 1 |
|
704 endif |
|
705 |
|
706 export NO_PKG_FILES USE_ELF_HACK ELF_HACK_FLAGS |
|
707 |
|
708 # A js binary is needed to perform verification of JavaScript minification. |
|
709 # We can only use the built binary when not cross-compiling. Environments |
|
710 # (such as release automation) can provide their own js binary to enable |
|
711 # verification when cross-compiling. |
|
712 ifndef JS_BINARY |
|
713 ifndef CROSS_COMPILE |
|
714 JS_BINARY = $(wildcard $(DIST)/bin/js) |
|
715 endif |
|
716 endif |
|
717 |
|
718 # Override the value of OMNIJAR_NAME from config.status with the value |
|
719 # set earlier in this file. |
|
720 |
|
721 stage-package: $(MOZ_PKG_MANIFEST) |
|
722 @rm -rf $(DIST)/$(PKG_PATH)$(PKG_BASENAME).tar $(DIST)/$(PKG_PATH)$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST) |
|
723 OMNIJAR_NAME=$(OMNIJAR_NAME) \ |
|
724 $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.py $(DEFINES) \ |
|
725 --format $(MOZ_PACKAGER_FORMAT) \ |
|
726 $(addprefix --removals ,$(MOZ_PKG_REMOVALS)) \ |
|
727 $(if $(filter-out 0,$(MOZ_PKG_FATAL_WARNINGS)),,--ignore-errors) \ |
|
728 $(if $(MOZ_PACKAGER_MINIFY),--minify) \ |
|
729 $(if $(MOZ_PACKAGER_MINIFY_JS),--minify-js \ |
|
730 $(addprefix --js-binary ,$(JS_BINARY)) \ |
|
731 ) \ |
|
732 $(if $(JARLOG_DIR),$(addprefix --jarlog ,$(wildcard $(JARLOG_FILE_AB_CD)))) \ |
|
733 $(if $(OPTIMIZEJARS),--optimizejars) \ |
|
734 $(addprefix --unify ,$(UNIFY_DIST)) \ |
|
735 $(MOZ_PKG_MANIFEST) $(DIST) $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(if $(MOZ_PKG_MANIFEST),,$(_BINPATH)) \ |
|
736 $(if $(filter omni,$(MOZ_PACKAGER_FORMAT)),$(if $(NON_OMNIJAR_FILES),--non-resource $(NON_OMNIJAR_FILES))) |
|
737 $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/find-dupes.py $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR) |
|
738 ifndef LIBXUL_SDK |
|
739 ifdef MOZ_PACKAGE_JSSHELL |
|
740 # Package JavaScript Shell |
|
741 @echo 'Packaging JavaScript Shell...' |
|
742 $(RM) $(PKG_JSSHELL) |
|
743 $(MAKE_JSSHELL) |
|
744 endif # MOZ_PACKAGE_JSSHELL |
|
745 endif # LIBXUL_SDK |
|
746 |
|
747 prepare-package: stage-package |
|
748 |
|
749 make-package-internal: prepare-package make-sourcestamp-file make-buildinfo-file |
|
750 @echo 'Compressing...' |
|
751 cd $(DIST) && $(MAKE_PACKAGE) |
|
752 |
|
753 make-package: FORCE |
|
754 $(MAKE) make-package-internal |
|
755 $(TOUCH) $@ |
|
756 |
|
757 GARBAGE += make-package |
|
758 |
|
759 make-sourcestamp-file:: |
|
760 $(NSINSTALL) -D $(DIST)/$(PKG_PATH) |
|
761 @echo '$(BUILDID)' > $(MOZ_SOURCESTAMP_FILE) |
|
762 @echo '$(MOZ_SOURCE_REPO)/rev/$(MOZ_SOURCE_STAMP)' >> $(MOZ_SOURCESTAMP_FILE) |
|
763 |
|
764 .PHONY: make-buildinfo-file |
|
765 make-buildinfo-file: |
|
766 $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/informulate.py \ |
|
767 $(MOZ_BUILDINFO_FILE) \ |
|
768 BUILDID=$(BUILDID) \ |
|
769 MOZ_SOURCE_REPO=$(MOZ_SOURCE_REPO) \ |
|
770 MOZ_SOURCE_STAMP=$(MOZ_SOURCE_STAMP) \ |
|
771 MOZ_PKG_PLATFORM=$(MOZ_PKG_PLATFORM) |
|
772 |
|
773 # The install target will install the application to prefix/lib/appname-version |
|
774 # In addition if INSTALL_SDK is set, it will install the development headers, |
|
775 # libraries, and IDL files as follows: |
|
776 # dist/include -> prefix/include/appname-version |
|
777 # dist/idl -> prefix/share/idl/appname-version |
|
778 # dist/sdk/lib -> prefix/lib/appname-devel-version/lib |
|
779 # prefix/lib/appname-devel-version/* symlinks to the above directories |
|
780 install:: prepare-package |
|
781 ifeq ($(OS_ARCH),WINNT) |
|
782 $(error "make install" is not supported on this platform. Use "make package" instead.) |
|
783 endif |
|
784 ifeq (bundle,$(MOZ_FS_LAYOUT)) |
|
785 $(error "make install" is not supported on this platform. Use "make package" instead.) |
|
786 endif |
|
787 $(NSINSTALL) -D $(DESTDIR)$(installdir) |
|
788 (cd $(DIST)/$(MOZ_PKG_DIR) && $(TAR) --exclude=precomplete $(TAR_CREATE_FLAGS) - .) | \ |
|
789 (cd $(DESTDIR)$(installdir) && tar -xf -) |
|
790 $(NSINSTALL) -D $(DESTDIR)$(bindir) |
|
791 $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME) |
|
792 ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir) |
|
793 ifdef INSTALL_SDK # Here comes the hard part |
|
794 $(NSINSTALL) -D $(DESTDIR)$(includedir) |
|
795 (cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
796 (cd $(DESTDIR)$(includedir) && tar -xf -) |
|
797 $(NSINSTALL) -D $(DESTDIR)$(idldir) |
|
798 (cd $(DIST)/idl && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
799 (cd $(DESTDIR)$(idldir) && tar -xf -) |
|
800 # SDK directory is the libs + a bunch of symlinks |
|
801 $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/lib |
|
802 $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/bin |
|
803 if test -f $(DIST)/include/xpcom-config.h; then \ |
|
804 $(SYSINSTALL) $(IFLAGS1) $(DIST)/include/xpcom-config.h $(DESTDIR)$(sdkdir); \ |
|
805 fi |
|
806 find $(DIST)/sdk -name '*.pyc' | xargs rm -f |
|
807 (cd $(DIST)/sdk/lib && $(TAR) $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/lib && tar -xf -) |
|
808 (cd $(DIST)/sdk/bin && $(TAR) $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/bin && tar -xf -) |
|
809 $(RM) -f $(DESTDIR)$(sdkdir)/lib $(DESTDIR)$(sdkdir)/bin $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/sdk/idl $(DESTDIR)$(sdkdir)/idl |
|
810 ln -s $(sdkdir)/sdk/lib $(DESTDIR)$(sdkdir)/lib |
|
811 ln -s $(installdir) $(DESTDIR)$(sdkdir)/bin |
|
812 ln -s $(includedir) $(DESTDIR)$(sdkdir)/include |
|
813 ln -s $(idldir) $(DESTDIR)$(sdkdir)/idl |
|
814 endif # INSTALL_SDK |
|
815 |
|
816 make-sdk: |
|
817 $(MAKE) stage-package UNIVERSAL_BINARY= STAGE_SDK=1 MOZ_PKG_DIR=sdk-stage |
|
818 @echo 'Packaging SDK...' |
|
819 $(RM) -rf $(DIST)/$(MOZ_APP_NAME)-sdk |
|
820 $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/bin |
|
821 (cd $(DIST)/sdk-stage && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
822 (cd $(DIST)/$(MOZ_APP_NAME)-sdk/bin && tar -xf -) |
|
823 $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin |
|
824 (cd $(DIST)/host/bin && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
825 (cd $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin && tar -xf -) |
|
826 $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/sdk |
|
827 find $(DIST)/sdk -name '*.pyc' | xargs rm -f |
|
828 (cd $(DIST)/sdk && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
829 (cd $(DIST)/$(MOZ_APP_NAME)-sdk/sdk && tar -xf -) |
|
830 $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/include |
|
831 (cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
832 (cd $(DIST)/$(MOZ_APP_NAME)-sdk/include && tar -xf -) |
|
833 $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/idl |
|
834 (cd $(DIST)/idl && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
835 (cd $(DIST)/$(MOZ_APP_NAME)-sdk/idl && tar -xf -) |
|
836 $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/lib |
|
837 # sdk/lib is the same as sdk/sdk/lib |
|
838 (cd $(DIST)/sdk/lib && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ |
|
839 (cd $(DIST)/$(MOZ_APP_NAME)-sdk/lib && tar -xf -) |
|
840 $(NSINSTALL) -D $(DIST)/$(SDK_PATH) |
|
841 ifndef PKG_SKIP_STRIP |
|
842 USE_ELF_HACK= $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/strip.py $(DIST)/$(MOZ_APP_NAME)-sdk |
|
843 endif |
|
844 cd $(DIST) && $(MAKE_SDK) |
|
845 |
|
846 ifeq ($(OS_TARGET), WINNT) |
|
847 INSTALLER_PACKAGE = $(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe |
|
848 endif |
|
849 |
|
850 # These are necessary because some of our packages/installers contain spaces |
|
851 # in their filenames and GNU Make's $(wildcard) function doesn't properly |
|
852 # deal with them. |
|
853 empty := |
|
854 space = $(empty) $(empty) |
|
855 QUOTED_WILDCARD = $(if $(wildcard $(subst $(space),?,$(1))),'$(1)') |
|
856 ESCAPE_SPACE = $(subst $(space),\$(space),$(1)) |
|
857 ESCAPE_WILDCARD = $(subst $(space),?,$(1)) |
|
858 |
|
859 # This variable defines which OpenSSL algorithm to use to |
|
860 # generate checksums for files that we upload |
|
861 CHECKSUM_ALGORITHM_PARAM = -d sha512 -d md5 -d sha1 |
|
862 |
|
863 # This variable defines where the checksum file will be located |
|
864 CHECKSUM_FILE = '$(DIST)/$(PKG_PATH)/$(CHECKSUMS_FILE_BASENAME).checksums' |
|
865 CHECKSUM_FILES = $(CHECKSUM_FILE) |
|
866 |
|
867 ifeq (WINNT,$(OS_TARGET)) |
|
868 UPLOAD_EXTRA_FILES += host/bin/mar.exe |
|
869 UPLOAD_EXTRA_FILES += host/bin/mbsdiff.exe |
|
870 else |
|
871 UPLOAD_EXTRA_FILES += host/bin/mar |
|
872 UPLOAD_EXTRA_FILES += host/bin/mbsdiff |
|
873 endif |
|
874 |
|
875 UPLOAD_FILES= \ |
|
876 $(call QUOTED_WILDCARD,$(DIST)/$(PACKAGE)) \ |
|
877 $(call QUOTED_WILDCARD,$(INSTALLER_PACKAGE)) \ |
|
878 $(call QUOTED_WILDCARD,$(DIST)/$(COMPLETE_MAR)) \ |
|
879 $(call QUOTED_WILDCARD,$(DIST)/$(LANGPACK)) \ |
|
880 $(call QUOTED_WILDCARD,$(wildcard $(DIST)/$(PARTIAL_MAR))) \ |
|
881 $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)) \ |
|
882 $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip) \ |
|
883 $(call QUOTED_WILDCARD,$(DIST)/$(SDK)) \ |
|
884 $(call QUOTED_WILDCARD,$(MOZ_SOURCESTAMP_FILE)) \ |
|
885 $(call QUOTED_WILDCARD,$(MOZ_BUILDINFO_FILE)) \ |
|
886 $(call QUOTED_WILDCARD,$(PKG_JSSHELL)) \ |
|
887 $(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f)))) |
|
888 |
|
889 ifdef MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS |
|
890 UPLOAD_FILES += \ |
|
891 $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip) |
|
892 endif |
|
893 |
|
894 SIGN_CHECKSUM_CMD= |
|
895 ifdef MOZ_SIGN_CMD |
|
896 # If we're signing with gpg, we'll have a bunch of extra detached signatures to |
|
897 # upload. We also want to sign our checksums file |
|
898 SIGN_CHECKSUM_CMD=$(MOZ_SIGN_CMD) -f gpg $(CHECKSUM_FILE) |
|
899 |
|
900 CHECKSUM_FILES += $(CHECKSUM_FILE).asc |
|
901 UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(COMPLETE_MAR).asc) |
|
902 UPLOAD_FILES += $(call QUOTED_WILDCARD,$(wildcard $(DIST)/$(PARTIAL_MAR).asc)) |
|
903 UPLOAD_FILES += $(call QUOTED_WILDCARD,$(INSTALLER_PACKAGE).asc) |
|
904 UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PACKAGE).asc) |
|
905 endif |
|
906 |
|
907 ifdef MOZ_STUB_INSTALLER |
|
908 UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe) |
|
909 endif |
|
910 |
|
911 checksum: |
|
912 mkdir -p `dirname $(CHECKSUM_FILE)` |
|
913 @$(PYTHON) $(MOZILLA_DIR)/build/checksums.py \ |
|
914 -o $(CHECKSUM_FILE) \ |
|
915 $(CHECKSUM_ALGORITHM_PARAM) \ |
|
916 -s $(call QUOTED_WILDCARD,$(DIST)) \ |
|
917 $(UPLOAD_FILES) |
|
918 @echo 'CHECKSUM FILE START' |
|
919 @cat $(CHECKSUM_FILE) |
|
920 @echo 'CHECKSUM FILE END' |
|
921 $(SIGN_CHECKSUM_CMD) |
|
922 |
|
923 |
|
924 upload: checksum |
|
925 $(PYTHON) $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) \ |
|
926 $(UPLOAD_FILES) \ |
|
927 $(CHECKSUM_FILES) |
|
928 |
|
929 ifndef MOZ_PKG_SRCDIR |
|
930 MOZ_PKG_SRCDIR = $(topsrcdir) |
|
931 endif |
|
932 |
|
933 DIR_TO_BE_PACKAGED ?= ../$(notdir $(topsrcdir)) |
|
934 SRC_TAR_EXCLUDE_PATHS += \ |
|
935 --exclude='.hg*' \ |
|
936 --exclude='CVS' \ |
|
937 --exclude='.cvs*' \ |
|
938 --exclude='.mozconfig*' \ |
|
939 --exclude='*.pyc' \ |
|
940 --exclude='$(MOZILLA_DIR)/Makefile' \ |
|
941 --exclude='$(MOZILLA_DIR)/dist' |
|
942 ifdef MOZ_OBJDIR |
|
943 SRC_TAR_EXCLUDE_PATHS += --exclude='$(MOZ_OBJDIR)' |
|
944 endif |
|
945 CREATE_SOURCE_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \ |
|
946 --mode=go-w $(SRC_TAR_EXCLUDE_PATHS) -f |
|
947 |
|
948 SOURCE_TAR = $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_SRCPACK_BASENAME).tar.bz2 |
|
949 HG_BUNDLE_FILE = $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_BUNDLE_BASENAME).bundle |
|
950 SOURCE_CHECKSUM_FILE = $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_SRCPACK_BASENAME).checksums |
|
951 SOURCE_UPLOAD_FILES = $(SOURCE_TAR) |
|
952 |
|
953 HG ?= hg |
|
954 CREATE_HG_BUNDLE_CMD = $(HG) -v -R $(topsrcdir) bundle --base null |
|
955 ifdef HG_BUNDLE_REVISION |
|
956 CREATE_HG_BUNDLE_CMD += -r $(HG_BUNDLE_REVISION) |
|
957 endif |
|
958 CREATE_HG_BUNDLE_CMD += $(HG_BUNDLE_FILE) |
|
959 ifdef UPLOAD_HG_BUNDLE |
|
960 SOURCE_UPLOAD_FILES += $(HG_BUNDLE_FILE) |
|
961 endif |
|
962 |
|
963 ifdef MOZ_SIGN_CMD |
|
964 SIGN_SOURCE_TAR_CMD = $(MOZ_SIGN_CMD) -f gpg $(SOURCE_TAR) |
|
965 SOURCE_UPLOAD_FILES += $(SOURCE_TAR).asc |
|
966 SIGN_HG_BUNDLE_CMD = $(MOZ_SIGN_CMD) -f gpg $(HG_BUNDLE_FILE) |
|
967 ifdef UPLOAD_HG_BUNDLE |
|
968 SOURCE_UPLOAD_FILES += $(HG_BUNDLE_FILE).asc |
|
969 endif |
|
970 endif |
|
971 |
|
972 # source-package creates a source tarball from the files in MOZ_PKG_SRCDIR, |
|
973 # which is either set to a clean checkout or defaults to $topsrcdir |
|
974 source-package: |
|
975 @echo 'Packaging source tarball...' |
|
976 $(MKDIR) -p $(DIST)/$(PKG_SRCPACK_PATH) |
|
977 (cd $(MOZ_PKG_SRCDIR) && $(CREATE_SOURCE_TAR) - $(DIR_TO_BE_PACKAGED)) | bzip2 -vf > $(SOURCE_TAR) |
|
978 $(SIGN_SOURCE_TAR_CMD) |
|
979 |
|
980 hg-bundle: |
|
981 $(MKDIR) -p $(DIST)/$(PKG_SRCPACK_PATH) |
|
982 $(CREATE_HG_BUNDLE_CMD) |
|
983 $(SIGN_HG_BUNDLE_CMD) |
|
984 |
|
985 source-upload: |
|
986 $(MAKE) upload UPLOAD_FILES='$(SOURCE_UPLOAD_FILES)' CHECKSUM_FILE='$(SOURCE_CHECKSUM_FILE)' |