| 1 | # ***** BEGIN LICENSE BLOCK ***** |
|---|
| 2 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
|---|
| 3 | # |
|---|
| 4 | # The contents of this file are subject to the Mozilla Public License Version |
|---|
| 5 | # 1.1 (the "License"); you may not use this file except in compliance with |
|---|
| 6 | # the License. You may obtain a copy of the License at |
|---|
| 7 | # http://www.mozilla.org/MPL/ |
|---|
| 8 | # |
|---|
| 9 | # Software distributed under the License is distributed on an "AS IS" basis, |
|---|
| 10 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
|---|
| 11 | # for the specific language governing rights and limitations under the |
|---|
| 12 | # License. |
|---|
| 13 | # |
|---|
| 14 | # The Original Code is Mozilla Communicator client code, released |
|---|
| 15 | # March 31, 1998. |
|---|
| 16 | # |
|---|
| 17 | # The Initial Developer of the Original Code is |
|---|
| 18 | # Netscape Communications Corporation. |
|---|
| 19 | # Portions created by the Initial Developer are Copyright (C) 1998 |
|---|
| 20 | # the Initial Developer. All Rights Reserved. |
|---|
| 21 | # |
|---|
| 22 | # Contributor(s): |
|---|
| 23 | # Benjamin Smedberg <bsmedberg@covad.net> |
|---|
| 24 | # Arthur Wiebe <artooro@gmail.com> |
|---|
| 25 | # Mark Mentovai <mark@moxienet.com> |
|---|
| 26 | # |
|---|
| 27 | # Alternatively, the contents of this file may be used under the terms of |
|---|
| 28 | # either of the GNU General Public License Version 2 or later (the "GPL"), |
|---|
| 29 | # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
|---|
| 30 | # in which case the provisions of the GPL or the LGPL are applicable instead |
|---|
| 31 | # of those above. If you wish to allow use of your version of this file only |
|---|
| 32 | # under the terms of either the GPL or the LGPL, and not to allow others to |
|---|
| 33 | # use your version of this file under the terms of the MPL, indicate your |
|---|
| 34 | # decision by deleting the provisions above and replace them with the notice |
|---|
| 35 | # and other provisions required by the GPL or the LGPL. If you do not delete |
|---|
| 36 | # the provisions above, a recipient may use your version of this file under |
|---|
| 37 | # the terms of any one of the MPL, the GPL or the LGPL. |
|---|
| 38 | # |
|---|
| 39 | # ***** END LICENSE BLOCK ***** |
|---|
| 40 | |
|---|
| 41 | include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk |
|---|
| 42 | |
|---|
| 43 | # This is how we create the Unix binary packages we release to the public. |
|---|
| 44 | # Currently the only format is tar.gz (TGZ), but it should be fairly easy |
|---|
| 45 | # to add .rpm (RPM) and .deb (DEB) later. |
|---|
| 46 | |
|---|
| 47 | ifndef MOZ_PKG_FORMAT |
|---|
| 48 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
|---|
| 49 | MOZ_PKG_FORMAT = DMG |
|---|
| 50 | else |
|---|
| 51 | ifeq (,$(filter-out OS2 WINNT BeOS, $(OS_ARCH))) |
|---|
| 52 | MOZ_PKG_FORMAT = ZIP |
|---|
| 53 | ifeq ($(OS_ARCH),OS2) |
|---|
| 54 | INSTALLER_DIR = os2 |
|---|
| 55 | else |
|---|
| 56 | ifeq ($(OS_ARCH), WINNT) |
|---|
| 57 | INSTALLER_DIR = windows |
|---|
| 58 | endif |
|---|
| 59 | endif |
|---|
| 60 | else |
|---|
| 61 | ifeq (,$(filter-out SunOS, $(OS_ARCH))) |
|---|
| 62 | MOZ_PKG_FORMAT = BZ2 |
|---|
| 63 | else |
|---|
| 64 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) |
|---|
| 65 | MOZ_PKG_FORMAT = BZ2 |
|---|
| 66 | else |
|---|
| 67 | MOZ_PKG_FORMAT = TGZ |
|---|
| 68 | endif |
|---|
| 69 | endif |
|---|
| 70 | INSTALLER_DIR = unix |
|---|
| 71 | endif |
|---|
| 72 | endif |
|---|
| 73 | endif # MOZ_PKG_FORMAT |
|---|
| 74 | |
|---|
| 75 | PACKAGE = $(PKG_BASENAME)$(PKG_SUFFIX) |
|---|
| 76 | |
|---|
| 77 | # By default, the SDK uses the same packaging type as the main bundle, |
|---|
| 78 | # but on mac it is a .tar.bz2 |
|---|
| 79 | SDK_SUFFIX = $(PKG_SUFFIX) |
|---|
| 80 | SDK = $(PKG_BASENAME).sdk$(SDK_SUFFIX) |
|---|
| 81 | |
|---|
| 82 | MAKE_PACKAGE = $(error What is a $(MOZ_PKG_FORMAT) package format?); |
|---|
| 83 | |
|---|
| 84 | CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \ |
|---|
| 85 | --mode="go-w" -f |
|---|
| 86 | UNPACK_TAR = tar -x |
|---|
| 87 | |
|---|
| 88 | ifeq ($(MOZ_PKG_FORMAT),TAR) |
|---|
| 89 | PKG_SUFFIX = .tar |
|---|
| 90 | MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) > $(PACKAGE) |
|---|
| 91 | UNMAKE_PACKAGE = $(UNPACK_TAR) < $(UNPACKAGE) |
|---|
| 92 | MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk > $(SDK) |
|---|
| 93 | endif |
|---|
| 94 | ifeq ($(MOZ_PKG_FORMAT),TGZ) |
|---|
| 95 | PKG_SUFFIX = .tar.gz |
|---|
| 96 | MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | gzip -vf9 > $(PACKAGE) |
|---|
| 97 | UNMAKE_PACKAGE = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR) |
|---|
| 98 | MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | gzip -vf9 > $(SDK) |
|---|
| 99 | endif |
|---|
| 100 | ifeq ($(MOZ_PKG_FORMAT),BZ2) |
|---|
| 101 | PKG_SUFFIX = .tar.bz2 |
|---|
| 102 | MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | bzip2 -vf > $(PACKAGE) |
|---|
| 103 | UNMAKE_PACKAGE = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR) |
|---|
| 104 | MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK) |
|---|
| 105 | endif |
|---|
| 106 | ifeq ($(MOZ_PKG_FORMAT),ZIP) |
|---|
| 107 | PKG_SUFFIX = .zip |
|---|
| 108 | MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_APPNAME) |
|---|
| 109 | UNMAKE_PACKAGE = $(UNZIP) $(UNPACKAGE) |
|---|
| 110 | MAKE_SDK = $(ZIP) -r9D $(SDK) $(MOZ_APP_NAME)-sdk |
|---|
| 111 | endif |
|---|
| 112 | ifeq ($(MOZ_PKG_FORMAT),DMG) |
|---|
| 113 | ifndef _APPNAME |
|---|
| 114 | ifdef MOZ_DEBUG |
|---|
| 115 | _APPNAME = $(MOZ_APP_DISPLAYNAME)Debug.app |
|---|
| 116 | else |
|---|
| 117 | _APPNAME = $(MOZ_APP_DISPLAYNAME).app |
|---|
| 118 | endif |
|---|
| 119 | endif |
|---|
| 120 | ifndef _BINPATH |
|---|
| 121 | _BINPATH = /$(_APPNAME)/Contents/MacOS |
|---|
| 122 | endif # _BINPATH |
|---|
| 123 | PKG_SUFFIX = .dmg |
|---|
| 124 | PKG_DMG_FLAGS = |
|---|
| 125 | ifneq (,$(MOZ_PKG_MAC_DSSTORE)) |
|---|
| 126 | PKG_DMG_FLAGS += --copy "$(MOZ_PKG_MAC_DSSTORE):/.DS_Store" |
|---|
| 127 | endif |
|---|
| 128 | ifneq (,$(MOZ_PKG_MAC_BACKGROUND)) |
|---|
| 129 | PKG_DMG_FLAGS += --mkdir /.background --copy "$(MOZ_PKG_MAC_BACKGROUND):/.background" |
|---|
| 130 | endif |
|---|
| 131 | ifneq (,$(MOZ_PKG_MAC_ICON)) |
|---|
| 132 | PKG_DMG_FLAGS += --icon "$(MOZ_PKG_MAC_ICON)" |
|---|
| 133 | endif |
|---|
| 134 | ifneq (,$(MOZ_PKG_MAC_RSRC)) |
|---|
| 135 | PKG_DMG_FLAGS += --resource "$(MOZ_PKG_MAC_RSRC)" |
|---|
| 136 | endif |
|---|
| 137 | ifneq (,$(MOZ_PKG_MAC_EXTRA)) |
|---|
| 138 | PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA) |
|---|
| 139 | endif |
|---|
| 140 | _ABS_TOPSRCDIR = $(shell cd $(topsrcdir) && pwd) |
|---|
| 141 | ifdef UNIVERSAL_BINARY |
|---|
| 142 | STAGEPATH = universal/ |
|---|
| 143 | endif |
|---|
| 144 | ifndef PKG_DMG_SOURCE |
|---|
| 145 | PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_APPNAME) |
|---|
| 146 | endif |
|---|
| 147 | MAKE_PACKAGE = $(_ABS_TOPSRCDIR)/build/package/mac_osx/pkg-dmg \ |
|---|
| 148 | --source "$(PKG_DMG_SOURCE)" --target "$(PACKAGE)" \ |
|---|
| 149 | --volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS) |
|---|
| 150 | UNMAKE_PACKAGE = \ |
|---|
| 151 | set -ex; \ |
|---|
| 152 | function cleanup() { \ |
|---|
| 153 | hdiutil detach $${DEV_NAME} || \ |
|---|
| 154 | { sleep 5 && hdiutil detach $${DEV_NAME} -force; }; \ |
|---|
| 155 | return $$1 && $$?; \ |
|---|
| 156 | }; \ |
|---|
| 157 | unset NEXT_ROOT; \ |
|---|
| 158 | export PAGER=true; \ |
|---|
| 159 | echo Y | hdiutil attach -readonly -mountroot /tmp -private -noautoopen $(UNPACKAGE) > hdi.output; \ |
|---|
| 160 | DEV_NAME=`perl -n -e 'if($$_=~/(\/dev\/disk[^ ]*)/) {print $$1."\n";exit;}'< hdi.output`; \ |
|---|
| 161 | MOUNTPOINT=`perl -n -e 'split(/\/dev\/disk[^ ]*/,$$_,2);if($$_[1]=~/(\/.*)/) {print $$1."\n";exit;}'< hdi.output` || cleanup 1; \ |
|---|
| 162 | rsync -a "$${MOUNTPOINT}/$(_APPNAME)" $(MOZ_PKG_APPNAME) || cleanup 1; \ |
|---|
| 163 | test -n "$(MOZ_PKG_MAC_DSSTORE)" && \ |
|---|
| 164 | { rsync -a "$${MOUNTPOINT}/.DS_Store" "$(MOZ_PKG_MAC_DSSTORE)" || cleanup 1; }; \ |
|---|
| 165 | test -n "$(MOZ_PKG_MAC_BACKGROUND)" && \ |
|---|
| 166 | { rsync -a "$${MOUNTPOINT}/.background/`basename "$(MOZ_PKG_MAC_BACKGROUND)"`" "$(MOZ_PKG_MAC_BACKGROUND)" || cleanup 1; }; \ |
|---|
| 167 | test -n "$(MOZ_PKG_MAC_ICON)" && \ |
|---|
| 168 | { rsync -a "$${MOUNTPOINT}/.VolumeIcon.icns" "$(MOZ_PKG_MAC_ICON)" || cleanup 1; }; \ |
|---|
| 169 | cleanup 0; \ |
|---|
| 170 | if test -n "$(MOZ_PKG_MAC_RSRC)" ; then \ |
|---|
| 171 | cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \ |
|---|
| 172 | hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \ |
|---|
| 173 | { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > "$(MOZ_PKG_MAC_RSRC)" || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \ |
|---|
| 174 | rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \ |
|---|
| 175 | fi; \ |
|---|
| 176 | $(NULL) |
|---|
| 177 | # The plst and blkx resources are skipped because they belong to each |
|---|
| 178 | # individual dmg and are created by hdiutil. |
|---|
| 179 | SDK_SUFFIX = .tar.bz2 |
|---|
| 180 | SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX) |
|---|
| 181 | MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK) |
|---|
| 182 | endif |
|---|
| 183 | |
|---|
| 184 | # dummy macro if we don't have PSM built |
|---|
| 185 | SIGN_NSS = |
|---|
| 186 | ifneq (1_,$(if $(CROSS_COMPILE),1,0)_$(UNIVERSAL_BINARY)) |
|---|
| 187 | ifdef MOZ_PSM |
|---|
| 188 | SIGN_NSS = @echo signing nss libraries; |
|---|
| 189 | |
|---|
| 190 | NSS_DLL_SUFFIX = $(DLL_SUFFIX) |
|---|
| 191 | ifdef UNIVERSAL_BINARY |
|---|
| 192 | NATIVE_ARCH = $(shell uname -p | sed -e s/powerpc/ppc/) |
|---|
| 193 | NATIVE_DIST = $(DIST)/../../$(NATIVE_ARCH)/dist |
|---|
| 194 | SIGN_CMD = $(NATIVE_DIST)/bin/run-mozilla.sh $(NATIVE_DIST)/bin/shlibsign -v -i |
|---|
| 195 | else |
|---|
| 196 | ifeq ($(OS_ARCH),OS2) |
|---|
| 197 | # uppercase extension to get the correct output file from shlibsign |
|---|
| 198 | NSS_DLL_SUFFIX = .DLL |
|---|
| 199 | SIGN_CMD = $(topsrcdir)/toolkit/mozapps/installer/os2/sign.cmd $(DIST) |
|---|
| 200 | else |
|---|
| 201 | SIGN_CMD = $(RUN_TEST_PROGRAM) $(DIST)/bin/shlibsign -v -i |
|---|
| 202 | endif |
|---|
| 203 | endif |
|---|
| 204 | |
|---|
| 205 | SOFTOKN = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)softokn3$(NSS_DLL_SUFFIX) |
|---|
| 206 | FREEBL = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl3$(NSS_DLL_SUFFIX) |
|---|
| 207 | FREEBL_32FPU = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32fpu_3$(DLL_SUFFIX) |
|---|
| 208 | FREEBL_32INT = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32int_3$(DLL_SUFFIX) |
|---|
| 209 | FREEBL_32INT64 = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32int64_3$(DLL_SUFFIX) |
|---|
| 210 | FREEBL_64FPU = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_64fpu_3$(DLL_SUFFIX) |
|---|
| 211 | FREEBL_64INT = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_64int_3$(DLL_SUFFIX) |
|---|
| 212 | |
|---|
| 213 | SIGN_NSS += $(SIGN_CMD) $(SOFTOKN); \ |
|---|
| 214 | if test -f $(FREEBL); then $(SIGN_CMD) $(FREEBL); fi; \ |
|---|
| 215 | if test -f $(FREEBL_32FPU); then $(SIGN_CMD) $(FREEBL_32FPU); fi; \ |
|---|
| 216 | if test -f $(FREEBL_32INT); then $(SIGN_CMD) $(FREEBL_32INT); fi; \ |
|---|
| 217 | if test -f $(FREEBL_32INT64); then $(SIGN_CMD) $(FREEBL_32INT64); fi; \ |
|---|
| 218 | if test -f $(FREEBL_64FPU); then $(SIGN_CMD) $(FREEBL_64FPU); fi; \ |
|---|
| 219 | if test -f $(FREEBL_64INT); then $(SIGN_CMD) $(FREEBL_64INT); fi; |
|---|
| 220 | |
|---|
| 221 | endif # MOZ_PSM |
|---|
| 222 | endif # !CROSS_COMPILE |
|---|
| 223 | |
|---|
| 224 | NO_PKG_FILES += \ |
|---|
| 225 | core \ |
|---|
| 226 | bsdecho \ |
|---|
| 227 | gtscc \ |
|---|
| 228 | jscpucfg \ |
|---|
| 229 | nsinstall \ |
|---|
| 230 | viewer \ |
|---|
| 231 | TestGtkEmbed \ |
|---|
| 232 | bloaturls.txt \ |
|---|
| 233 | codesighs* \ |
|---|
| 234 | elf-dynstr-gc \ |
|---|
| 235 | mangle* \ |
|---|
| 236 | maptsv* \ |
|---|
| 237 | mfc* \ |
|---|
| 238 | mkdepend* \ |
|---|
| 239 | msdump* \ |
|---|
| 240 | msmap* \ |
|---|
| 241 | nm2tsv* \ |
|---|
| 242 | nsinstall* \ |
|---|
| 243 | rebasedlls* \ |
|---|
| 244 | res/samples \ |
|---|
| 245 | res/throbber \ |
|---|
| 246 | shlibsign* \ |
|---|
| 247 | ssltunnel* \ |
|---|
| 248 | winEmbed.exe \ |
|---|
| 249 | os2Embed.exe \ |
|---|
| 250 | chrome/chrome.rdf \ |
|---|
| 251 | chrome/app-chrome.manifest \ |
|---|
| 252 | chrome/overlayinfo \ |
|---|
| 253 | components/compreg.dat \ |
|---|
| 254 | components/xpti.dat \ |
|---|
| 255 | content_unit_tests \ |
|---|
| 256 | necko_unit_tests \ |
|---|
| 257 | $(NULL) |
|---|
| 258 | |
|---|
| 259 | # browser/locales/Makefile uses this makefile for it's variable defs, but |
|---|
| 260 | # doesn't want the libs:: rule. |
|---|
| 261 | ifndef PACKAGER_NO_LIBS |
|---|
| 262 | libs:: make-package |
|---|
| 263 | endif |
|---|
| 264 | |
|---|
| 265 | DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX) |
|---|
| 266 | |
|---|
| 267 | ifdef MOZ_PKG_REMOVALS |
|---|
| 268 | MOZ_PKG_REMOVALS_GEN = removed-files |
|---|
| 269 | |
|---|
| 270 | $(MOZ_PKG_REMOVALS_GEN): $(MOZ_PKG_REMOVALS) Makefile Makefile.in |
|---|
| 271 | $(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN) |
|---|
| 272 | |
|---|
| 273 | GARBAGE += $(MOZ_PKG_REMOVALS_GEN) |
|---|
| 274 | endif |
|---|
| 275 | |
|---|
| 276 | GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE) |
|---|
| 277 | |
|---|
| 278 | ifeq ($(OS_ARCH),IRIX) |
|---|
| 279 | STRIP_FLAGS = -f |
|---|
| 280 | endif |
|---|
| 281 | ifeq ($(OS_ARCH),BeOS) |
|---|
| 282 | STRIP_FLAGS = -g |
|---|
| 283 | PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "$(MOZ_PKG_APPNAME)-bin" |
|---|
| 284 | endif |
|---|
| 285 | ifeq ($(OS_ARCH),OS2) |
|---|
| 286 | STRIP = $(topsrcdir)/toolkit/mozapps/installer/os2/strip.cmd |
|---|
| 287 | STRIP_FLAGS = |
|---|
| 288 | PLATFORM_EXCLUDE_LIST = ! -name "*.ico" |
|---|
| 289 | endif |
|---|
| 290 | |
|---|
| 291 | ifneq (,$(filter WINNT OS2,$(OS_ARCH))) |
|---|
| 292 | PKGCP_OS = dos |
|---|
| 293 | else |
|---|
| 294 | PKGCP_OS = unix |
|---|
| 295 | endif |
|---|
| 296 | |
|---|
| 297 | # The following target stages files into three directories: one directory for |
|---|
| 298 | # locale-independent files, one for locale-specific files, and one for optional |
|---|
| 299 | # extensions based on the information in the MOZ_PKG_MANIFEST file and the |
|---|
| 300 | # following vars: |
|---|
| 301 | # MOZ_NONLOCALIZED_PKG_LIST |
|---|
| 302 | # MOZ_LOCALIZED_PKG_LIST |
|---|
| 303 | # MOZ_OPTIONAL_PKG_LIST |
|---|
| 304 | |
|---|
| 305 | PKG_ARG = , "$(pkg)" |
|---|
| 306 | |
|---|
| 307 | # Define packager macro to work around make 3.81 backslash issue (bug #339933) |
|---|
| 308 | define PACKAGER_COPY |
|---|
| 309 | $(PERL) -I$(topsrcdir)/xpinstall/packager -e 'use Packager; \ |
|---|
| 310 | Packager::Copy($1,$2,$3,$4,$5,$6,$7);' |
|---|
| 311 | endef |
|---|
| 312 | |
|---|
| 313 | installer-stage: $(MOZ_PKG_MANIFEST) |
|---|
| 314 | ifndef MOZ_PKG_MANIFEST |
|---|
| 315 | $(error MOZ_PKG_MANIFEST unspecified!) |
|---|
| 316 | endif |
|---|
| 317 | @rm -rf $(DEPTH)/installer-stage $(DIST)/xpt |
|---|
| 318 | @echo "Staging installer files..." |
|---|
| 319 | @$(NSINSTALL) -D $(DEPTH)/installer-stage/nonlocalized |
|---|
| 320 | @$(NSINSTALL) -D $(DEPTH)/installer-stage/localized |
|---|
| 321 | @$(NSINSTALL) -D $(DEPTH)/installer-stage/optional |
|---|
| 322 | @$(NSINSTALL) -D $(DIST)/xpt |
|---|
| 323 | $(call PACKAGER_COPY, "$(DIST)",\ |
|---|
| 324 | "$(DEPTH)/installer-stage/nonlocalized", \ |
|---|
| 325 | "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \ |
|---|
| 326 | $(foreach pkg,$(MOZ_NONLOCALIZED_PKG_LIST),$(PKG_ARG)) ) |
|---|
| 327 | $(call PACKAGER_COPY, "$(DIST)",\ |
|---|
| 328 | "$(DEPTH)/installer-stage/localized", \ |
|---|
| 329 | "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \ |
|---|
| 330 | $(foreach pkg,$(MOZ_LOCALIZED_PKG_LIST),$(PKG_ARG)) ) |
|---|
| 331 | ifdef MOZ_OPTIONAL_PKG_LIST |
|---|
| 332 | $(call PACKAGER_COPY, "$(DIST)",\ |
|---|
| 333 | "$(DEPTH)/installer-stage/optional", \ |
|---|
| 334 | "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \ |
|---|
| 335 | $(foreach pkg,$(MOZ_OPTIONAL_PKG_LIST),$(PKG_ARG)) ) |
|---|
| 336 | endif |
|---|
| 337 | $(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DEPTH)/installer-stage/nonlocalized/components -v -x "$(XPIDL_LINK)" |
|---|
| 338 | |
|---|
| 339 | stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_REMOVALS_GEN) |
|---|
| 340 | @rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $(DIST)/$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST) |
|---|
| 341 | # NOTE: this must be a tar now that dist links into the tree so that we |
|---|
| 342 | # do not strip the binaries actually in the tree. |
|---|
| 343 | @echo "Creating package directory..." |
|---|
| 344 | @mkdir $(DIST)/$(MOZ_PKG_APPNAME) |
|---|
| 345 | ifdef MOZ_PKG_MANIFEST |
|---|
| 346 | $(RM) -rf $(DIST)/xpt |
|---|
| 347 | $(call PACKAGER_COPY, "$(DIST)",\ |
|---|
| 348 | "$(DIST)/$(MOZ_PKG_APPNAME)", \ |
|---|
| 349 | "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1) |
|---|
| 350 | $(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_APPNAME)/components -v -x "$(XPIDL_LINK)" |
|---|
| 351 | else # !MOZ_PKG_MANIFEST |
|---|
| 352 | ifeq ($(MOZ_PKG_FORMAT),DMG) |
|---|
| 353 | # If UNIVERSAL_BINARY, the package will be made from an already-prepared |
|---|
| 354 | # STAGEPATH |
|---|
| 355 | ifndef UNIVERSAL_BINARY |
|---|
| 356 | ifndef STAGE_SDK |
|---|
| 357 | @cd $(DIST) && rsync -auv --copy-unsafe-links $(_APPNAME) $(MOZ_PKG_APPNAME) |
|---|
| 358 | else |
|---|
| 359 | @cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -) |
|---|
| 360 | endif |
|---|
| 361 | endif |
|---|
| 362 | else |
|---|
| 363 | @cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -) |
|---|
| 364 | endif # DMG |
|---|
| 365 | endif # MOZ_PKG_MANIFEST |
|---|
| 366 | ifndef PKG_SKIP_STRIP |
|---|
| 367 | @echo "Stripping package directory..." |
|---|
| 368 | @cd $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME); find . ! -type d \ |
|---|
| 369 | ! -name "*.js" \ |
|---|
| 370 | ! -name "*.xpt" \ |
|---|
| 371 | ! -name "*.gif" \ |
|---|
| 372 | ! -name "*.jpg" \ |
|---|
| 373 | ! -name "*.png" \ |
|---|
| 374 | ! -name "*.xpm" \ |
|---|
| 375 | ! -name "*.txt" \ |
|---|
| 376 | ! -name "*.rdf" \ |
|---|
| 377 | ! -name "*.sh" \ |
|---|
| 378 | ! -name "*.properties" \ |
|---|
| 379 | ! -name "*.dtd" \ |
|---|
| 380 | ! -name "*.html" \ |
|---|
| 381 | ! -name "*.xul" \ |
|---|
| 382 | ! -name "*.css" \ |
|---|
| 383 | ! -name "*.xml" \ |
|---|
| 384 | ! -name "*.jar" \ |
|---|
| 385 | ! -name "*.dat" \ |
|---|
| 386 | ! -name "*.tbl" \ |
|---|
| 387 | ! -name "*.src" \ |
|---|
| 388 | ! -name "*.reg" \ |
|---|
| 389 | $(PLATFORM_EXCLUDE_LIST) \ |
|---|
| 390 | -exec $(STRIP) $(STRIP_FLAGS) {} >/dev/null 2>&1 \; |
|---|
| 391 | $(SIGN_NSS) |
|---|
| 392 | endif |
|---|
| 393 | @echo "Removing unpackaged files..." |
|---|
| 394 | ifdef NO_PKG_FILES |
|---|
| 395 | cd $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH); rm -rf $(NO_PKG_FILES) |
|---|
| 396 | endif |
|---|
| 397 | ifdef MOZ_PKG_REMOVALS |
|---|
| 398 | $(SYSINSTALL) $(MOZ_PKG_REMOVALS_GEN) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH) |
|---|
| 399 | endif # MOZ_PKG_REMOVALS |
|---|
| 400 | |
|---|
| 401 | make-package: stage-package |
|---|
| 402 | @echo "Compressing..." |
|---|
| 403 | cd $(DIST) && $(MAKE_PACKAGE) |
|---|
| 404 | |
|---|
| 405 | # The install target will install the application to prefix/lib/appname-version |
|---|
| 406 | # In addition if INSTALL_SDK is set, it will install the development headers, |
|---|
| 407 | # libraries, and IDL files as follows: |
|---|
| 408 | # dist/sdk/include -> prefix/include/appname-version/stable |
|---|
| 409 | # dist/include -> prefix/include/appname-version/unstable |
|---|
| 410 | # dist/sdk/idl -> prefix/share/idl/appname-version/stable |
|---|
| 411 | # dist/idl -> prefix/share/idl/appname-version/unstable |
|---|
| 412 | # dist/sdk/lib -> prefix/lib/appname-devel-version/lib |
|---|
| 413 | # prefix/lib/appname-devel-version/* symlinks to the above directories |
|---|
| 414 | install:: stage-package |
|---|
| 415 | ifneq (,$(filter WINNT Darwin,$(OS_ARCH))) |
|---|
| 416 | $(error "make install" is not supported on this platform. Use "make package" instead.) |
|---|
| 417 | endif |
|---|
| 418 | $(NSINSTALL) -D $(DESTDIR)$(installdir) |
|---|
| 419 | (cd $(DIST)/$(MOZ_PKG_APPNAME) && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 420 | (cd $(DESTDIR)$(installdir) && tar -xf -) |
|---|
| 421 | $(NSINSTALL) -D $(DESTDIR)$(bindir) |
|---|
| 422 | $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME) |
|---|
| 423 | ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir) |
|---|
| 424 | ifdef INSTALL_SDK # Here comes the hard part |
|---|
| 425 | # include directory is stable (dist/sdk/include) and unstable (dist/include) |
|---|
| 426 | $(NSINSTALL) -D $(DESTDIR)$(includedir)/stable |
|---|
| 427 | $(NSINSTALL) -D $(DESTDIR)$(includedir)/unstable |
|---|
| 428 | (cd $(DIST)/sdk/include && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 429 | (cd $(DESTDIR)$(includedir)/stable && tar -xf -) |
|---|
| 430 | # The dist/include has module subdirectories that we need to flatten |
|---|
| 431 | find $(DIST)/include -xtype f -exec $(SYSINSTALL) $(IFLAGS1) {} $(DESTDIR)$(includedir)/unstable \; |
|---|
| 432 | # IDL directory is stable (dist/sdk/idl) and unstable (dist/idl) |
|---|
| 433 | $(NSINSTALL) -D $(DESTDIR)$(idldir)/stable |
|---|
| 434 | $(NSINSTALL) -D $(DESTDIR)$(idldir)/unstable |
|---|
| 435 | (cd $(DIST)/sdk/idl && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 436 | (cd $(DESTDIR)$(idldir)/stable && tar -xf -) |
|---|
| 437 | (cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 438 | (cd $(DESTDIR)$(idldir)/unstable && tar -xf -) |
|---|
| 439 | # SDK directory is the libs + a bunch of symlinks |
|---|
| 440 | $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/lib |
|---|
| 441 | if test -f $(DIST)/sdk/include/xpcom-config.h; then \ |
|---|
| 442 | $(SYSINSTALL) $(IFLAGS1) $(DIST)/sdk/include/xpcom-config.h $(DESTDIR)$(sdkdir); \ |
|---|
| 443 | fi |
|---|
| 444 | (cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/lib && tar -xf -) |
|---|
| 445 | $(RM) -f $(DESTDIR)$(sdkdir)/lib $(DESTDIR)$(sdkdir)/bin $(DESTDIR)$(sdkdir)/sdk/include $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/sdk/idl $(DESTDIR)$(sdkdir)/idl |
|---|
| 446 | ln -s $(sdkdir)/sdk/lib $(DESTDIR)$(sdkdir)/lib |
|---|
| 447 | ln -s $(installdir) $(DESTDIR)$(sdkdir)/bin |
|---|
| 448 | ln -s $(includedir)/stable $(DESTDIR)$(sdkdir)/sdk/include |
|---|
| 449 | ln -s $(includedir)/unstable $(DESTDIR)$(sdkdir)/include |
|---|
| 450 | ln -s $(idldir)/stable $(DESTDIR)$(sdkdir)/sdk/idl |
|---|
| 451 | ln -s $(idldir)/unstable $(DESTDIR)$(sdkdir)/idl |
|---|
| 452 | endif # INSTALL_SDK |
|---|
| 453 | |
|---|
| 454 | make-sdk: |
|---|
| 455 | $(MAKE) stage-package UNIVERSAL_BINARY= STAGE_SDK=1 MOZ_PKG_APPNAME=sdk-stage |
|---|
| 456 | @echo "Packaging SDK..." |
|---|
| 457 | $(RM) -rf $(DIST)/$(MOZ_APP_NAME)-sdk |
|---|
| 458 | $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/bin |
|---|
| 459 | (cd $(DIST)/sdk-stage && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 460 | (cd $(DIST)/$(MOZ_APP_NAME)-sdk/bin && tar -xf -) |
|---|
| 461 | $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin |
|---|
| 462 | (cd $(DIST)/host/bin && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 463 | (cd $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin && tar -xf -) |
|---|
| 464 | $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/sdk |
|---|
| 465 | (cd $(DIST)/sdk && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 466 | (cd $(DIST)/$(MOZ_APP_NAME)-sdk/sdk && tar -xf -) |
|---|
| 467 | $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/include |
|---|
| 468 | (cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 469 | (cd $(DIST)/$(MOZ_APP_NAME)-sdk/include && tar -xf -) |
|---|
| 470 | $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/idl |
|---|
| 471 | (cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 472 | (cd $(DIST)/$(MOZ_APP_NAME)-sdk/idl && tar -xf -) |
|---|
| 473 | $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/lib |
|---|
| 474 | # sdk/lib is the same as sdk/sdk/lib |
|---|
| 475 | (cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | \ |
|---|
| 476 | (cd $(DIST)/$(MOZ_APP_NAME)-sdk/lib && tar -xf -) |
|---|
| 477 | cd $(DIST) && $(MAKE_SDK) |
|---|