1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
14 # The Original Code is the Mozilla Browser code.
16 # The Initial Developer of the Original Code is
18 # Portions created by the Initial Developer are Copyright (C) 2004
19 # the Initial Developer. All Rights Reserved.
22 # Brian Ryner <bryner@brianryner.com>
23 # Benjamin Smedberg <bsmedberg@covad.net>
24 # Darin Fisher <darin@meer.net>
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
41 topsrcdir
= @top_srcdir@
45 include $(DEPTH
)/config
/autoconf.mk
47 DEFINES
+= -DMOZ_APP_VERSION
=$(MOZ_APP_VERSION
)
59 include $(topsrcdir
)/config
/rules.mk
64 $(PERL
) $(topsrcdir
)/config
/preprocessor.pl
$(DEFINES
) $(ACDEFINES
) $< > $@
67 _APPNAME
= XUL.framework
68 _BINPATH
= /$(_APPNAME
)/Versions
/Current
70 include $(topsrcdir
)/toolkit
/mozapps
/installer
/packager.mk
72 _ABS_OBJDIR
:= $(shell pwd
)
73 _ABS_DIST
:= $(shell cd
$(DIST
) && pwd
)
75 # Syntax "chown_root <directory>"
76 # Should be equivalent to "chown -R root:admin <directory>"
77 CHOWN_ROOT ?
= $(error CHOWN_ROOT must be set to a setuid script.
)
79 # Syntax "chown_revert <directory>"
80 # Should be equivalent to "chown -R <getuid> <directory>"
81 CHOWN_REVERT ?
= $(error CHOWN_REVERT must be set to a setuid script.
)
83 # Do the real work here: we take $(DIST)/XUL.framework and make it into an
84 # installer .pkg bundle. The xulrunner/installer makefile will then pack the
85 # installer into a DMG.
86 libs
:: Info.plist Description.plist
87 $(RM
) -rf resource-stage
89 $(RM
) -rf
$(DIST
)/$(STAGEPATH
)xulrunner-pkg
90 mkdir
$(DIST
)/$(STAGEPATH
)xulrunner-pkg
91 chmod
-R a
+rX
,u
+w
,go-w
,-s
,-t
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_APPNAME
)
92 # For some unknown reason, PackageMaker requires absolute paths to everything.
93 # For other poor reasons, PackageMaker returns an exit code of "1" if the
94 # version string has any letters in it (e.g. 1.9a1).
96 $(CHOWN_ROOT
) $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_APPNAME
) && \
97 /Developer
/Applications
/Utilities
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
-build
-v \
98 -p
$(_ABS_DIST
)/$(STAGEPATH
)xulrunner-pkg
/$(PKG_BASENAME
).pkg \
99 -f
$(_ABS_DIST
)/$(STAGEPATH
)$(MOZ_PKG_APPNAME
) \
100 -r
$(_ABS_OBJDIR
)/resource-stage \
101 -i
$(_ABS_OBJDIR
)/Info.plist \
102 -d
$(_ABS_OBJDIR
)/Description.plist
> packagemaker.log
; \
104 if
[ "$$SAVED" == "1" -a \
105 `grep -c 'was completed with the following non-fatal errors' < packagemaker.log` -gt
0 ]; then \
108 $(CHOWN_REVERT
) $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_APPNAME
); \