~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/xpinstall/packager/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# ***** BEGIN LICENSE BLOCK *****
 
3
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
4
#
 
5
# The contents of this file are subject to the Mozilla Public License Version
 
6
# 1.1 (the "License"); you may not use this file except in compliance with
 
7
# the License. You may obtain a copy of the License at
 
8
# http://www.mozilla.org/MPL/
 
9
#
 
10
# Software distributed under the License is distributed on an "AS IS" basis,
 
11
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
# for the specific language governing rights and limitations under the
 
13
# License.
 
14
#
 
15
# The Original Code is Mozilla Communicator client code, released
 
16
# March 31, 1998.
 
17
#
 
18
# The Initial Developer of the Original Code is
 
19
# Netscape Communications Corporation.
 
20
# Portions created by the Initial Developer are Copyright (C) 1998
 
21
# the Initial Developer. All Rights Reserved.
 
22
#
 
23
# Contributor(s):
 
24
#
 
25
# Alternatively, the contents of this file may be used under the terms of
 
26
# either of the GNU General Public License Version 2 or later (the "GPL"),
 
27
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
28
# in which case the provisions of the GPL or the LGPL are applicable instead
 
29
# of those above. If you wish to allow use of your version of this file only
 
30
# under the terms of either the GPL or the LGPL, and not to allow others to
 
31
# use your version of this file under the terms of the MPL, indicate your
 
32
# decision by deleting the provisions above and replace them with the notice
 
33
# and other provisions required by the GPL or the LGPL. If you do not delete
 
34
# the provisions above, a recipient may use your version of this file under
 
35
# the terms of any one of the MPL, the GPL or the LGPL.
 
36
#
 
37
# ***** END LICENSE BLOCK *****
 
38
 
 
39
DEPTH           = ../..
 
40
topsrcdir       = @top_srcdir@
 
41
srcdir          = @srcdir@
 
42
VPATH           = @srcdir@
 
43
 
 
44
include $(DEPTH)/config/autoconf.mk
 
45
 
 
46
#
 
47
# This is how we create the Unix binary packages we release to the public.
 
48
# Currently the only format is tar.gz (TGZ), but it should be fairly easy
 
49
# to add .rpm (RPM) and .deb (DEB) later.
 
50
#
 
51
ifndef MOZ_PKG_FORMAT
 
52
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 
53
MOZ_PKG_FORMAT  = DMG
 
54
else
 
55
ifeq (,$(filter-out OS2 WINNT, $(OS_ARCH)))
 
56
MOZ_PKG_FORMAT  = ZIP
 
57
INSTALLER_DIR   = windows
 
58
else
 
59
ifeq (,$(filter-out SunOS, $(OS_ARCH)))
 
60
MOZ_PKG_FORMAT  = BZ2
 
61
else
 
62
MOZ_PKG_FORMAT  = TGZ
 
63
endif
 
64
INSTALLER_DIR   = unix
 
65
endif
 
66
endif
 
67
endif # MOZ_PKG_FORMAT
 
68
ifndef MOZ_PKG_APPNAME
 
69
MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
 
70
endif
 
71
ifndef SDK_PKG_APPNAME
 
72
SDK_PKG_APPNAME = gecko
 
73
endif
 
74
 
 
75
MAKE_PACKAGE    = echo "Sorry, don't know how to build a $(MOZ_PKG_FORMAT) file yet...."
 
76
MAKE_SDK        =
 
77
 
 
78
PKG_BASENAME    := $(MOZ_PKG_APPNAME)-$(TARGET_CPU)-$(TARGET_VENDOR)-$(TARGET_OS)
 
79
PACKAGE         = $(PKG_BASENAME)$(PKG_SUFFIX)
 
80
 
 
81
SDK_DIR         = sdk
 
82
SDK             = $(SDK_PKG_APPNAME)-$(SDK_DIR)-$(TARGET_CPU)-$(TARGET_VENDOR)-$(TARGET_OS)$(PKG_SUFFIX)
 
83
 
 
84
TAR_CREATE_FLAGS = -cvhf
 
85
 
 
86
ifeq ($(OS_ARCH),BSD_OS)
 
87
TAR_CREATE_FLAGS = -cvLf
 
88
endif
 
89
 
 
90
CREATE_FINAL_TAR = tar -c --owner=0 --group=0 --numeric-owner --mode="go-w" -f
 
91
 
 
92
ifeq ($(MOZ_PKG_FORMAT),TAR)
 
93
PKG_SUFFIX      = .tar
 
94
MAKE_PACKAGE    = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) > $(PACKAGE)
 
95
MAKE_SDK        = $(CREATE_FINAL_TAR) - $(SDK_PKG_APPNAME)-$(SDK_DIR) > $(SDK)
 
96
endif
 
97
ifeq ($(MOZ_PKG_FORMAT),TGZ)
 
98
PKG_SUFFIX      = .tar.gz
 
99
MAKE_PACKAGE    = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | gzip -vf9 > $(PACKAGE)
 
100
MAKE_SDK        = $(CREATE_FINAL_TAR) - $(SDK_PKG_APPNAME)-$(SDK_DIR) | gzip -vf9 > $(SDK)
 
101
endif
 
102
ifeq ($(MOZ_PKG_FORMAT),BZ2)
 
103
PKG_SUFFIX      = .tar.bz2
 
104
MAKE_PACKAGE    = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | bzip2 -vf > $(PACKAGE)
 
105
MAKE_SDK        = $(CREATE_FINAL_TAR) - $(SDK_PKG_APPNAME)-$(SDK_DIR) | bzip2 -vf > $(SDK)
 
106
endif
 
107
ifeq ($(MOZ_PKG_FORMAT),ZIP)
 
108
PKG_SUFFIX      = .zip
 
109
MAKE_PACKAGE    = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_APPNAME)
 
110
MAKE_SDK        = $(ZIP) -r9D $(SDK) $(SDK_PKG_APPNAME)-$(SDK_DIR)
 
111
endif
 
112
ifeq ($(MOZ_PKG_FORMAT),DMG)
 
113
ifndef MOZ_PKG_APPNAME
 
114
MOZ_PKG_APPNAME = Mozilla
 
115
endif
 
116
ifdef MOZ_DEBUG
 
117
_APPNAME        = $(MOZ_PKG_APPNAME)Debug.app
 
118
else
 
119
_APPNAME        = $(MOZ_PKG_APPNAME).app
 
120
endif
 
121
PKG_SUFFIX      = .dmg.gz
 
122
_ABS_TOPSRCDIR  = $(shell cd $(topsrcdir) && pwd)
 
123
MAKE_PACKAGE    = $(_ABS_TOPSRCDIR)/build/package/mac_osx/make-diskimage $(PKG_BASENAME).dmg $(MOZ_PKG_APPNAME) $(MOZ_PKG_APPNAME) && gzip -vf9 $(PKG_BASENAME).dmg
 
124
MAKE_SDK        =
 
125
endif
 
126
ifeq ($(MOZ_PKG_FORMAT),RPM)
 
127
PKG_SUFFIX      = .rpm
 
128
endif
 
129
ifeq ($(MOZ_PKG_FORMAT),DEB)
 
130
PKG_SUFFIX      = .deb
 
131
endif
 
132
 
 
133
# dummy macro if we don't have PSM built
 
134
SIGN_NSS                =
 
135
ifndef CROSS_COMPILE
 
136
ifdef MOZ_PSM
 
137
SIGN_NSS                = @echo signing nss libraries;
 
138
 
 
139
SIGN_ENV        = LD_LIBRARY_PATH=$(DIST)/bin:${LD_LIBRARY_PATH} \
 
140
                LD_LIBRARYN32_PATH=$(DIST)/bin:${LD_LIBRARYN32_PATH} \
 
141
                LD_LIBRARYN64_PATH=$(DIST)/bin:${LD_LIBRARYN64_PATH} \
 
142
                LD_LIBRARY_PATH_64=$(DIST)/bin:${LD_LIBRARY_PATH_64} \
 
143
                SHLIB_PATH=$(DIST)/bin:${SHLIB_PATH} LIBPATH=$(DIST)/bin:${LIBPATH} \
 
144
                DYLD_LIBRARY_PATH=$(DIST)/bin:${DYLD_LIBRARY_PATH} \
 
145
                LIBRARY_PATH=$(DIST)/bin:${LIBRARY_PATH}
 
146
 
 
147
SIGN_CMD        = cd $(DIST)/$(MOZ_PKG_APPNAME) && $(SIGN_ENV) $(DIST)/bin/shlibsign -v -i
 
148
 
 
149
SOFTOKN         = $(DIST)/$(MOZ_PKG_APPNAME)/$(DLL_PREFIX)softokn3$(DLL_SUFFIX)
 
150
FREEBL_HYBRID   = $(DIST)/$(MOZ_PKG_APPNAME)/$(DLL_PREFIX)freebl_hybrid_3$(DLL_SUFFIX)
 
151
FREEBL_PURE     = $(DIST)/$(MOZ_PKG_APPNAME)/$(DLL_PREFIX)freebl_pure32_3$(DLL_SUFFIX)
 
152
 
 
153
SIGN_NSS        += $(SIGN_CMD) $(SOFTOKN); \
 
154
        if test -f $(FREEBL_HYBRID); then $(SIGN_CMD) $(FREEBL_HYBRID); fi; \
 
155
        if test -f $(FREEBL_PURE); then $(SIGN_CMD) $(FREEBL_PURE); fi;
 
156
 
 
157
endif # MOZ_PSM
 
158
endif # !CROSS_COMPILE
 
159
 
 
160
TARGETS         = $(PACKAGE) $(SDK)
 
161
 
 
162
NSPR_LDIR       = $(findstring -L,$(NSPR_LIBS))
 
163
ifneq ($(NSPR_LDIR),)
 
164
NSPR_LDIR       = $(subst -L,,$(word 1,$(NSPR_LIBS)))
 
165
endif
 
166
 
 
167
EXCLUDE_LIST    = \
 
168
                $(DIST)/bin/core \
 
169
                $(DIST)/bin/bsdecho \
 
170
                $(DIST)/bin/gtscc \
 
171
                $(DIST)/bin/jscpucfg \
 
172
                $(DIST)/bin/nsinstall \
 
173
                $(DIST)/bin/viewer \
 
174
                $(NULL)
 
175
 
 
176
libs:: $(TARGETS)
 
177
 
 
178
include $(topsrcdir)/config/rules.mk
 
179
 
 
180
GARBAGE         += $(DIST)/$(PACKAGE) $(PACKAGE) $(SDK)
 
181
 
 
182
OSPACKAGE       = unix
 
183
ifdef USE_SHORT_LIBNAME
 
184
MOZILLA_BIN     = $(DIST)/bin/$(MOZ_PKG_APPNAME)$(BIN_SUFFIX)
 
185
else
 
186
MOZILLA_BIN     = $(DIST)/bin/$(MOZ_PKG_APPNAME)-bin
 
187
endif
 
188
 
 
189
ifeq ($(OS_ARCH),IRIX)
 
190
STRIP_FLAGS     = -f
 
191
endif
 
192
ifeq ($(OS_ARCH),BeOS)
 
193
STRIP_FLAGS     = -g
 
194
PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "$(MOZ_PKG_APPNAME)-bin"
 
195
endif
 
196
ifeq ($(OS_ARCH),OS2)
 
197
STRIP           = $(srcdir)/os2/strip.cmd
 
198
STRIP_FLAGS     =
 
199
OSPACKAGE       = os2
 
200
TAR_CREATE_FLAGS = -cvf
 
201
PLATFORM_EXCLUDE_LIST = ! -name "*.ico"
 
202
endif
 
203
 
 
204
$(SDK):
 
205
ifndef NO_GECKO_SDK
 
206
ifdef MAKE_SDK
 
207
        @rm -rf $(DIST)/$(SDK_PKG_APPNAME)-$(SDK_DIR) $@
 
208
        @mkdir $(DIST)/$(SDK_PKG_APPNAME)-$(SDK_DIR)
 
209
        @cd $(DIST)/$(SDK_DIR) && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(SDK_PKG_APPNAME)-$(SDK_DIR); tar -xf -)
 
210
        cd $(DIST) && $(MAKE_SDK)
 
211
endif
 
212
endif
 
213
 
 
214
$(PACKAGE): $(MOZILLA_BIN)
 
215
        @rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $@ $(EXCLUDE_LIST)
 
216
# NOTE: this must be a tar now that dist links into the tree so that we
 
217
# do not strip the binaries actually in the tree.
 
218
        @echo "Creating package directory..."
 
219
        @mkdir $(DIST)/$(MOZ_PKG_APPNAME)
 
220
ifeq ($(MOZ_PKG_FORMAT),DMG)
 
221
        @cd $(DIST) && rsync -auvL $(_APPNAME) $(MOZ_PKG_APPNAME)
 
222
else
 
223
        @cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -)
 
224
ifdef MOZ_NATIVE_NSPR
 
225
ifndef EXCLUDE_NSPR_LIBS
 
226
        @echo "Copying NSPR libs..."
 
227
        @cp -p $(NSPR_LDIR)/*$(DLL_SUFFIX) $(DIST)/$(MOZ_PKG_APPNAME)
 
228
        @chmod 755 $(DIST)/$(MOZ_PKG_APPNAME)/*$(DLL_SUFFIX)
 
229
endif
 
230
endif
 
231
endif # DMG
 
232
        @echo "Stripping package directory..."
 
233
        @cd $(DIST)/$(MOZ_PKG_APPNAME); find . ! -type d \
 
234
                        ! -name "*.js" \
 
235
                        ! -name "*.xpt" \
 
236
                        ! -name "*.gif" \
 
237
                        ! -name "*.jpg" \
 
238
                        ! -name "*.png" \
 
239
                        ! -name "*.xpm" \
 
240
                        ! -name "*.txt" \
 
241
                        ! -name "*.rdf" \
 
242
                        ! -name "*.sh" \
 
243
                        ! -name "*.properties" \
 
244
                        ! -name "*.dtd" \
 
245
                        ! -name "*.html" \
 
246
                        ! -name "*.xul" \
 
247
                        ! -name "*.css" \
 
248
                        ! -name "*.xml" \
 
249
                        ! -name "*.jar" \
 
250
                        ! -name "*.dat" \
 
251
                        ! -name "*.tbl" \
 
252
                        ! -name "*.src" \
 
253
                        ! -name "*.reg" \
 
254
                        $(PLATFORM_EXCLUDE_LIST) \
 
255
                        -exec $(STRIP) $(STRIP_FLAGS) {} >/dev/null 2>&1 \;
 
256
        $(SIGN_NSS)
 
257
ifeq (,$(filter mozilla firefox,$(MOZ_PKG_APPNAME)))
 
258
        @echo "Creating start script $(MOZ_PKG_APPNAME)..."
 
259
        cd $(DIST)/$(MOZ_PKG_APPNAME); if [ -f mozilla ]; then cp mozilla $(MOZ_PKG_APPNAME); fi
 
260
endif
 
261
ifdef NO_PKG_FILES
 
262
        @echo "Removing unpackaged files..."
 
263
ifeq ($(MOZ_PKG_FORMAT),DMG)
 
264
        cd $(DIST)/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS; rm -rf $(NO_PKG_FILES)
 
265
else
 
266
        cd $(DIST)/$(MOZ_PKG_APPNAME); rm -rf $(NO_PKG_FILES)
 
267
endif
 
268
endif
 
269
        @echo "Compressing..."
 
270
        cd $(DIST); $(MAKE_PACKAGE)
 
271
 
 
272
dist: $(MOZILLA_BIN)
 
273
ifndef MOZ_PKG_DEST
 
274
        @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)."
 
275
        @echo "Other options (not required):"
 
276
        @echo "MOZ_PKG_FORMAT: Either TGZ for .tar.gz or BZ2 for .tar.bz2. Default TGZ."
 
277
        @echo "MOZ_PKG_APPNAME: Application name, used for tarball filename, top-level dir in tarball and application start script. Default mozilla."
 
278
else
 
279
        @if [ ! -d $(MOZ_PKG_DEST) ]; then mkdir $(MOZ_PKG_DEST); fi
 
280
        @cd $(MOZ_PKG_DEST); rm -rf bin $(MOZ_PKG_APPNAME) $(PACKAGE)
 
281
        @echo "Creating distribution tarball in $(MOZ_PKG_DEST)..."
 
282
        $(PERL) $(srcdir)/pkgcp.pl --source $(DEPTH)/dist --destination $(MOZ_PKG_DEST) --file $(srcdir)/packages-$(OSPACKAGE) --os $(OSPACKAGE) --flat
 
283
        @cd $(MOZ_PKG_DEST); mv bin $(MOZ_PKG_APPNAME)
 
284
ifneq ($(MOZ_PKG_APPNAME),mozilla)
 
285
        @echo "Creating start script $(MOZ_PKG_APPNAME)..."
 
286
        cd $(MOZ_PKG_DEST)/$(MOZ_PKG_APPNAME); cp mozilla $(MOZ_PKG_APPNAME)
 
287
endif
 
288
        @echo "Compressing..."
 
289
        cd $(MOZ_PKG_DEST); $(MAKE_PACKAGE)
 
290
        @echo "Deleting work files..."
 
291
        @cd $(MOZ_PKG_DEST); rm -rf $(MOZ_PKG_APPNAME)
 
292
        @echo "Done creating $(PACKAGE)."
 
293
endif
 
294
 
 
295
installer::
 
296
ifdef INSTALLER_DIR
 
297
        make -C $(INSTALLER_DIR) installer
 
298
endif