~ubuntu-branches/ubuntu/jaunty/firefox-3.5/jaunty-updates

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2009-03-30 19:00:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090330190040-bi1fyb3vw34x1030
Tags: 3.5~b4~hg20090330r24021+nobinonly-0ubuntu1
* New upstream snapshot, needed to initiate the firefox 3.1->3.5 transition (LP: #352995)
* Add libstartup-notification0-dev to build-deps as it now seems to be
  mandatory on lpia
  - update debian/control
* Fix the mozclient include to really use the local configuration
  - update debian/rules
* Update MOZCLIENT_GETDATE to make it use pushlog so it is not confused by merges with
  dates in the past
  - update debian/mozclient/firefox-3.5.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# These are used for cross-compiling and for saving the configure script
 
4
# from having to guess our platform (since we know it already)
 
5
DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
6
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
7
DEB_BUILD_ARCH          ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
8
 
 
9
DEBIAN_NAME             := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p')
 
10
 
 
11
DEBIAN_APP_NAME         := $(shell echo $(DEBIAN_NAME) | sed -e 's/-.*//')
 
12
DEBIAN_APP_NAME_VER     := $(shell echo $(DEBIAN_NAME) | sed -e 's/.*-//g')
 
13
DEBIAN_APP_NAME_OTHER   := abrowser
 
14
 
 
15
DEBIAN_NAME_OTHER       := $(DEBIAN_APP_NAME_OTHER)-$(DEBIAN_APP_NAME_VER)
 
16
BRANDING_NAME_OTHER     := awesome-browser
 
17
DEBIAN_META_NAME        := $(shell grep '^Package: $(DEBIAN_APP_NAME)$$' $(CURDIR)/debian/control | sed -e 's/^Package: //')
 
18
 
 
19
DEBIAN_VERSION          := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
 
20
DEBIAN_XUL_VER          := $(shell MALLOC_OPTIONS=O xulrunner-1.9.1 --gre-version)
 
21
DEBIAN_XUL_DEV          := /usr/lib/xulrunner-devel-$(DEBIAN_XUL_VER)
 
22
DEBIAN_XUL_DIR          := usr/lib/xulrunner-$(DEBIAN_XUL_VER)
 
23
DEBIAN_FF3_VER           = $(shell cat build-tree/mozilla/browser/config/version.txt)
 
24
DEBIAN_FF3_DIR           = usr/lib/$(DEBIAN_APP_NAME)-$(DEBIAN_FF3_VER)
 
25
DEB_TAR_SRCDIR          := mozilla
 
26
 
 
27
MOZCLIENT_PROJECTNAME   := $(DEBIAN_NAME)
 
28
MOZCLIENT_PROJECTDIR    := $(CURDIR)/debian/mozclient
 
29
 
 
30
# minVersion and maxVersion used in install.rdf
 
31
EM_TRANSLATION_VERSION     = $(DEBIAN_FF3_VER)
 
32
EM_TRANSLATION_MIN_VERSION = 3.0
 
33
EM_TRANSLATION_MAX_VERSION = $(DEBIAN_FF3_VER)
 
34
 
 
35
EXTRA_SYSTEM_CONFIGURE_FLAGS = $(NULL)
 
36
 
 
37
FORCE_OFFICIAL_BRANDING = $(NULL)
 
38
 
 
39
DESKTOP  = $(DEBIAN_NAME_OTHER).desktop
 
40
ifneq (,$(FORCE_OFFICIAL_BRANDING))
 
41
        # official branding for final and final RCs builds
 
42
        BRANDING = --enable-official-branding
 
43
        DESKTOP_BRANDED  = $(DEBIAN_NAME)-final.desktop
 
44
else
 
45
# Change branding based on Version
 
46
ifneq (,$(findstring ~b,$(DEBIAN_VERSION)))
 
47
        # codename branding for beta
 
48
        BRANDING = --with-branding=browser/branding/unofficial
 
49
        DESKTOP_BRANDED  = $(DEBIAN_NAME)-shiretoko.desktop
 
50
else
 
51
ifneq (,$(findstring ~hg,$(DEBIAN_VERSION)))
 
52
        # minefield branding for snapshots
 
53
        BRANDING = $(NULL)
 
54
        DESKTOP_BRANDED  = $(DEBIAN_NAME)-minefield.desktop
 
55
else
 
56
        # codename branding for milestones
 
57
        BRANDING = --with-branding=browser/branding/unofficial
 
58
        DESKTOP_BRANDED  = $(DEBIAN_NAME)-shiretoko.desktop
 
59
endif
 
60
endif
 
61
endif
 
62
 
 
63
# translation flags
 
64
MOZ_TRANSLATION_AUTO_XPI_OUTDIR := debian/lp-export-xpis/
 
65
MOZ_TRANSLATION_AUTO_XPI_SEARCHDIRS := debian/$(DEBIAN_NAME)
 
66
MOZ_TRANSLATION_AUTO_XPI_LOCALE := en-US
 
67
 
 
68
DEB_AUTO_UPDATE_AUTOCONF=2.13
 
69
 
 
70
include /usr/share/cdbs/1/rules/tarball.mk
 
71
include /usr/share/cdbs/1/rules/debhelper.mk
 
72
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 
73
include /usr/share/cdbs/1/class/autotools.mk
 
74
include $(CURDIR)/debian/mozclient/$(DEBIAN_NAME).mk
 
75
include /usr/share/mozilla-devscripts/lp-locale-export.mk
 
76
 
 
77
# We don't want build-tree/mozilla/README to be shipped as a doc
 
78
DEB_INSTALL_DOCS_ALL := $(NULL)
 
79
 
 
80
CFLAGS = -g
 
81
CXXFLAGS = -g
 
82
 
 
83
LDFLAGS=$(shell echo $$LDFLAGS | sed -e 's/-Wl,-Bsymbolic-functions//')
 
84
export LDFLAGS
 
85
 
 
86
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
87
        EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-optimize
 
88
endif
 
89
 
 
90
USE_SYSTEM_CAIRO := $(shell pkg-config --exists 'cairo >= 1.5.8'; a=$$?; if test $$a != 1; then echo 1; fi)
 
91
# for old cairo versions we cannot use system cairo
 
92
ifeq (1,$(USE_SYSTEM_CAIRO))
 
93
        EXTRA_SYSTEM_CONFIGURE_FLAGS += --enable-system-cairo
 
94
else
 
95
        EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-cairo
 
96
endif
 
97
 
 
98
USE_SYSTEM_SQLITE :=  $(shell pkg-config --exists 'sqlite3 >= 3.6.0'; a=$$?; if test $$a != 1; then echo 1; fi)
 
99
ifeq (1,$(USE_SYSTEM_SQLITE))
 
100
        EXTRA_SYSTEM_CONFIGURE_FLAGS += --enable-system-sqlite
 
101
else
 
102
        EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-sqlite
 
103
endif
 
104
 
 
105
DEB_CONFIGURE_USER_FLAGS= \
 
106
        $(EXTRA_SYSTEM_CONFIGURE_FLAGS) \
 
107
        --disable-debug \
 
108
        --with-user-appdir=.mozilla \
 
109
        --with-system-jpeg=/usr \
 
110
        --with-system-zlib=/usr \
 
111
        --with-libxul-sdk=$(DEBIAN_XUL_DEV) \
 
112
        --with-system-libxul \
 
113
        --with-system-nspr \
 
114
        --with-system-nss \
 
115
        --disable-crashreporter \
 
116
        --disable-composer \
 
117
        --disable-elf-dynstr-gc \
 
118
        --disable-gtktest \
 
119
        --disable-install-strip \
 
120
        --disable-installer \
 
121
        --disable-ldap \
 
122
        --disable-mailnews \
 
123
        --disable-profilesharing \
 
124
        --disable-strip \
 
125
        --disable-strip-libs \
 
126
        --disable-tests \
 
127
        --disable-mochitest \
 
128
        --disable-updater \
 
129
        --disable-xprint \
 
130
        --enable-application=browser \
 
131
        --enable-canvas \
 
132
        --enable-default-toolkit=cairo-gtk2 \
 
133
        --enable-gnomevfs \
 
134
        --enable-optimize \
 
135
        --enable-pango \
 
136
        --enable-postscript \
 
137
        --enable-svg \
 
138
        --enable-mathml \
 
139
        --enable-xft \
 
140
        --enable-xinerama \
 
141
        --enable-extensions=default,-reporter \
 
142
        --enable-single-profile \
 
143
        --enable-system-myspell \
 
144
        --with-distribution-id=com.ubuntu \
 
145
        $(BRANDING)
 
146
 
 
147
UUDECODE = \
 
148
        debsearch.gif \
 
149
        $(NULL)
 
150
 
 
151
DEBIAN_EXECUTABLES = \
 
152
        firefox.sh \
 
153
        $(NULL)
 
154
 
 
155
subst_files = \
 
156
        debian/$(DEBIAN_NAME)-gnome-support.postinst \
 
157
        debian/$(DEBIAN_NAME).postinst \
 
158
        debian/firefox.sh \
 
159
        $(NULL)
 
160
 
 
161
%: %.in
 
162
        sed -e 's,@LIBDIR@,/$(DEBIAN_FF3_DIR),g' \
 
163
            -e 's,@APPNAME@,$(DEBIAN_NAME),g' < $< > $@
 
164
 
 
165
debian/firefox.sh: debian/firefox.sh.in
 
166
        sed -e 's,@LIBDIR@,/$(DEBIAN_FF3_DIR),g' \
 
167
            -e 's,@META_NAME@,$(DEBIAN_META_NAME),g' \
 
168
            -e 's,@APPVER@,$(DEBIAN_APP_NAME_VER),g' < $< > $@
 
169
 
 
170
debian/migrator/ffox-31-beta-profile-migration-dialog: debian/migrator/main.c
 
171
        $(CC) $(CFLAGS) -o $@ $< $(shell pkg-config --cflags --libs gtk+-2.0)
 
172
 
 
173
BRANDING_MAKEFILES = ../../browser/branding/$(BRANDING_NAME_OTHER)/Makefile \
 
174
        ../../browser/branding/$(BRANDING_NAME_OTHER)/locales/Makefile \
 
175
        ../../browser/branding/$(BRANDING_NAME_OTHER)/content/Makefile \
 
176
        $(NULL)
 
177
 
 
178
common-build-arch::
 
179
        cd build-tree/mozilla/browser/locales/; \
 
180
                $(MAKE) SUBMAKEFILES="$(BRANDING_MAKEFILES)" $(BRANDING_MAKEFILES)
 
181
        cd build-tree/mozilla/browser/locales/; \
 
182
                $(MAKE) -C ../../browser/branding/$(BRANDING_NAME_OTHER)/content/; \
 
183
                $(MAKE) -C ../../browser/branding/$(BRANDING_NAME_OTHER)/locales/
 
184
 
 
185
common-post-build-arch::
 
186
        cd build-tree/mozilla/; \
 
187
                mkdir -p $(CURDIR)/debian/tmp-$(DEBIAN_NAME)-branding/; \
 
188
                $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-$(DEBIAN_NAME)-branding/
 
189
        cd build-tree/mozilla/browser/locales/; \
 
190
                $(MAKE) -C ../../browser/branding/$(BRANDING_NAME_OTHER)/
 
191
        cd build-tree/mozilla/; \
 
192
                mkdir -p $(CURDIR)/debian/tmp-$(DEBIAN_NAME_OTHER)-branding/; \
 
193
                $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-$(DEBIAN_NAME_OTHER)-branding/
 
194
        
 
195
binary-install/$(DEBIAN_NAME)::
 
196
        dh_installdirs $(DEBIAN_FF3_DIR)/distribution/
 
197
        rm -rf debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/icons
 
198
        rm -rf debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/chrome/icons
 
199
        dh_install -p$(DEBIAN_NAME) \
 
200
                debian/tmp-$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/chrome/classic.* \
 
201
                debian/tmp-$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/chrome/en-US.* \
 
202
                debian/tmp-$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/chrome/browser.* \
 
203
                        $(DEBIAN_FF3_DIR)/chrome
 
204
        touch debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/.autoreg
 
205
        if [ -d debian/$(DEBIAN_NAME)/usr/lib/xulrunner-addons/extensions ] ; then \
 
206
          touch $(foreach dir,$(wildcard debian/$(DEBIAN_NAME)/usr/lib/xulrunner-addons/extensions/*),$(dir)/chrome.manifest) ; \
 
207
        fi
 
208
        dh_install debian/firefox.sh $(DEBIAN_FF3_DIR)
 
209
        dh_installdocs -p$(DEBIAN_NAME) debian/firefox.cfg
 
210
        dh_install debian/$(DEBIAN_NAME)-restart-required.update-notifier $(DEBIAN_FF3_DIR)
 
211
        dh_install debian/migrator/ffox-31-beta-profile-migration-dialog $(DEBIAN_FF3_DIR)
 
212
        dh_link $(DEBIAN_FF3_DIR)/firefox.sh usr/bin/$(DEBIAN_NAME)
 
213
ifneq (,$(DEBIAN_META_NAME))
 
214
        dh_link $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME) $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME_OTHER)
 
215
        dh_link $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME) $(DEBIAN_FF3_DIR)/$(DEBIAN_NAME_OTHER)
 
216
        dh_link $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME) $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME)-$(DEBIAN_APP_NAME_VER)
 
217
else
 
218
        dh_link $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME)-$(DEBIAN_APP_NAME_VER) $(DEBIAN_FF3_DIR)/$(DEBIAN_NAME_OTHER)
 
219
endif
 
220
        dh_link usr/lib/firefox-addons/extensions $(DEBIAN_FF3_DIR)/extensions
 
221
        dh_link usr/lib/firefox-addons/plugins $(DEBIAN_FF3_DIR)/plugins
 
222
        dh_link usr/lib/firefox-addons/searchplugins $(DEBIAN_FF3_DIR)/searchplugins
 
223
        dh_link etc/$(DEBIAN_NAME)/pref $(DEBIAN_FF3_DIR)/defaults/syspref
 
224
        dh_link etc/$(DEBIAN_NAME)/profile $(DEBIAN_FF3_DIR)/defaults/profile
 
225
        dh_link usr/share/myspell/dicts $(DEBIAN_FF3_DIR)/dictionaries
 
226
        rm -f debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/chrome/browser-branding*
 
227
        dh_install debian/distribution.ini $(DEBIAN_FF3_DIR)/distribution/
 
228
 
 
229
binary-install/$(DEBIAN_NAME_OTHER)-branding::
 
230
        dh_install -p$(DEBIAN_NAME_OTHER)-branding \
 
231
                debian/tmp-$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/icons $(DEBIAN_FF3_DIR)
 
232
        dh_install -p$(DEBIAN_NAME_OTHER)-branding \
 
233
                debian/tmp-$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/chrome/icons $(DEBIAN_FF3_DIR)/chrome
 
234
        dh_install -p$(DEBIAN_NAME_OTHER)-branding \
 
235
                debian/tmp-$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/chrome/awesome-* $(DEBIAN_FF3_DIR)/chrome/
 
236
        dh_link -p$(DEBIAN_NAME_OTHER)-branding $(DEBIAN_FF3_DIR)/icons/mozicon128.png usr/share/pixmaps/$(DEBIAN_NAME_OTHER).png
 
237
        dh_installdirs -p$(DEBIAN_NAME_OTHER)-branding $(DEBIAN_FF3_DIR)/defaults/preferences/
 
238
        mkdir -p debian/$(DEBIAN_NAME_OTHER)-branding/usr/share/applications/
 
239
ifneq (,$(DEBIAN_META_NAME))
 
240
        cp -f debian/$(DESKTOP) \
 
241
                debian/$(DEBIAN_NAME_OTHER)-branding/usr/share/applications/$(DEBIAN_APP_NAME_OTHER).desktop
 
242
else
 
243
        cp -f debian/$(DESKTOP) \
 
244
                debian/$(DEBIAN_NAME_OTHER)-branding/usr/share/applications/$(DEBIAN_APP_NAME_OTHER)-$(DEBIAN_APP_NAME_VER).desktop
 
245
endif
 
246
 
 
247
binary-install/$(DEBIAN_NAME)-branding::
 
248
        rm -rf debian/$(DEBIAN_NAME)-branding/$(DEBIAN_FF3_DIR)/icons
 
249
        rm -rf debian/$(DEBIAN_NAME)-branding/$(DEBIAN_FF3_DIR)/chrome/icons
 
250
        dh_install -p$(DEBIAN_NAME)-branding \
 
251
                debian/tmp-$(DEBIAN_NAME)-branding/$(DEBIAN_FF3_DIR)/chrome/browser-branding* $(DEBIAN_FF3_DIR)/chrome
 
252
        dh_install -p$(DEBIAN_NAME)-branding \
 
253
                debian/tmp-$(DEBIAN_NAME)-branding/$(DEBIAN_FF3_DIR)/icons $(DEBIAN_FF3_DIR)
 
254
        dh_install -p$(DEBIAN_NAME)-branding \
 
255
                debian/tmp-$(DEBIAN_NAME)-branding/$(DEBIAN_FF3_DIR)/chrome/icons $(DEBIAN_FF3_DIR)/chrome
 
256
        dh_link -p$(DEBIAN_NAME)-branding $(DEBIAN_FF3_DIR)/icons/mozicon128.png usr/share/pixmaps/$(DEBIAN_NAME).png
 
257
        mkdir -p debian/$(DEBIAN_NAME)-branding/usr/share/applications/
 
258
ifneq (,$(DEBIAN_META_NAME))
 
259
        cp -f debian/$(DESKTOP_BRANDED) \
 
260
                debian/$(DEBIAN_NAME)-branding/usr/share/applications/$(DEBIAN_APP_NAME).desktop
 
261
else
 
262
        cp -f debian/$(DESKTOP_BRANDED) \
 
263
                debian/$(DEBIAN_NAME)-branding/usr/share/applications/$(DEBIAN_APP_NAME)-$(DEBIAN_APP_NAME_VER).desktop
 
264
endif
 
265
 
 
266
binary-install/$(DEBIAN_NAME):: debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-useragent.js
 
267
 
 
268
debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-useragent.js: debian/ubuntu-useragent.js.tmpl
 
269
        sed \
 
270
                -e 's/@VENDOR@/'`lsb_release -i -s`'/g' \
 
271
                -e 's/@VENDOR_SUB@/'`lsb_release -r -s`'/g' \
 
272
                -e 's/@VENDOR_COMMENT@/'`lsb_release -c -s`'/g' \
 
273
                < $< > $@
 
274
 
 
275
binary-install/$(DEBIAN_NAME_OTHER)-branding:: debian/$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-abrowser.js
 
276
 
 
277
debian/$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-abrowser.js: debian/ubuntu-abrowser.js.tmpl
 
278
        sed \
 
279
                -e 's/@APP_VERSION@/$(DEBIAN_FF3_VER)/' \
 
280
                < $< > $@
 
281
 
 
282
LOCALE_VERSION = $(shell echo $(DEBIAN_VERSION) | sed -e 's/~hg.*/pre/' | tr -d '~')
 
283
 
 
284
binary-post-install/$(DEBIAN_NAME):: auto-locale-xpi.mk/translate compare
 
285
        sed \
 
286
                -e 's/@EM_VERSION@/$(EM_TRANSLATION_VERSION)/' \
 
287
                -e 's/@EM_FIREFOX_MIN_VERSION@/$(EM_TRANSLATION_MIN_VERSION)/' \
 
288
                -e 's/@EM_FIREFOX_MAX_VERSION@/$(EM_TRANSLATION_MAX_VERSION)/' \
 
289
                < debian/translation-support/install.rdf.in > debian/install.rdf
 
290
        cd debian && zip lp-export-xpis/en-US.xpi install.rdf
 
291
ifeq (,$(findstring $(EM_TRANSLATION_VERSION), $(LOCALE_VERSION)))
 
292
        $(warning EM_TRANSLATION_VERSION=$(EM_TRANSLATION_VERSION) LOCALE_VERSION=$(LOCALE_VERSION). You need to explicitly adjust the translation version and min/max bounds.)
 
293
endif
 
294
 
 
295
pre-build:: $(subst_files) debian/migrator/ffox-31-beta-profile-migration-dialog
 
296
        set -e; for i in $(UUDECODE); do \
 
297
                uudecode -o debian/$$i debian/$$i.uu; \
 
298
                done ; \
 
299
                for i in $(DEBIAN_EXECUTABLES); do \
 
300
                        chmod a+x debian/$$i; \
 
301
                done
 
302
 
 
303
clean::
 
304
        set -e; for i in $(UUDECODE); do \
 
305
                rm -f debian/$$i; \
 
306
                done ; 
 
307
        rm -f debian/$(DEBIAN_NAME).desktop
 
308
        rm -f $(subst_files) debian/install.rdf
 
309
        rm -f debian/migrator/ffox-31-beta-profile-migration-dialog
 
310
        rm -f debian/migrator/*~
 
311
        rm -rf debian/tmp-*