bug 723176: support mac dmg signing in the build system - turn on signing of mac builds again. r=ted
authorBen Hearsum <bhearsum@mozilla.com>
Fri, 25 May 2012 09:25:07 -0400
changeset 99455 caea66e968bf9a8da52f91abc312529c4115fc6a
parent 99454 3871d6ca5fb2f1d992b5401db81f8a614b75ea3c
child 99456 034bbdc7b9c930d95cbba487892ed2262e633a71
push id173
push userlsblakk@mozilla.com
push dateFri, 24 Aug 2012 15:39:16 +0000
treeherdermozilla-release@bcc45eb1fb41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs723176
milestone15.0a1
first release with
nightly mac
caea66e968bf / 15.0a1 / 20120525062919 / files
nightly linux32
nightly linux64
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly mac
bug 723176: support mac dmg signing in the build system - turn on signing of mac builds again. r=ted
browser/app/macbuild/Contents/CodeResources
browser/app/macbuild/Contents/_CodeSignature/CodeResources
browser/installer/package-manifest.in
toolkit/locales/l10n.mk
toolkit/mozapps/installer/packager.mk
toolkit/mozapps/installer/signing.mk
new file mode 120000
--- /dev/null
+++ b/browser/app/macbuild/Contents/CodeResources
@@ -0,0 +1,1 @@
+_CodeSignature/CodeResources
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/browser/app/macbuild/Contents/_CodeSignature/CodeResources
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+    <dict>
+        <key>rules</key>
+        <dict>
+            <key>^Info.plist$</key>
+            <true/>
+            <key>^PkgInfo$</key>
+            <true/>
+            <key>^MacOS/</key>
+            <true/>
+            <key>^Resources/</key>
+            <true/>
+            <key>^MacOS/extensions/.*</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/distribution/.*</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/updates/.*</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/active-update.xml$</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/defaults/.*</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/mozilla.cfg$</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/removed-files$</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+            <key>^MacOS/updates.xml$</key><dict>
+                <key>omit</key>
+                <true/>
+                <key>weight</key>
+                <real>10</real>
+            </dict>
+        </dict>
+    </dict>
+</plist>
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -19,16 +19,17 @@
 
 #filter substitution
 
 #ifdef XP_MACOSX
 ; Mac bundle stuff
 @APPNAME@/Contents/Info.plist
 @APPNAME@/Contents/PkgInfo
 @APPNAME@/Contents/Resources/
+@APPNAME@/Contents/_CodeSignature/CodeResources
 #endif
 
 [@AB_CD@]
 @BINPATH@/chrome/@AB_CD@@JAREXT@
 @BINPATH@/chrome/@AB_CD@.manifest
 @BINPATH@/defaults/profile/bookmarks.html
 @BINPATH@/defaults/profile/chrome/*
 @BINPATH@/defaults/profile/localstore.rdf
--- a/toolkit/locales/l10n.mk
+++ b/toolkit/locales/l10n.mk
@@ -69,16 +69,18 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/MacOS
 else
 STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)
 endif
 
 include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
 include $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.mk
 
+PACKAGE_BASE_DIR = $(_ABS_DIST)/l10n-stage
+
 $(STAGEDIST): AB_CD:=en-US
 $(STAGEDIST): UNPACKAGE=$(call ESCAPE_SPACE,$(ZIP_IN))
 $(STAGEDIST): $(call ESCAPE_SPACE,$(ZIP_IN))
 # only mac needs to remove the parent of STAGEDIST...
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 	$(RM) -r -v $(DIST)/l10n-stage
 else
 # ... and windows doesn't like removing STAGEDIST itself, remove all children
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -41,16 +41,17 @@ endif
 ifndef _BINPATH
 _BINPATH = /$(_APPNAME)/Contents/MacOS
 endif # _BINPATH
 ifdef UNIVERSAL_BINARY
 STAGEPATH = universal/
 endif
 endif
 
+PACKAGE_BASE_DIR = $(_ABS_DIST)
 PACKAGE       = $(PKG_PATH)$(PKG_BASENAME)$(PKG_SUFFIX)
 
 # By default, the SDK uses the same packaging type as the main bundle,
 # but on mac it is a .tar.bz2
 SDK_PATH      = $(PKG_PATH)
 ifeq ($(MOZ_APP_NAME),xulrunner)
 SDK_PATH = sdk/
 # Don't codesign xulrunner internally
@@ -548,18 +549,25 @@ MOZ_SIGN_PREPARED_PACKAGE_CMD=$(MOZ_SIGN
 endif
 
 # For final GPG / authenticode signing / dmg signing if required
 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
 MOZ_SIGN_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f))
 endif
 
 ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
+ifeq (Darwin, $(OS_ARCH)) 
+MAKE_PACKAGE    = $(PREPARE_PACKAGE) \
+                  && cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME)  && cd $(PACKAGE_BASE_DIR) \
+                  && $(INNER_MAKE_PACKAGE)
+else
 MAKE_PACKAGE    = $(PREPARE_PACKAGE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \
 		  $(MOZ_PKG_DIR) && $(INNER_MAKE_PACKAGE)
+endif #Darwin
+
 else
 MAKE_PACKAGE    = $(PREPARE_PACKAGE) && $(INNER_MAKE_PACKAGE)
 endif
 
 ifdef MOZ_SIGN_PACKAGE_CMD
 MAKE_PACKAGE    += && $(MOZ_SIGN_PACKAGE_CMD) "$(PACKAGE)"
 endif
 
@@ -757,16 +765,21 @@ ifndef UNIVERSAL_BINARY
 # STAGEPATH
 ifdef MOZ_PKG_MANIFEST
 ifndef MOZ_FAST_PACKAGE
 	$(RM) -rf $(DIST)/xpt $(DIST)/manifests
 endif
 	$(call PACKAGER_COPY, "$(call core_abspath,$(DIST))",\
 	  "$(call core_abspath,$(DIST)/$(MOZ_PKG_DIR))", \
 	  "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
+ifeq (DMG, $(MOZ_PKG_FORMAT))
+ifeq (dmg, $(filter dmg, $(MOZ_INTERNAL_SIGNING_FORMAT)))
+	@cd $(DIST)/$(_APPNAME)/Contents && ln -sf _CodeSignature/CodeResources CodeResources
+endif
+endif
 	$(PERL) $(MOZILLA_DIR)/toolkit/mozapps/installer/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components -v -x "$(XPIDL_LINK)"
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/link-manifests.py \
 	  $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components/components.manifest \
 	  $(patsubst %,$(DIST)/manifests/%/components,$(MOZ_NONLOCALIZED_PKG_LIST))
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/link-manifests.py \
 	  $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/chrome/nonlocalized.manifest \
 	  $(patsubst %,$(DIST)/manifests/%/chrome,$(MOZ_NONLOCALIZED_PKG_LIST))
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/link-manifests.py \
--- a/toolkit/mozapps/installer/signing.mk
+++ b/toolkit/mozapps/installer/signing.mk
@@ -18,16 +18,17 @@ SIGN_INCLUDES := \
 SIGN_EXCLUDES := \
   'D3DCompiler*.dll' \
   'd3dx9*.dll' \
   'msvc*.dll' \
   $(NULL)
 endif # Windows
 
 ifeq (Darwin, $(OS_ARCH))
+MOZ_INTERNAL_SIGNING_FORMAT := dmg
 MOZ_EXTERNAL_SIGNING_FORMAT := gpg
 endif # Darwin
 
 ifeq (linux-gnu,$(TARGET_OS))
 MOZ_EXTERNAL_SIGNING_FORMAT := gpg
 endif # Linux
 endif # MOZ_SIGN_CMD