~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to mozilla/toolkit/locales/l10n.mk

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:set ts=8 sw=8 sts=8 noet:
 
2
# This Source Code Form is subject to the terms of the Mozilla Public
 
3
# License, v. 2.0. If a copy of the MPL was not distributed with this
 
4
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
5
 
 
6
 
 
7
# Shared makefile that can be used to easily kick off l10n builds
 
8
# of Mozilla applications.
 
9
# This makefile should be included, and then assumes that the including
 
10
# makefile defines the following targets:
 
11
# clobber-zip
 
12
#   This target should remove all language dependent-files from $(STAGEDIST),
 
13
#   depending on $(AB_CD) set to the locale code.
 
14
#   $(AB_CD) will be en-US on the initial unpacking of the package
 
15
# libs-%
 
16
#   This target should call into the various libs targets that this
 
17
#   application depends on.
 
18
#   Make sure to set BOTH_MANIFESTS=1, as this will be called only once
 
19
#   for both packages and language packs.
 
20
# installer-%
 
21
#   This target should list all required targets, a typical rule would be
 
22
#       installers-%: clobber-% langpack-% repackage-zip-%
 
23
#               @echo "repackaging done"
 
24
#   to initially clobber the locale staging area, and then to build the
 
25
#   language pack and zip package.
 
26
#   Other targets like windows installers might be listed, too, and should
 
27
#   be defined in the including makefile.
 
28
# The including makefile should provide values for the variables
 
29
#   MOZ_APP_VERSION and MOZ_LANGPACK_EID.
 
30
 
 
31
 
 
32
run_for_effects := $(shell if test ! -d $(DIST); then $(NSINSTALL) -D $(DIST); fi)
 
33
 
 
34
# This makefile uses variable overrides from the libs-% target to
 
35
# build non-default locales to non-default dist/ locations. Be aware!
 
36
 
 
37
AB = $(firstword $(subst -, ,$(AB_CD)))
 
38
 
 
39
core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
 
40
 
 
41
# These are defaulted to be compatible with the files the wget-en-US target
 
42
# pulls. You may override them if you provide your own files. You _must_
 
43
# override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
 
44
# work in that case.
 
45
ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
 
46
WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 
47
 
 
48
# Allows overriding the final destination of the repackaged file
 
49
ZIP_OUT ?= $(_ABS_DIST)/$(PACKAGE)
 
50
 
 
51
DEFINES += \
 
52
        -DAB_CD=$(AB_CD) \
 
53
        -DMOZ_LANGPACK_EID=$(MOZ_LANGPACK_EID) \
 
54
        -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 
55
        -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION) \
 
56
        -DLOCALE_SRCDIR=$(call core_abspath,$(LOCALE_SRCDIR)) \
 
57
        -DPKG_BASENAME="$(PKG_BASENAME)" \
 
58
        -DPKG_INST_BASENAME="$(PKG_INST_BASENAME)" \
 
59
        $(NULL)
 
60
 
 
61
 
 
62
clobber-%:
 
63
        $(RM) -rf $(DIST)/xpi-stage/locale-$*
 
64
 
 
65
 
 
66
PACKAGER_NO_LIBS = 1
 
67
 
 
68
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
69
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/MacOS
 
70
else
 
71
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)
 
72
endif
 
73
 
 
74
include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
 
75
include $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.mk
 
76
 
 
77
PACKAGE_BASE_DIR = $(_ABS_DIST)/l10n-stage
 
78
 
 
79
$(STAGEDIST): AB_CD:=en-US
 
80
$(STAGEDIST): UNPACKAGE=$(call ESCAPE_WILDCARD,$(ZIP_IN))
 
81
$(STAGEDIST): $(call ESCAPE_WILDCARD,$(ZIP_IN))
 
82
# only mac needs to remove the parent of STAGEDIST...
 
83
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
84
        $(RM) -r -v $(DIST)/l10n-stage
 
85
else
 
86
# ... and windows doesn't like removing STAGEDIST itself, remove all children
 
87
        find $(STAGEDIST) -maxdepth 1 -print0 | xargs -0 $(RM) -r
 
88
endif
 
89
        $(NSINSTALL) -D $(DIST)/l10n-stage
 
90
        cd $(DIST)/l10n-stage && \
 
91
          $(UNMAKE_PACKAGE)
 
92
        $(MAKE) clobber-zip AB_CD=en-US
 
93
 
 
94
 
 
95
unpack: $(STAGEDIST)
 
96
        @echo done unpacking
 
97
 
 
98
# The path to the object dir for the mozilla-central build system,
 
99
# may be overridden if necessary.
 
100
MOZDEPTH ?= $(DEPTH)
 
101
 
 
102
ifdef MOZ_MAKE_COMPLETE_MAR
 
103
MAKE_COMPLETE_MAR = 1
 
104
ifeq ($(OS_ARCH), WINNT)
 
105
ifneq ($(MOZ_PKG_FORMAT), SFX7Z)
 
106
MAKE_COMPLETE_MAR =
 
107
endif
 
108
endif
 
109
endif
 
110
repackage-zip: UNPACKAGE="$(ZIP_IN)"
 
111
repackage-zip:  libs-$(AB_CD)
 
112
# Adjust jar logs with the new locale (can't use sed -i because of bug 373784)
 
113
        mkdir -p $(JARLOG_DIR_AB_CD)
 
114
        -cp -r $(JARLOG_DIR)/en-US/*.jar.log $(JARLOG_DIR_AB_CD)
 
115
        -$(PERL) -pi.old -e "s/en-US/$(AB_CD)/g" $(JARLOG_DIR_AB_CD)/*.jar.log
 
116
# call a hook for apps to put their uninstall helper.exe into the package
 
117
        $(UNINSTALLER_PACKAGE_HOOK)
 
118
# copy xpi-stage over, but not install.rdf and chrome.manifest,
 
119
# those are just for language packs
 
120
        cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
 
121
          tar --exclude=install.rdf --exclude=chrome.manifest $(TAR_CREATE_FLAGS) - * | ( cd $(STAGEDIST) && tar -xf - )
 
122
        mv $(STAGEDIST)/chrome/$(AB_CD).manifest $(STAGEDIST)/chrome/localized.manifest
 
123
ifdef MOZ_WEBAPP_RUNTIME
 
124
        mv $(STAGEDIST)/webapprt/chrome/$(AB_CD).manifest $(STAGEDIST)/webapprt/chrome/localized.manifest
 
125
endif
 
126
ifneq (en,$(AB))
 
127
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
128
        mv $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/en.lproj $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/$(AB).lproj
 
129
endif
 
130
endif
 
131
        $(NSINSTALL) -D $(DIST)/l10n-stage/$(PKG_PATH)
 
132
        cd $(DIST)/l10n-stage; \
 
133
          $(MAKE_PACKAGE)
 
134
ifdef MAKE_COMPLETE_MAR
 
135
        $(MAKE) -C $(MOZDEPTH)/tools/update-packaging full-update AB_CD=$(AB_CD) \
 
136
          MOZ_PKG_PRETTYNAMES=$(MOZ_PKG_PRETTYNAMES) \
 
137
          PACKAGE_BASE_DIR="$(_ABS_DIST)/l10n-stage" \
 
138
          DIST="$(_ABS_DIST)"
 
139
endif
 
140
# packaging done, undo l10n stuff
 
141
ifneq (en,$(AB))
 
142
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
143
        mv $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/$(AB).lproj $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/en.lproj
 
144
endif
 
145
endif
 
146
ifdef MOZ_OMNIJAR
 
147
        @(cd $(STAGEDIST) && $(UNPACK_OMNIJAR))
 
148
ifdef MOZ_WEBAPP_RUNTIME
 
149
        @(cd $(STAGEDIST)/webapprt && $(UNPACK_OMNIJAR_WEBAPP_RUNTIME))
 
150
endif
 
151
endif
 
152
        $(MAKE) clobber-zip AB_CD=$(AB_CD)
 
153
        $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 
154
        mv -f "$(DIST)/l10n-stage/$(PACKAGE)" "$(ZIP_OUT)"
 
155
        if test -f "$(DIST)/l10n-stage/$(PACKAGE).asc"; then mv -f "$(DIST)/l10n-stage/$(PACKAGE).asc" "$(ZIP_OUT).asc"; fi
 
156
 
 
157
repackage-zip-%: $(STAGEDIST)
 
158
        @$(MAKE) repackage-zip AB_CD=$* ZIP_IN="$(ZIP_IN)"
 
159
 
 
160
APP_DEFINES = $(firstword $(wildcard $(LOCALE_SRCDIR)/defines.inc) \
 
161
                          $(srcdir)/en-US/defines.inc)
 
162
TK_DEFINES = $(firstword \
 
163
   $(wildcard $(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/defines.inc) \
 
164
   $(MOZILLA_DIR)/toolkit/locales/en-US/defines.inc)
 
165
 
 
166
langpack-%: LANGPACK_FILE=$(_ABS_DIST)/$(PKG_LANGPACK_PATH)$(PKG_LANGPACK_BASENAME).xpi
 
167
langpack-%: AB_CD=$*
 
168
langpack-%: XPI_NAME=locale-$*
 
169
langpack-%: libs-%
 
170
        @echo "Making langpack $(LANGPACK_FILE)"
 
171
        $(NSINSTALL) -D $(DIST)/$(PKG_LANGPACK_PATH)
 
172
        $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) -I$(TK_DEFINES) -I$(APP_DEFINES) $(srcdir)/generic/install.rdf > $(FINAL_TARGET)/install.rdf
 
173
        cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
 
174
          $(ZIP) -r9D $(LANGPACK_FILE) install.rdf chrome chrome.manifest -x chrome/$(AB_CD).manifest
 
175
 
 
176
 
 
177
# This variable is to allow the wget-en-US target to know which ftp server to download from
 
178
ifndef EN_US_BINARY_URL 
 
179
EN_US_BINARY_URL = $(error You must set EN_US_BINARY_URL)
 
180
endif
 
181
 
 
182
# This make target allows us to wget the latest en-US binary from a specified website
 
183
# The make installers-% target needs the en-US binary in dist/
 
184
# and for the windows repackages we need the .installer.exe in dist/sea
 
185
wget-en-US:
 
186
ifndef WGET
 
187
        $(error Wget not installed)
 
188
endif
 
189
        $(NSINSTALL) -D $(_ABS_DIST)/$(PKG_PATH)
 
190
        (cd $(_ABS_DIST)/$(PKG_PATH) && $(WGET) --no-cache -nv -N  "$(EN_US_BINARY_URL)/$(PACKAGE)")
 
191
        @echo "Downloaded $(EN_US_BINARY_URL)/$(PACKAGE) to $(_ABS_DIST)/$(PKG_PATH)/$(PACKAGE)"
 
192
ifdef RETRIEVE_WINDOWS_INSTALLER
 
193
ifeq ($(OS_ARCH), WINNT)
 
194
        $(NSINSTALL) -D $(_ABS_DIST)/$(PKG_INST_PATH)
 
195
        (cd $(_ABS_DIST)/$(PKG_INST_PATH) && $(WGET) --no-cache -nv -N "$(EN_US_BINARY_URL)/$(PKG_PATH)$(PKG_INST_BASENAME).exe")
 
196
        @echo "Downloaded $(EN_US_BINARY_URL)/$(PKG_PATH)$(PKG_INST_BASENAME).exe to $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
 
197
endif
 
198
endif
 
199
 
 
200
generate-snippet-%:
 
201
        $(PYTHON) $(MOZILLA_DIR)/tools/update-packaging/generatesnippet.py \
 
202
          --mar-path=$(_ABS_DIST)/update \
 
203
          --application-ini-file=$(STAGEDIST)/application.ini \
 
204
          --locale=$* \
 
205
          --product=$(MOZ_PKG_APPNAME) \
 
206
          --platform=$(MOZ_PKG_PLATFORM) \
 
207
          --download-base-URL=$(DOWNLOAD_BASE_URL) \
 
208
          --verbose