2004-11-30 22:54:13 +00:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
|
|
|
# The Original Code is Mozilla Communicator client code, released
|
|
|
|
# March 31, 1998.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Netscape Communications Corporation.
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Benjamin Smedberg <bsmedberg@covad.net>
|
2005-01-24 19:49:50 +00:00
|
|
|
# Arthur Wiebe <artooro@gmail.com>
|
2005-08-18 13:11:46 +00:00
|
|
|
# Mark Mentovai <mark@moxienet.com>
|
2004-11-30 22:54:13 +00:00
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
# use your version of this file under the terms of the MPL, indicate your
|
|
|
|
# decision by deleting the provisions above and replace them with the notice
|
|
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
# the provisions above, a recipient may use your version of this file under
|
|
|
|
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
#
|
|
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
|
|
|
|
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
|
|
|
|
|
|
|
|
# This is how we create the Unix binary packages we release to the public.
|
|
|
|
# Currently the only format is tar.gz (TGZ), but it should be fairly easy
|
|
|
|
# to add .rpm (RPM) and .deb (DEB) later.
|
|
|
|
|
|
|
|
ifndef MOZ_PKG_FORMAT
|
|
|
|
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
|
|
|
MOZ_PKG_FORMAT = DMG
|
|
|
|
else
|
2008-04-04 20:33:12 +00:00
|
|
|
ifeq (,$(filter-out OS2 WINNT BeOS, $(OS_ARCH)))
|
2004-11-30 22:54:13 +00:00
|
|
|
MOZ_PKG_FORMAT = ZIP
|
2005-10-03 15:24:14 +00:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
INSTALLER_DIR = os2
|
|
|
|
else
|
2008-04-04 20:33:12 +00:00
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
2004-11-30 22:54:13 +00:00
|
|
|
INSTALLER_DIR = windows
|
2005-10-03 15:24:14 +00:00
|
|
|
endif
|
2008-04-04 20:33:12 +00:00
|
|
|
endif
|
2004-11-30 22:54:13 +00:00
|
|
|
else
|
|
|
|
ifeq (,$(filter-out SunOS, $(OS_ARCH)))
|
|
|
|
MOZ_PKG_FORMAT = BZ2
|
|
|
|
else
|
2005-09-14 12:35:23 +00:00
|
|
|
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
|
|
|
|
MOZ_PKG_FORMAT = BZ2
|
|
|
|
else
|
2004-11-30 22:54:13 +00:00
|
|
|
MOZ_PKG_FORMAT = TGZ
|
|
|
|
endif
|
2005-09-14 12:35:23 +00:00
|
|
|
endif
|
2004-11-30 22:54:13 +00:00
|
|
|
INSTALLER_DIR = unix
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif # MOZ_PKG_FORMAT
|
|
|
|
|
|
|
|
PACKAGE = $(PKG_BASENAME)$(PKG_SUFFIX)
|
|
|
|
|
2007-08-09 19:53:08 +00:00
|
|
|
# By default, the SDK uses the same packaging type as the main bundle,
|
|
|
|
# but on mac it is a .tar.bz2
|
|
|
|
SDK_SUFFIX = $(PKG_SUFFIX)
|
|
|
|
SDK = $(PKG_BASENAME).sdk$(SDK_SUFFIX)
|
|
|
|
|
2004-11-30 22:54:13 +00:00
|
|
|
MAKE_PACKAGE = $(error What is a $(MOZ_PKG_FORMAT) package format?);
|
|
|
|
|
2006-03-27 17:52:05 +00:00
|
|
|
CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
|
|
|
|
--mode="go-w" -f
|
2005-04-20 23:10:56 +00:00
|
|
|
UNPACK_TAR = tar -x
|
2004-11-30 22:54:13 +00:00
|
|
|
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),TAR)
|
|
|
|
PKG_SUFFIX = .tar
|
|
|
|
MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) > $(PACKAGE)
|
2005-04-20 23:10:56 +00:00
|
|
|
UNMAKE_PACKAGE = $(UNPACK_TAR) < $(UNPACKAGE)
|
2007-08-09 19:53:08 +00:00
|
|
|
MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk > $(SDK)
|
2004-11-30 22:54:13 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),TGZ)
|
|
|
|
PKG_SUFFIX = .tar.gz
|
|
|
|
MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | gzip -vf9 > $(PACKAGE)
|
2005-04-20 23:10:56 +00:00
|
|
|
UNMAKE_PACKAGE = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR)
|
2007-08-09 19:53:08 +00:00
|
|
|
MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | gzip -vf9 > $(SDK)
|
2004-11-30 22:54:13 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),BZ2)
|
|
|
|
PKG_SUFFIX = .tar.bz2
|
|
|
|
MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | bzip2 -vf > $(PACKAGE)
|
2005-04-20 23:10:56 +00:00
|
|
|
UNMAKE_PACKAGE = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR)
|
2007-08-09 19:53:08 +00:00
|
|
|
MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
|
2004-11-30 22:54:13 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),ZIP)
|
|
|
|
PKG_SUFFIX = .zip
|
|
|
|
MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_APPNAME)
|
2005-04-20 23:10:56 +00:00
|
|
|
UNMAKE_PACKAGE = $(UNZIP) $(UNPACKAGE)
|
2007-08-11 20:29:48 +00:00
|
|
|
MAKE_SDK = $(ZIP) -r9D $(SDK) $(MOZ_APP_NAME)-sdk
|
2004-11-30 22:54:13 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),DMG)
|
2005-08-22 17:39:28 +00:00
|
|
|
ifndef _APPNAME
|
2004-11-30 22:54:13 +00:00
|
|
|
ifdef MOZ_DEBUG
|
|
|
|
_APPNAME = $(MOZ_APP_DISPLAYNAME)Debug.app
|
|
|
|
else
|
|
|
|
_APPNAME = $(MOZ_APP_DISPLAYNAME).app
|
|
|
|
endif
|
2005-08-22 17:39:28 +00:00
|
|
|
endif
|
2006-08-18 20:34:56 +00:00
|
|
|
ifndef _BINPATH
|
2006-02-03 03:26:44 +00:00
|
|
|
_BINPATH = /$(_APPNAME)/Contents/MacOS
|
2006-08-18 20:34:56 +00:00
|
|
|
endif # _BINPATH
|
2005-01-24 19:49:50 +00:00
|
|
|
PKG_SUFFIX = .dmg
|
2005-08-18 13:11:46 +00:00
|
|
|
PKG_DMG_FLAGS =
|
|
|
|
ifneq (,$(MOZ_PKG_MAC_DSSTORE))
|
|
|
|
PKG_DMG_FLAGS += --copy "$(MOZ_PKG_MAC_DSSTORE):/.DS_Store"
|
|
|
|
endif
|
|
|
|
ifneq (,$(MOZ_PKG_MAC_BACKGROUND))
|
|
|
|
PKG_DMG_FLAGS += --mkdir /.background --copy "$(MOZ_PKG_MAC_BACKGROUND):/.background"
|
|
|
|
endif
|
|
|
|
ifneq (,$(MOZ_PKG_MAC_ICON))
|
|
|
|
PKG_DMG_FLAGS += --icon "$(MOZ_PKG_MAC_ICON)"
|
|
|
|
endif
|
|
|
|
ifneq (,$(MOZ_PKG_MAC_RSRC))
|
|
|
|
PKG_DMG_FLAGS += --resource "$(MOZ_PKG_MAC_RSRC)"
|
|
|
|
endif
|
|
|
|
ifneq (,$(MOZ_PKG_MAC_EXTRA))
|
|
|
|
PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA)
|
|
|
|
endif
|
2005-08-18 14:03:02 +00:00
|
|
|
_ABS_TOPSRCDIR = $(shell cd $(topsrcdir) && pwd)
|
2006-02-21 21:03:48 +00:00
|
|
|
ifdef UNIVERSAL_BINARY
|
|
|
|
STAGEPATH = universal/
|
|
|
|
endif
|
2007-02-27 19:43:59 +00:00
|
|
|
ifndef PKG_DMG_SOURCE
|
|
|
|
PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_APPNAME)
|
|
|
|
endif
|
2005-08-18 14:03:02 +00:00
|
|
|
MAKE_PACKAGE = $(_ABS_TOPSRCDIR)/build/package/mac_osx/pkg-dmg \
|
2007-02-27 19:43:59 +00:00
|
|
|
--source "$(PKG_DMG_SOURCE)" --target "$(PACKAGE)" \
|
2005-08-18 13:11:46 +00:00
|
|
|
--volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS)
|
2005-05-05 12:38:27 +00:00
|
|
|
UNMAKE_PACKAGE = \
|
2005-08-26 13:36:32 +00:00
|
|
|
set -ex; \
|
|
|
|
function cleanup() { \
|
|
|
|
hdiutil detach $${DEV_NAME} || \
|
2005-08-26 19:01:45 +00:00
|
|
|
{ sleep 5 && hdiutil detach $${DEV_NAME} -force; }; \
|
2005-08-26 13:36:32 +00:00
|
|
|
return $$1 && $$?; \
|
|
|
|
}; \
|
2005-05-09 15:38:30 +00:00
|
|
|
unset NEXT_ROOT; \
|
2005-08-22 18:35:41 +00:00
|
|
|
export PAGER=true; \
|
2005-08-26 13:36:32 +00:00
|
|
|
echo Y | hdiutil attach -readonly -mountroot /tmp -private -noautoopen $(UNPACKAGE) > hdi.output; \
|
2005-08-23 14:00:52 +00:00
|
|
|
DEV_NAME=`perl -n -e 'if($$_=~/(\/dev\/disk[^ ]*)/) {print $$1."\n";exit;}'< hdi.output`; \
|
2005-08-26 13:36:32 +00:00
|
|
|
MOUNTPOINT=`perl -n -e 'split(/\/dev\/disk[^ ]*/,$$_,2);if($$_[1]=~/(\/.*)/) {print $$1."\n";exit;}'< hdi.output` || cleanup 1; \
|
|
|
|
rsync -a "$${MOUNTPOINT}/$(_APPNAME)" $(MOZ_PKG_APPNAME) || cleanup 1; \
|
|
|
|
test -n "$(MOZ_PKG_MAC_DSSTORE)" && \
|
2005-08-26 19:01:45 +00:00
|
|
|
{ rsync -a "$${MOUNTPOINT}/.DS_Store" "$(MOZ_PKG_MAC_DSSTORE)" || cleanup 1; }; \
|
2005-08-26 13:36:32 +00:00
|
|
|
test -n "$(MOZ_PKG_MAC_BACKGROUND)" && \
|
2005-08-26 19:01:45 +00:00
|
|
|
{ rsync -a "$${MOUNTPOINT}/.background/`basename "$(MOZ_PKG_MAC_BACKGROUND)"`" "$(MOZ_PKG_MAC_BACKGROUND)" || cleanup 1; }; \
|
2005-08-26 13:36:32 +00:00
|
|
|
test -n "$(MOZ_PKG_MAC_ICON)" && \
|
2005-08-26 19:01:45 +00:00
|
|
|
{ rsync -a "$${MOUNTPOINT}/.VolumeIcon.icns" "$(MOZ_PKG_MAC_ICON)" || cleanup 1; }; \
|
2005-08-26 13:36:32 +00:00
|
|
|
cleanup 0; \
|
|
|
|
if test -n "$(MOZ_PKG_MAC_RSRC)" ; then \
|
2005-09-10 02:23:13 +00:00
|
|
|
cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \
|
|
|
|
hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \
|
|
|
|
{ /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > "$(MOZ_PKG_MAC_RSRC)" || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \
|
|
|
|
rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \
|
2005-08-26 13:36:32 +00:00
|
|
|
fi; \
|
2005-05-05 12:38:27 +00:00
|
|
|
$(NULL)
|
2005-08-26 13:36:32 +00:00
|
|
|
# The plst and blkx resources are skipped because they belong to each
|
|
|
|
# individual dmg and are created by hdiutil.
|
2007-08-09 19:53:08 +00:00
|
|
|
SDK_SUFFIX = .tar.bz2
|
2008-04-10 14:50:48 +00:00
|
|
|
SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX)
|
2007-08-09 19:53:08 +00:00
|
|
|
MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
|
2004-11-30 22:54:13 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# dummy macro if we don't have PSM built
|
|
|
|
SIGN_NSS =
|
2006-02-21 21:03:48 +00:00
|
|
|
ifneq (1_,$(if $(CROSS_COMPILE),1,0)_$(UNIVERSAL_BINARY))
|
2004-11-30 22:54:13 +00:00
|
|
|
ifdef MOZ_PSM
|
|
|
|
SIGN_NSS = @echo signing nss libraries;
|
|
|
|
|
2008-04-28 19:14:12 +00:00
|
|
|
NSS_DLL_SUFFIX = $(DLL_SUFFIX)
|
2006-02-21 21:03:48 +00:00
|
|
|
ifdef UNIVERSAL_BINARY
|
|
|
|
NATIVE_ARCH = $(shell uname -p | sed -e s/powerpc/ppc/)
|
|
|
|
NATIVE_DIST = $(DIST)/../../$(NATIVE_ARCH)/dist
|
|
|
|
SIGN_CMD = $(NATIVE_DIST)/bin/run-mozilla.sh $(NATIVE_DIST)/bin/shlibsign -v -i
|
|
|
|
else
|
2008-03-14 00:39:33 +00:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2008-04-28 19:14:12 +00:00
|
|
|
# uppercase extension to get the correct output file from shlibsign
|
|
|
|
NSS_DLL_SUFFIX = .DLL
|
2008-03-14 00:39:33 +00:00
|
|
|
SIGN_CMD = $(topsrcdir)/toolkit/mozapps/installer/os2/sign.cmd $(DIST)
|
|
|
|
else
|
2007-04-17 20:42:54 +00:00
|
|
|
SIGN_CMD = $(RUN_TEST_PROGRAM) $(DIST)/bin/shlibsign -v -i
|
2006-02-21 21:03:48 +00:00
|
|
|
endif
|
2008-03-14 00:39:33 +00:00
|
|
|
endif
|
2004-11-30 22:54:13 +00:00
|
|
|
|
2008-04-28 19:14:12 +00:00
|
|
|
SOFTOKN = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)softokn3$(NSS_DLL_SUFFIX)
|
|
|
|
FREEBL = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl3$(NSS_DLL_SUFFIX)
|
2006-02-21 21:03:48 +00:00
|
|
|
FREEBL_32FPU = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32fpu_3$(DLL_SUFFIX)
|
|
|
|
FREEBL_32INT = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32int_3$(DLL_SUFFIX)
|
|
|
|
FREEBL_32INT64 = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32int64_3$(DLL_SUFFIX)
|
|
|
|
FREEBL_64FPU = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_64fpu_3$(DLL_SUFFIX)
|
|
|
|
FREEBL_64INT = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_64int_3$(DLL_SUFFIX)
|
2004-11-30 22:54:13 +00:00
|
|
|
|
|
|
|
SIGN_NSS += $(SIGN_CMD) $(SOFTOKN); \
|
2006-01-13 18:09:32 +00:00
|
|
|
if test -f $(FREEBL); then $(SIGN_CMD) $(FREEBL); fi; \
|
|
|
|
if test -f $(FREEBL_32FPU); then $(SIGN_CMD) $(FREEBL_32FPU); fi; \
|
|
|
|
if test -f $(FREEBL_32INT); then $(SIGN_CMD) $(FREEBL_32INT); fi; \
|
|
|
|
if test -f $(FREEBL_32INT64); then $(SIGN_CMD) $(FREEBL_32INT64); fi; \
|
|
|
|
if test -f $(FREEBL_64FPU); then $(SIGN_CMD) $(FREEBL_64FPU); fi; \
|
|
|
|
if test -f $(FREEBL_64INT); then $(SIGN_CMD) $(FREEBL_64INT); fi;
|
2004-11-30 22:54:13 +00:00
|
|
|
|
|
|
|
endif # MOZ_PSM
|
|
|
|
endif # !CROSS_COMPILE
|
|
|
|
|
|
|
|
NO_PKG_FILES += \
|
|
|
|
core \
|
|
|
|
bsdecho \
|
|
|
|
gtscc \
|
|
|
|
jscpucfg \
|
|
|
|
nsinstall \
|
|
|
|
viewer \
|
|
|
|
TestGtkEmbed \
|
|
|
|
bloaturls.txt \
|
|
|
|
codesighs* \
|
|
|
|
elf-dynstr-gc \
|
|
|
|
mangle* \
|
|
|
|
maptsv* \
|
|
|
|
mfc* \
|
|
|
|
mkdepend* \
|
|
|
|
msdump* \
|
|
|
|
msmap* \
|
|
|
|
nm2tsv* \
|
|
|
|
nsinstall* \
|
|
|
|
rebasedlls* \
|
|
|
|
res/samples \
|
|
|
|
res/throbber \
|
|
|
|
shlibsign* \
|
2008-04-21 14:32:47 +00:00
|
|
|
ssltunnel* \
|
2004-11-30 22:54:13 +00:00
|
|
|
winEmbed.exe \
|
2005-10-05 21:26:34 +00:00
|
|
|
os2Embed.exe \
|
2004-11-30 22:54:13 +00:00
|
|
|
chrome/chrome.rdf \
|
2005-02-23 21:46:11 +00:00
|
|
|
chrome/app-chrome.manifest \
|
2005-07-26 16:46:57 +00:00
|
|
|
chrome/overlayinfo \
|
|
|
|
components/compreg.dat \
|
|
|
|
components/xpti.dat \
|
2006-06-29 18:27:49 +00:00
|
|
|
content_unit_tests \
|
|
|
|
necko_unit_tests \
|
2004-11-30 22:54:13 +00:00
|
|
|
$(NULL)
|
|
|
|
|
2005-04-20 23:10:56 +00:00
|
|
|
# browser/locales/Makefile uses this makefile for it's variable defs, but
|
|
|
|
# doesn't want the libs:: rule.
|
|
|
|
ifndef PACKAGER_NO_LIBS
|
2006-08-18 20:34:56 +00:00
|
|
|
libs:: make-package
|
2005-04-20 23:10:56 +00:00
|
|
|
endif
|
2004-11-30 22:54:13 +00:00
|
|
|
|
2005-09-15 18:09:56 +00:00
|
|
|
DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX)
|
|
|
|
|
|
|
|
ifdef MOZ_PKG_REMOVALS
|
|
|
|
MOZ_PKG_REMOVALS_GEN = removed-files
|
|
|
|
|
|
|
|
$(MOZ_PKG_REMOVALS_GEN): $(MOZ_PKG_REMOVALS) Makefile Makefile.in
|
2007-04-13 23:43:36 +00:00
|
|
|
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN)
|
2005-09-15 18:09:56 +00:00
|
|
|
endif
|
|
|
|
|
2004-11-30 22:54:13 +00:00
|
|
|
GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE)
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),IRIX)
|
|
|
|
STRIP_FLAGS = -f
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),BeOS)
|
|
|
|
STRIP_FLAGS = -g
|
|
|
|
PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "$(MOZ_PKG_APPNAME)-bin"
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2008-03-14 00:39:33 +00:00
|
|
|
STRIP = $(topsrcdir)/toolkit/mozapps/installer/os2/strip.cmd
|
2004-11-30 22:54:13 +00:00
|
|
|
STRIP_FLAGS =
|
|
|
|
PLATFORM_EXCLUDE_LIST = ! -name "*.ico"
|
|
|
|
endif
|
|
|
|
|
2005-06-30 19:22:39 +00:00
|
|
|
ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
|
|
|
|
PKGCP_OS = dos
|
|
|
|
else
|
|
|
|
PKGCP_OS = unix
|
|
|
|
endif
|
|
|
|
|
2006-05-22 22:29:44 +00:00
|
|
|
# The following target stages files into three directories: one directory for
|
|
|
|
# locale-independent files, one for locale-specific files, and one for optional
|
|
|
|
# extensions based on the information in the MOZ_PKG_MANIFEST file and the
|
|
|
|
# following vars:
|
2006-05-04 15:43:31 +00:00
|
|
|
# MOZ_NONLOCALIZED_PKG_LIST
|
|
|
|
# MOZ_LOCALIZED_PKG_LIST
|
2006-05-22 22:29:44 +00:00
|
|
|
# MOZ_OPTIONAL_PKG_LIST
|
2006-05-04 15:43:31 +00:00
|
|
|
|
|
|
|
PKG_ARG = , "$(pkg)"
|
|
|
|
|
2006-07-11 21:20:12 +00:00
|
|
|
# Define packager macro to work around make 3.81 backslash issue (bug #339933)
|
|
|
|
define PACKAGER_COPY
|
|
|
|
$(PERL) -I$(topsrcdir)/xpinstall/packager -e 'use Packager; \
|
|
|
|
Packager::Copy($1,$2,$3,$4,$5,$6,$7);'
|
|
|
|
endef
|
|
|
|
|
2006-05-04 15:43:31 +00:00
|
|
|
installer-stage: $(MOZ_PKG_MANIFEST)
|
|
|
|
ifndef MOZ_PKG_MANIFEST
|
|
|
|
$(error MOZ_PKG_MANIFEST unspecified!)
|
|
|
|
endif
|
|
|
|
@rm -rf $(DEPTH)/installer-stage $(DIST)/xpt
|
|
|
|
@echo "Staging installer files..."
|
|
|
|
@$(NSINSTALL) -D $(DEPTH)/installer-stage/nonlocalized
|
|
|
|
@$(NSINSTALL) -D $(DEPTH)/installer-stage/localized
|
2006-05-22 22:29:44 +00:00
|
|
|
@$(NSINSTALL) -D $(DEPTH)/installer-stage/optional
|
2006-05-04 15:43:31 +00:00
|
|
|
@$(NSINSTALL) -D $(DIST)/xpt
|
2006-07-11 21:20:12 +00:00
|
|
|
$(call PACKAGER_COPY, "$(DIST)",\
|
|
|
|
"$(DEPTH)/installer-stage/nonlocalized", \
|
|
|
|
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
|
|
|
|
$(foreach pkg,$(MOZ_NONLOCALIZED_PKG_LIST),$(PKG_ARG)) )
|
|
|
|
$(call PACKAGER_COPY, "$(DIST)",\
|
|
|
|
"$(DEPTH)/installer-stage/localized", \
|
|
|
|
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
|
|
|
|
$(foreach pkg,$(MOZ_LOCALIZED_PKG_LIST),$(PKG_ARG)) )
|
2007-10-09 19:30:28 +00:00
|
|
|
ifdef MOZ_OPTIONAL_PKG_LIST
|
2006-07-11 21:20:12 +00:00
|
|
|
$(call PACKAGER_COPY, "$(DIST)",\
|
|
|
|
"$(DEPTH)/installer-stage/optional", \
|
|
|
|
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
|
|
|
|
$(foreach pkg,$(MOZ_OPTIONAL_PKG_LIST),$(PKG_ARG)) )
|
2007-10-09 19:30:28 +00:00
|
|
|
endif
|
2007-09-07 21:25:47 +00:00
|
|
|
$(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DEPTH)/installer-stage/nonlocalized/components -v -x "$(XPIDL_LINK)"
|
2006-05-04 15:43:31 +00:00
|
|
|
|
2006-08-18 20:34:56 +00:00
|
|
|
stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_REMOVALS_GEN)
|
2005-01-24 19:49:50 +00:00
|
|
|
@rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $(DIST)/$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST)
|
2004-11-30 22:54:13 +00:00
|
|
|
# NOTE: this must be a tar now that dist links into the tree so that we
|
|
|
|
# do not strip the binaries actually in the tree.
|
|
|
|
@echo "Creating package directory..."
|
|
|
|
@mkdir $(DIST)/$(MOZ_PKG_APPNAME)
|
2005-06-30 19:22:39 +00:00
|
|
|
ifdef MOZ_PKG_MANIFEST
|
|
|
|
$(RM) -rf $(DIST)/xpt
|
2006-07-11 21:20:12 +00:00
|
|
|
$(call PACKAGER_COPY, "$(DIST)",\
|
|
|
|
"$(DIST)/$(MOZ_PKG_APPNAME)", \
|
|
|
|
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
|
2007-09-07 21:25:47 +00:00
|
|
|
$(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_APPNAME)/components -v -x "$(XPIDL_LINK)"
|
2005-06-30 19:22:39 +00:00
|
|
|
else # !MOZ_PKG_MANIFEST
|
2004-11-30 22:54:13 +00:00
|
|
|
ifeq ($(MOZ_PKG_FORMAT),DMG)
|
2006-02-21 21:03:48 +00:00
|
|
|
# If UNIVERSAL_BINARY, the package will be made from an already-prepared
|
|
|
|
# STAGEPATH
|
|
|
|
ifndef UNIVERSAL_BINARY
|
2008-03-05 21:30:28 +00:00
|
|
|
ifndef STAGE_SDK
|
2005-08-23 01:45:14 +00:00
|
|
|
@cd $(DIST) && rsync -auv --copy-unsafe-links $(_APPNAME) $(MOZ_PKG_APPNAME)
|
2008-03-05 21:30:28 +00:00
|
|
|
else
|
|
|
|
@cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -)
|
|
|
|
endif
|
2006-02-21 21:03:48 +00:00
|
|
|
endif
|
2004-11-30 22:54:13 +00:00
|
|
|
else
|
|
|
|
@cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -)
|
|
|
|
endif # DMG
|
2005-06-30 19:22:39 +00:00
|
|
|
endif # MOZ_PKG_MANIFEST
|
2005-08-22 17:39:28 +00:00
|
|
|
ifndef PKG_SKIP_STRIP
|
2004-11-30 22:54:13 +00:00
|
|
|
@echo "Stripping package directory..."
|
2006-02-21 21:03:48 +00:00
|
|
|
@cd $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME); find . ! -type d \
|
2004-11-30 22:54:13 +00:00
|
|
|
! -name "*.js" \
|
|
|
|
! -name "*.xpt" \
|
|
|
|
! -name "*.gif" \
|
|
|
|
! -name "*.jpg" \
|
|
|
|
! -name "*.png" \
|
|
|
|
! -name "*.xpm" \
|
|
|
|
! -name "*.txt" \
|
|
|
|
! -name "*.rdf" \
|
|
|
|
! -name "*.sh" \
|
|
|
|
! -name "*.properties" \
|
|
|
|
! -name "*.dtd" \
|
|
|
|
! -name "*.html" \
|
|
|
|
! -name "*.xul" \
|
|
|
|
! -name "*.css" \
|
|
|
|
! -name "*.xml" \
|
|
|
|
! -name "*.jar" \
|
|
|
|
! -name "*.dat" \
|
|
|
|
! -name "*.tbl" \
|
|
|
|
! -name "*.src" \
|
|
|
|
! -name "*.reg" \
|
|
|
|
$(PLATFORM_EXCLUDE_LIST) \
|
|
|
|
-exec $(STRIP) $(STRIP_FLAGS) {} >/dev/null 2>&1 \;
|
|
|
|
$(SIGN_NSS)
|
2005-08-22 17:39:28 +00:00
|
|
|
endif
|
2004-11-30 22:54:13 +00:00
|
|
|
@echo "Removing unpackaged files..."
|
2006-02-03 03:26:44 +00:00
|
|
|
ifdef NO_PKG_FILES
|
2006-02-21 21:03:48 +00:00
|
|
|
cd $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH); rm -rf $(NO_PKG_FILES)
|
2006-02-03 03:26:44 +00:00
|
|
|
endif
|
2005-09-17 02:21:17 +00:00
|
|
|
ifdef MOZ_PKG_REMOVALS
|
2006-02-21 21:03:48 +00:00
|
|
|
$(SYSINSTALL) $(MOZ_PKG_REMOVALS_GEN) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)
|
2005-09-17 02:21:17 +00:00
|
|
|
endif # MOZ_PKG_REMOVALS
|
2006-08-18 20:34:56 +00:00
|
|
|
|
|
|
|
make-package: stage-package
|
2004-11-30 22:54:13 +00:00
|
|
|
@echo "Compressing..."
|
2007-08-03 14:46:17 +00:00
|
|
|
cd $(DIST) && $(MAKE_PACKAGE)
|
|
|
|
|
|
|
|
# The install target will install the application to prefix/lib/appname-version
|
|
|
|
# In addition if INSTALL_SDK is set, it will install the development headers,
|
|
|
|
# libraries, and IDL files as follows:
|
|
|
|
# dist/sdk/include -> prefix/include/appname-version/stable
|
|
|
|
# dist/include -> prefix/include/appname-version/unstable
|
|
|
|
# dist/sdk/idl -> prefix/share/idl/appname-version/stable
|
|
|
|
# dist/idl -> prefix/share/idl/appname-version/unstable
|
|
|
|
# dist/sdk/lib -> prefix/lib/appname-devel-version/lib
|
|
|
|
# prefix/lib/appname-devel-version/* symlinks to the above directories
|
|
|
|
install:: stage-package
|
2008-04-09 05:26:00 +00:00
|
|
|
ifneq (,$(filter WINNT Darwin,$(OS_ARCH)))
|
|
|
|
$(error "make install" is not supported on this platform. Use "make package" instead.)
|
2007-08-03 14:46:17 +00:00
|
|
|
endif
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(installdir)
|
|
|
|
(cd $(DIST)/$(MOZ_PKG_APPNAME) && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DESTDIR)$(installdir) && tar -xf -)
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(bindir)
|
|
|
|
$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
|
|
|
|
ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
|
|
|
|
ifdef INSTALL_SDK # Here comes the hard part
|
|
|
|
# include directory is stable (dist/sdk/include) and unstable (dist/include)
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(includedir)/stable
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(includedir)/unstable
|
|
|
|
(cd $(DIST)/sdk/include && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DESTDIR)$(includedir)/stable && tar -xf -)
|
|
|
|
# The dist/include has module subdirectories that we need to flatten
|
|
|
|
find $(DIST)/include -xtype f -exec $(SYSINSTALL) $(IFLAGS1) {} $(DESTDIR)$(includedir)/unstable \;
|
|
|
|
# IDL directory is stable (dist/sdk/idl) and unstable (dist/idl)
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(idldir)/stable
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(idldir)/unstable
|
|
|
|
(cd $(DIST)/sdk/idl && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DESTDIR)$(idldir)/stable && tar -xf -)
|
|
|
|
(cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DESTDIR)$(idldir)/unstable && tar -xf -)
|
|
|
|
# SDK directory is the libs + a bunch of symlinks
|
|
|
|
$(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/lib
|
|
|
|
if test -f $(DIST)/sdk/include/xpcom-config.h; then \
|
|
|
|
$(SYSINSTALL) $(IFLAGS1) $(DIST)/sdk/include/xpcom-config.h $(DESTDIR)$(sdkdir); \
|
|
|
|
fi
|
|
|
|
(cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/lib && tar -xf -)
|
|
|
|
$(RM) -f $(DESTDIR)$(sdkdir)/lib $(DESTDIR)$(sdkdir)/bin $(DESTDIR)$(sdkdir)/sdk/include $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/sdk/idl $(DESTDIR)$(sdkdir)/idl
|
|
|
|
ln -s $(sdkdir)/sdk/lib $(DESTDIR)$(sdkdir)/lib
|
|
|
|
ln -s $(installdir) $(DESTDIR)$(sdkdir)/bin
|
|
|
|
ln -s $(includedir)/stable $(DESTDIR)$(sdkdir)/sdk/include
|
|
|
|
ln -s $(includedir)/unstable $(DESTDIR)$(sdkdir)/include
|
|
|
|
ln -s $(idldir)/stable $(DESTDIR)$(sdkdir)/sdk/idl
|
|
|
|
ln -s $(idldir)/unstable $(DESTDIR)$(sdkdir)/idl
|
|
|
|
endif # INSTALL_SDK
|
2007-08-09 19:53:08 +00:00
|
|
|
|
2008-03-05 21:30:28 +00:00
|
|
|
make-sdk:
|
2008-04-10 14:50:48 +00:00
|
|
|
$(MAKE) stage-package UNIVERSAL_BINARY= STAGE_SDK=1 MOZ_PKG_APPNAME=sdk-stage
|
2007-08-09 19:53:08 +00:00
|
|
|
@echo "Packaging SDK..."
|
|
|
|
$(RM) -rf $(DIST)/$(MOZ_APP_NAME)-sdk
|
|
|
|
$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/bin
|
2008-03-05 21:30:28 +00:00
|
|
|
(cd $(DIST)/sdk-stage && tar $(TAR_CREATE_FLAGS) - .) | \
|
2007-08-09 19:53:08 +00:00
|
|
|
(cd $(DIST)/$(MOZ_APP_NAME)-sdk/bin && tar -xf -)
|
2008-04-10 14:50:48 +00:00
|
|
|
$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin
|
|
|
|
(cd $(DIST)/host/bin && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin && tar -xf -)
|
2007-08-09 19:53:08 +00:00
|
|
|
$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/sdk
|
|
|
|
(cd $(DIST)/sdk && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DIST)/$(MOZ_APP_NAME)-sdk/sdk && tar -xf -)
|
|
|
|
$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/include
|
|
|
|
(cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DIST)/$(MOZ_APP_NAME)-sdk/include && tar -xf -)
|
|
|
|
$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/idl
|
|
|
|
(cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DIST)/$(MOZ_APP_NAME)-sdk/idl && tar -xf -)
|
|
|
|
$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/lib
|
|
|
|
# sdk/lib is the same as sdk/sdk/lib
|
|
|
|
(cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | \
|
|
|
|
(cd $(DIST)/$(MOZ_APP_NAME)-sdk/lib && tar -xf -)
|
|
|
|
cd $(DIST) && $(MAKE_SDK)
|