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)
9
DEBIAN_NAME := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p')
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
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: //')
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
27
MOZCLIENT_PROJECTNAME := $(DEBIAN_NAME)
28
MOZCLIENT_PROJECTDIR := $(CURDIR)/debian/mozclient
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)
35
EXTRA_SYSTEM_CONFIGURE_FLAGS = $(NULL)
37
FORCE_OFFICIAL_BRANDING = $(NULL)
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
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
51
ifneq (,$(findstring ~hg,$(DEBIAN_VERSION)))
52
# minefield branding for snapshots
54
DESKTOP_BRANDED = $(DEBIAN_NAME)-minefield.desktop
56
# codename branding for milestones
57
BRANDING = --with-branding=browser/branding/unofficial
58
DESKTOP_BRANDED = $(DEBIAN_NAME)-shiretoko.desktop
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
68
DEB_AUTO_UPDATE_AUTOCONF=2.13
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
77
# We don't want build-tree/mozilla/README to be shipped as a doc
78
DEB_INSTALL_DOCS_ALL := $(NULL)
83
LDFLAGS=$(shell echo $$LDFLAGS | sed -e 's/-Wl,-Bsymbolic-functions//')
86
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
87
EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-optimize
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
95
EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-cairo
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
102
EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-sqlite
105
DEB_CONFIGURE_USER_FLAGS= \
106
$(EXTRA_SYSTEM_CONFIGURE_FLAGS) \
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 \
115
--disable-crashreporter \
117
--disable-elf-dynstr-gc \
119
--disable-install-strip \
120
--disable-installer \
123
--disable-profilesharing \
125
--disable-strip-libs \
127
--disable-mochitest \
130
--enable-application=browser \
132
--enable-default-toolkit=cairo-gtk2 \
136
--enable-postscript \
141
--enable-extensions=default,-reporter \
142
--enable-single-profile \
143
--enable-system-myspell \
144
--with-distribution-id=com.ubuntu \
151
DEBIAN_EXECUTABLES = \
156
debian/$(DEBIAN_NAME)-gnome-support.postinst \
157
debian/$(DEBIAN_NAME).postinst \
162
sed -e 's,@LIBDIR@,/$(DEBIAN_FF3_DIR),g' \
163
-e 's,@APPNAME@,$(DEBIAN_NAME),g' < $< > $@
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' < $< > $@
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)
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 \
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/
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/
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) ; \
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)
218
dh_link $(DEBIAN_FF3_DIR)/$(DEBIAN_APP_NAME)-$(DEBIAN_APP_NAME_VER) $(DEBIAN_FF3_DIR)/$(DEBIAN_NAME_OTHER)
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/
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
243
cp -f debian/$(DESKTOP) \
244
debian/$(DEBIAN_NAME_OTHER)-branding/usr/share/applications/$(DEBIAN_APP_NAME_OTHER)-$(DEBIAN_APP_NAME_VER).desktop
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
262
cp -f debian/$(DESKTOP_BRANDED) \
263
debian/$(DEBIAN_NAME)-branding/usr/share/applications/$(DEBIAN_APP_NAME)-$(DEBIAN_APP_NAME_VER).desktop
266
binary-install/$(DEBIAN_NAME):: debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-useragent.js
268
debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-useragent.js: debian/ubuntu-useragent.js.tmpl
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' \
275
binary-install/$(DEBIAN_NAME_OTHER)-branding:: debian/$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-abrowser.js
277
debian/$(DEBIAN_NAME_OTHER)-branding/$(DEBIAN_FF3_DIR)/defaults/preferences/ubuntu-abrowser.js: debian/ubuntu-abrowser.js.tmpl
279
-e 's/@APP_VERSION@/$(DEBIAN_FF3_VER)/' \
282
LOCALE_VERSION = $(shell echo $(DEBIAN_VERSION) | sed -e 's/~hg.*/pre/' | tr -d '~')
284
binary-post-install/$(DEBIAN_NAME):: auto-locale-xpi.mk/translate compare
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.)
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; \
299
for i in $(DEBIAN_EXECUTABLES); do \
300
chmod a+x debian/$$i; \
304
set -e; for i in $(UUDECODE); do \
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/*~