pjs/xpinstall/packager/Makefile.in

171 строка
5.0 KiB
Makefile

#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.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
MOZ_PKG_FORMAT = TGZ
endif
ifndef MOZ_PKG_APPNAME
MOZ_PKG_APPNAME = mozilla
endif
MAKE_PACKAGE = echo "Sorry, don't know how to build a $(MOZ_PKG_FORMAT) file yet...."
PKG_BASENAME := $(MOZ_PKG_APPNAME)-$(shell $(topsrcdir)/build/autoconf/config.guess)
PACKAGE = $(PKG_BASENAME)$(PKG_SUFFIX)
TAR_CREATE_FLAGS = -cvhf
ifeq ($(OS_ARCH),BSD_OS)
TAR_CREATE_FLAGS = -cvLf
endif
ifeq ($(MOZ_PKG_FORMAT),TGZ)
PKG_SUFFIX = .tar.gz
MAKE_PACKAGE = tar $(TAR_CREATE_FLAGS) - $(MOZ_PKG_APPNAME) | gzip -vf9 > $(PACKAGE)
endif
ifeq ($(MOZ_PKG_FORMAT),BZ2)
PKG_SUFFIX = .tar.bz2
MAKE_PACKAGE = tar $(TAR_CREATE_FLAGS) - $(MOZ_PKG_APPNAME) | bzip2 -vf > $(PACKAGE)
endif
ifeq ($(MOZ_PKG_FORMAT),ZIP)
PKG_SUFFIX = .zip
MAKE_PACKAGE = $(ZIP) -vr9 $(PACKAGE) $(MOZ_PKG_APPNAME)
endif
ifeq ($(MOZ_PKG_FORMAT),RPM)
PKG_SUFFIX = .rpm
endif
ifeq ($(MOZ_PKG_FORMAT),DEB)
PKG_SUFFIX = .deb
endif
ifdef BUILD_OFFICIAL
TARGETS = $(PACKAGE)
endif
NSPR_LDIR = $(findstring -L,$(NSPR_LIBS))
ifneq ($(NSPR_LDIR),)
NSPR_LDIR = $(subst -L,,$(word 1,$(NSPR_LIBS)))
endif
EXCLUDE_LIST = \
$(DIST)/bin/core \
$(DIST)/bin/bsdecho \
$(DIST)/bin/gtscc \
$(DIST)/bin/jscpucfg \
$(DIST)/bin/nsinstall \
$(DIST)/bin/viewer \
$(NULL)
include $(topsrcdir)/config/rules.mk
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 "mozilla-bin"
endif
all export libs install:: $(TARGETS)
$(PACKAGE): $(DIST)/bin/mozilla-bin
@rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $@ $(EXCLUDE_LIST)
# NOTE: this must be a cp now that dist links into the tree so that we
# do not strip the binaries actually in the tree.
@echo "Creating package directory..."
@cp -rp ${DIST}/bin $(DIST)/$(MOZ_PKG_APPNAME)
ifdef MOZ_NATIVE_NSPR
ifndef EXCLUDE_NSPR_LIBS
@echo "Copying NSPR libs..."
@cp -p $(NSPR_LDIR)/*$(DLL_SUFFIX) $(DIST)/$(MOZ_PKG_APPNAME)
@chmod 755 $(DIST)/$(MOZ_PKG_APPNAME)/*$(DLL_SUFFIX)
endif
endif
@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 \;
ifneq ($(MOZ_PKG_APPNAME),mozilla)
@echo "Creating start script $(MOZ_PKG_APPNAME)..."
cd $(DIST)/$(MOZ_PKG_APPNAME); cp mozilla $(MOZ_PKG_APPNAME)
endif
@echo "Compressing..."
cd $(DIST); $(MAKE_PACKAGE)
dist: $(DIST)/bin/mozilla-bin
ifndef MOZ_PKG_DEST
@echo "Please define MOZ_PKG_DEST first. It must be an absolute path to a dir outside the source tree. It should be empty (files might get deleted without warning)."
@echo "Other options (not required):"
@echo "MOZ_PKG_FORMAT: Either TGZ for .tar.gz or BZ2 for .tar.bz2. Default TGZ."
@echo "MOZ_PKG_APPNAME: Application name, used for tarball filename, top-level dir in tarball and application start script. Default mozilla."
else
@if [ ! -d $(MOZ_PKG_DEST) ]; then mkdir $(MOZ_PKG_DEST); fi
@cd $(MOZ_PKG_DEST); rm -rf bin $(MOZ_PKG_APPNAME) $(PACKAGE)
@echo "Creating distribution tarball in $(MOZ_PKG_DEST)..."
$(PERL) $(srcdir)/pkgcp.pl --source $(DEPTH)/dist --destination $(MOZ_PKG_DEST) --file $(srcdir)/packages-unix --os unix --flat
@cd $(MOZ_PKG_DEST); mv bin $(MOZ_PKG_APPNAME)
ifneq ($(MOZ_PKG_APPNAME),mozilla)
@echo "Creating start script $(MOZ_PKG_APPNAME)..."
cd $(MOZ_PKG_DEST)/$(MOZ_PKG_APPNAME); cp mozilla $(MOZ_PKG_APPNAME)
endif
@echo "Compressing..."
cd $(MOZ_PKG_DEST); $(MAKE_PACKAGE)
@echo "Deleting work files..."
@cd $(MOZ_PKG_DEST); rm -rf $(MOZ_PKG_APPNAME)
@echo "Done creating $(PACKAGE)."
endif