2004-12-01 01:54:13 +03: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 22:49:50 +03:00
|
|
|
# Arthur Wiebe <artooro@gmail.com>
|
2005-08-18 17:11:46 +04:00
|
|
|
# Mark Mentovai <mark@moxienet.com>
|
2004-12-01 01:54:13 +03: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
|
|
|
|
ifeq (,$(filter-out OS2 WINNT, $(OS_ARCH)))
|
|
|
|
MOZ_PKG_FORMAT = ZIP
|
|
|
|
INSTALLER_DIR = windows
|
|
|
|
else
|
|
|
|
ifeq (,$(filter-out SunOS, $(OS_ARCH)))
|
|
|
|
MOZ_PKG_FORMAT = BZ2
|
|
|
|
else
|
|
|
|
MOZ_PKG_FORMAT = TGZ
|
|
|
|
endif
|
|
|
|
INSTALLER_DIR = unix
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif # MOZ_PKG_FORMAT
|
|
|
|
|
|
|
|
PACKAGE = $(PKG_BASENAME)$(PKG_SUFFIX)
|
|
|
|
|
|
|
|
MAKE_PACKAGE = $(error What is a $(MOZ_PKG_FORMAT) package format?);
|
|
|
|
|
|
|
|
CREATE_FINAL_TAR = tar -c --owner=0 --group=0 --numeric-owner --mode="go-w" -f
|
2005-04-21 03:10:56 +04:00
|
|
|
UNPACK_TAR = tar -x
|
2004-12-01 01:54:13 +03:00
|
|
|
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),TAR)
|
|
|
|
PKG_SUFFIX = .tar
|
|
|
|
MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) > $(PACKAGE)
|
2005-04-21 03:10:56 +04:00
|
|
|
UNMAKE_PACKAGE = $(UNPACK_TAR) < $(UNPACKAGE)
|
2004-12-01 01:54:13 +03:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),TGZ)
|
|
|
|
PKG_SUFFIX = .tar.gz
|
|
|
|
MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | gzip -vf9 > $(PACKAGE)
|
2005-04-21 03:10:56 +04:00
|
|
|
UNMAKE_PACKAGE = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR)
|
2004-12-01 01:54:13 +03:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),BZ2)
|
|
|
|
PKG_SUFFIX = .tar.bz2
|
|
|
|
MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | bzip2 -vf > $(PACKAGE)
|
2005-04-21 03:10:56 +04:00
|
|
|
UNMAKE_PACKAGE = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR)
|
2004-12-01 01:54:13 +03:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),ZIP)
|
|
|
|
PKG_SUFFIX = .zip
|
|
|
|
MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_APPNAME)
|
2005-04-21 03:10:56 +04:00
|
|
|
UNMAKE_PACKAGE = $(UNZIP) $(UNPACKAGE)
|
2004-12-01 01:54:13 +03:00
|
|
|
endif
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),DMG)
|
2005-08-22 21:39:28 +04:00
|
|
|
ifndef _APPNAME
|
2004-12-01 01:54:13 +03:00
|
|
|
ifdef MOZ_DEBUG
|
|
|
|
_APPNAME = $(MOZ_APP_DISPLAYNAME)Debug.app
|
|
|
|
else
|
|
|
|
_APPNAME = $(MOZ_APP_DISPLAYNAME).app
|
|
|
|
endif
|
2005-08-22 21:39:28 +04:00
|
|
|
endif
|
2005-01-24 22:49:50 +03:00
|
|
|
PKG_SUFFIX = .dmg
|
2005-08-18 17:11:46 +04: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 18:03:02 +04:00
|
|
|
_ABS_TOPSRCDIR = $(shell cd $(topsrcdir) && pwd)
|
|
|
|
MAKE_PACKAGE = $(_ABS_TOPSRCDIR)/build/package/mac_osx/pkg-dmg \
|
2005-08-18 17:11:46 +04:00
|
|
|
--source "$(MOZ_PKG_APPNAME)" --target "$(PACKAGE)" \
|
|
|
|
--volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS)
|
2005-05-05 16:38:27 +04:00
|
|
|
UNMAKE_PACKAGE = \
|
|
|
|
set -e; \
|
2005-05-09 19:38:30 +04:00
|
|
|
unset NEXT_ROOT; \
|
2005-05-05 16:38:27 +04:00
|
|
|
mkdir mount-temp; \
|
|
|
|
hdiutil attach -readonly -mountpoint mount-temp -private -noautoopen $(UNPACKAGE) > hdi.output; \
|
|
|
|
DEV_NAME=`egrep '^/dev' < hdi.output | sed 1q | awk '{print $$1}'`; \
|
|
|
|
rsync -a mount-temp/$(_APPNAME) $(MOZ_PKG_APPNAME); \
|
|
|
|
hdiutil detach $${DEV_NAME}; \
|
|
|
|
$(NULL)
|
2004-12-01 01:54:13 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
# dummy macro if we don't have PSM built
|
|
|
|
SIGN_NSS =
|
|
|
|
ifndef CROSS_COMPILE
|
|
|
|
ifdef MOZ_PSM
|
|
|
|
SIGN_NSS = @echo signing nss libraries;
|
|
|
|
|
2005-01-18 02:18:11 +03:00
|
|
|
SIGN_CMD = $(DIST)/bin/run-mozilla.sh $(DIST)/bin/shlibsign -v -i
|
2004-12-01 01:54:13 +03:00
|
|
|
|
|
|
|
SOFTOKN = $(DIST)/$(MOZ_PKG_APPNAME)/$(DLL_PREFIX)softokn3$(DLL_SUFFIX)
|
|
|
|
FREEBL_HYBRID = $(DIST)/$(MOZ_PKG_APPNAME)/$(DLL_PREFIX)freebl_hybrid_3$(DLL_SUFFIX)
|
|
|
|
FREEBL_PURE = $(DIST)/$(MOZ_PKG_APPNAME)/$(DLL_PREFIX)freebl_pure32_3$(DLL_SUFFIX)
|
|
|
|
|
|
|
|
SIGN_NSS += $(SIGN_CMD) $(SOFTOKN); \
|
|
|
|
if test -f $(FREEBL_HYBRID); then $(SIGN_CMD) $(FREEBL_HYBRID); fi; \
|
|
|
|
if test -f $(FREEBL_PURE); then $(SIGN_CMD) $(FREEBL_PURE); fi;
|
|
|
|
|
|
|
|
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* \
|
|
|
|
winEmbed.exe \
|
|
|
|
chrome/chrome.rdf \
|
2005-02-24 00:46:11 +03:00
|
|
|
chrome/app-chrome.manifest \
|
2005-07-26 20:46:57 +04:00
|
|
|
chrome/overlayinfo \
|
|
|
|
components/compreg.dat \
|
|
|
|
components/xpti.dat \
|
2004-12-01 01:54:13 +03:00
|
|
|
$(NULL)
|
|
|
|
|
2005-04-21 03:10:56 +04:00
|
|
|
# browser/locales/Makefile uses this makefile for it's variable defs, but
|
|
|
|
# doesn't want the libs:: rule.
|
|
|
|
ifndef PACKAGER_NO_LIBS
|
2004-12-01 01:54:13 +03:00
|
|
|
libs:: $(PACKAGE)
|
2005-04-21 03:10:56 +04:00
|
|
|
endif
|
2004-12-01 01:54:13 +03:00
|
|
|
|
|
|
|
GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE)
|
|
|
|
|
|
|
|
ifdef USE_SHORT_LIBNAME
|
|
|
|
MOZILLA_BIN = $(DIST)/bin/$(MOZ_PKG_APPNAME)$(BIN_SUFFIX)
|
|
|
|
else
|
|
|
|
MOZILLA_BIN = $(DIST)/bin/$(MOZ_PKG_APPNAME)-bin
|
|
|
|
endif
|
|
|
|
|
|
|
|
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)
|
|
|
|
STRIP = $(srcdir)/os2/strip.cmd
|
|
|
|
STRIP_FLAGS =
|
|
|
|
PLATFORM_EXCLUDE_LIST = ! -name "*.ico"
|
|
|
|
endif
|
|
|
|
|
2005-06-30 23:22:39 +04:00
|
|
|
ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
|
|
|
|
PKGCP_OS = dos
|
|
|
|
else
|
|
|
|
PKGCP_OS = unix
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(PACKAGE): $(MOZILLA_BIN) $(MOZ_PKG_MANIFEST)
|
2005-01-24 22:49:50 +03:00
|
|
|
@rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $(DIST)/$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST)
|
2004-12-01 01:54:13 +03: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 23:22:39 +04:00
|
|
|
ifdef MOZ_PKG_MANIFEST
|
|
|
|
$(RM) -rf $(DIST)/xpt
|
|
|
|
$(PERL) -I$(topsrcdir)/xpinstall/packager -e 'use Packager; \
|
|
|
|
Packager::Copy("$(DIST)", "$(DIST)/$(MOZ_PKG_APPNAME)", \
|
2005-07-01 05:18:49 +04:00
|
|
|
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1);'
|
2005-06-30 23:22:39 +04:00
|
|
|
$(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_APPNAME)/components -v -o $(PKGCP_OS)
|
|
|
|
else # !MOZ_PKG_MANIFEST
|
2004-12-01 01:54:13 +03:00
|
|
|
ifeq ($(MOZ_PKG_FORMAT),DMG)
|
|
|
|
@cd $(DIST) && rsync -auvL $(_APPNAME) $(MOZ_PKG_APPNAME)
|
|
|
|
else
|
|
|
|
@cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -)
|
|
|
|
endif # DMG
|
2005-06-30 23:22:39 +04:00
|
|
|
endif # MOZ_PKG_MANIFEST
|
2005-08-22 21:39:28 +04:00
|
|
|
ifndef PKG_SKIP_STRIP
|
2004-12-01 01:54:13 +03:00
|
|
|
@echo "Stripping package directory..."
|
|
|
|
@cd $(DIST)/$(MOZ_PKG_APPNAME); find . ! -type d \
|
|
|
|
! -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 21:39:28 +04:00
|
|
|
endif
|
2004-12-01 01:54:13 +03:00
|
|
|
@echo "Removing unpackaged files..."
|
|
|
|
ifeq ($(MOZ_PKG_FORMAT),DMG)
|
|
|
|
cd $(DIST)/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS; rm -rf $(NO_PKG_FILES)
|
|
|
|
else
|
|
|
|
cd $(DIST)/$(MOZ_PKG_APPNAME); rm -rf $(NO_PKG_FILES)
|
|
|
|
endif
|
|
|
|
@echo "Compressing..."
|
|
|
|
cd $(DIST); $(MAKE_PACKAGE)
|