~mozillateam/firefox/firefox-3.0.head

2 by Alexander Sack
initial firefox-trunk debian/ package
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)
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
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)
2 by Alexander Sack
initial firefox-trunk debian/ package
8
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
9
DEBIAN_NAME	:= firefox-3.0
159.1.7 by Alexander Sack
* fix DEBIAN_FF3_DIR, which diverged from install dir after dropping
10
DEBIAN_APP_NAME	:= firefox
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
11
DEBIAN_VERSION	:= $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
191 by Fabien Tassin
* Change $(shell) into $(wildcard) for XUL SDK detection
12
DEBIAN_XUL_DEV	:= $(wildcard /usr/lib/xulrunner-devel-1.9*)
212 by Fabien Tassin
* Make the reporter extension a link as we already ship it
13
DEBIAN_XUL_DIR	:= usr/lib/$(notdir $(wildcard /usr/lib/xulrunner-1.9*))
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
14
DEBIAN_FF3_DIR	 = usr/lib/$(DEBIAN_APP_NAME)-$(shell cat build-tree/mozilla/browser/config/version.txt)
15
DEB_TAR_SRCDIR	:= mozilla
2 by Alexander Sack
initial firefox-trunk debian/ package
16
107 by Fabien Tassin
* build with or without nss/nspr depending on version like xulrunner-1.9
17
EXTRA_SYSTEM_CONFIGURE_FLAGS = $(NULL)
18
136 by Alexander Sack
* exceptional official branding release for cvs version to hardy: add easy to
19
FORCE_OFFICIAL_BRANDING = 1
20
21
ifneq (,$(FORCE_OFFICIAL_BRANDING))
22
	# official branding for beta, final and final RCs builds
23
	BRANDING = --enable-official-branding
24
	DESKTOP  = firefox-3.0-final.desktop
25
else
88 by Fabien Tassin
* Change branding based on Version (use MineField if version
26
# Change branding based on Version
91 by Fabien Tassin
* Fix a typo in debian/rules (non ascii char)
27
ifneq (,$(findstring ~cvs,$(DEBIAN_VERSION)))
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
28
	# minefield branding for cvs snapshots
91 by Fabien Tassin
* Fix a typo in debian/rules (non ascii char)
29
	BRANDING = $(NULL)
89 by Fabien Tassin
* Change desktop file depending on branding:
30
	DESKTOP  = firefox-3.0-minefield.desktop
88 by Fabien Tassin
* Change branding based on Version (use MineField if version
31
else
117.1.5 by Fabien Tassin
* Use official branding for beta too as homepage/releasenotes URLs
32
ifneq (,$(findstring ~a,$(DEBIAN_VERSION)))
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
33
	# codename branding for alpha builds
115 by Alexander Sack
* Use granparadiso branding for alpha and beta builds and official branding
34
	BRANDING = --with-branding=browser/branding/unofficial
89 by Fabien Tassin
* Change desktop file depending on branding:
35
	DESKTOP  = firefox-3.0-granparadiso.desktop
115 by Alexander Sack
* Use granparadiso branding for alpha and beta builds and official branding
36
else
117.1.5 by Fabien Tassin
* Use official branding for beta too as homepage/releasenotes URLs
37
	# official branding for beta, final and final RCs builds
38
	BRANDING = --enable-official-branding
117.1.2 by Fabien Tassin
* Rename desktop file firefox-3.0-final.desktop so it doesn't
39
	DESKTOP  = firefox-3.0-final.desktop
115 by Alexander Sack
* Use granparadiso branding for alpha and beta builds and official branding
40
endif
88 by Fabien Tassin
* Change branding based on Version (use MineField if version
41
endif
136 by Alexander Sack
* exceptional official branding release for cvs version to hardy: add easy to
42
endif
88 by Fabien Tassin
* Change branding based on Version (use MineField if version
43
98 by Fabien Tassin
* Compile with gcc/g++ 4.2 for all archs.
44
CXX=g++-4.2
45
CC=gcc-4.2
46
export CXX CC 
47
2 by Alexander Sack
initial firefox-trunk debian/ package
48
DEB_AUTO_UPDATE_AUTOCONF=2.13
49
50
include /usr/share/cdbs/1/rules/tarball.mk
51
include /usr/share/cdbs/1/rules/debhelper.mk
52
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
53
include /usr/share/cdbs/1/class/autotools.mk
157 by Fabien Tassin
* Include mozilla-devscripts file using -include so ifneq could be omitted
54
-include /usr/share/mozilla-devscripts/$(DEBIAN_NAME).mk
138 by Fabien Tassin
* Add support for mozilla-devscripts and clean-up rules file accordingly
55
193 by Fabien Tassin
* Stop build-tree/mozilla/README to be shipped as a doc by setting
56
# We don't want build-tree/mozilla/README to be shipped as a doc
57
DEB_INSTALL_DOCS_ALL := $(NULL)
58
142 by Alexander Sack
* use default upstream gcc tweaks for improved performance - especially of
59
CFLAGS = -g
60
CXXFLAGS = -g
61
145 by Fabien Tassin
* Clean-up rules file to make more use of $(EXTRA_SYSTEM_CONFIGURE_FLAGS)
62
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
63
	EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-optimize
145 by Fabien Tassin
* Clean-up rules file to make more use of $(EXTRA_SYSTEM_CONFIGURE_FLAGS)
64
endif
65
154 by Fabien Tassin
* Bump requirement for system cairo to >= 1.5.8 as we now need
66
USE_SYSTEM_CAIRO := $(shell pkg-config --exists 'cairo >= 1.5.8'; a=$$?; if test $$a != 1; then echo 1; fi)
145 by Fabien Tassin
* Clean-up rules file to make more use of $(EXTRA_SYSTEM_CONFIGURE_FLAGS)
67
# for old cairo versions we cannot use system cairo
68
ifeq (1,$(USE_SYSTEM_CAIRO))
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
69
	EXTRA_SYSTEM_CONFIGURE_FLAGS += --enable-system-cairo
145 by Fabien Tassin
* Clean-up rules file to make more use of $(EXTRA_SYSTEM_CONFIGURE_FLAGS)
70
else
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
71
	EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-cairo
145 by Fabien Tassin
* Clean-up rules file to make more use of $(EXTRA_SYSTEM_CONFIGURE_FLAGS)
72
endif
73
179 by Fabien Tassin
* Add optional support for system sqlite3 (we need >= 3.5 not in hardy)
74
USE_SYSTEM_SQLITE :=  $(shell pkg-config --exists 'sqlite3 >= 3.5'; a=$$?; if test $$a != 1; then echo 1; fi)
75
ifeq (1,$(USE_SYSTEM_SQLITE))
76
	EXTRA_SYSTEM_CONFIGURE_FLAGS += --enable-system-sqlite
77
else
78
	EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-sqlite
79
endif
80
2 by Alexander Sack
initial firefox-trunk debian/ package
81
DEB_CONFIGURE_USER_FLAGS= \
107 by Fabien Tassin
* build with or without nss/nspr depending on version like xulrunner-1.9
82
	$(EXTRA_SYSTEM_CONFIGURE_FLAGS) \
2 by Alexander Sack
initial firefox-trunk debian/ package
83
	--disable-debug \
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
84
	--with-user-appdir=.mozilla \
85
	--with-system-jpeg=/usr \
86
	--with-system-zlib=/usr \
87
	--with-libxul-sdk=$(DEBIAN_XUL_DEV) \
88
	--disable-crashreporter \
89
	--disable-composer \
90
	--disable-elf-dynstr-gc \
91
	--disable-gtktest \
92
	--disable-install-strip \
93
	--disable-installer \
94
	--disable-ldap \
95
	--disable-mailnews \
96
	--disable-profilesharing \
97
	--disable-strip \
98
	--disable-strip-libs \
99
	--disable-tests \
100
	--disable-mochitest \
101
	--disable-updater \
102
	--disable-xprint \
103
	--enable-application=browser \
104
	--enable-canvas \
105
	--enable-default-toolkit=cairo-gtk2 \
106
	--enable-gnomevfs \
107
	--enable-optimize \
108
	--enable-pango \
109
	--enable-postscript \
110
	--enable-svg \
111
	--enable-mathml \
112
	--enable-xft \
113
	--enable-xinerama \
213 by Fabien Tassin
* Don't build the reporter extension at all and revert the firefox-3.0.install
114
	--enable-extensions=default,-reporter \
172 by Fabien Tassin
* Cosmetic tab vs spaces change in debian/rules
115
	--enable-single-profile \
116
	--enable-system-myspell \
117
	--with-distribution-id=com.ubuntu \
88 by Fabien Tassin
* Change branding based on Version (use MineField if version
118
	$(BRANDING)
6 by Alexander Sack
+ renamed debian/patches/brandir-dir-depth-fix to debian/patches/ftbfs-with-branding-dir
119
2 by Alexander Sack
initial firefox-trunk debian/ package
120
UUDECODE = \
121
	debsearch.gif \
122
	wikipedia.gif \
123
	$(NULL)
124
95 by Alexander Sack
* make debian/firefox.sh executable in pre-build:: target.
125
DEBIAN_EXECUTABLES = \
126
	firefox.sh \
127
	$(NULL)
128
207 by Fabien Tassin
* Rewrite substitution rules to make them more generic
129
subst_files = \
130
	debian/$(DEBIAN_NAME)-gnome-support.postinst \
131
	debian/$(DEBIAN_NAME).postinst \
132
	debian/firefox.sh \
133
	$(NULL)
134
135
%: %.in
136
	sed -e 's,@LIBDIR@,/$(DEBIAN_FF3_DIR),g' < $< > $@
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
137
138
debian/firefox.sh: debian/firefox.sh.in
207 by Fabien Tassin
* Rewrite substitution rules to make them more generic
139
	sed -e 's,@LIBDIR@,/$(DEBIAN_FF3_DIR),g' < $< > $@
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
140
159.1.8 by Alexander Sack
* rename migrate-ffox-3-beta-profile => ffox-3-beta-profile-migration-dialog
141
debian/migrator/ffox-3-beta-profile-migration-dialog: debian/migrator/main.c
159.1.9 by Alexander Sack
* pass CFLAGS to compiler when building ffox-3-beta-profile-migration-dialog
142
	$(CC) $(CFLAGS) -o $@ $< $(shell pkg-config --cflags --libs gtk+-2.0)
159.1.3 by Alexander Sack
* build migrate-ffox-3-beta-profile in a more makefile'ish fashion
143
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
144
binary-install/$(DEBIAN_NAME)::
208 by Fabien Tassin
* Fix ftbfs with bogus install path for .autoreg
145
	touch debian/$(DEBIAN_NAME)/$(DEBIAN_FF3_DIR)/.autoreg
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
146
	dh_install debian/firefox.sh $(DEBIAN_FF3_DIR)
147
	dh_install debian/firefox.cfg $(DEBIAN_FF3_DIR)
148
	dh_install debian/$(DEBIAN_NAME)-restart-required.update-notifier $(DEBIAN_FF3_DIR)
159.1.8 by Alexander Sack
* rename migrate-ffox-3-beta-profile => ffox-3-beta-profile-migration-dialog
149
	dh_install debian/migrator/ffox-3-beta-profile-migration-dialog $(DEBIAN_FF3_DIR)
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
150
	dh_link $(DEBIAN_FF3_DIR)/firefox.sh usr/bin/$(DEBIAN_NAME)
135 by Alexander Sack
* firefox-3.0 now has its own extensions directory because latest
151
	dh_link usr/lib/firefox-addons/extensions $(DEBIAN_FF3_DIR)/extensions
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
152
	dh_link usr/lib/firefox-addons/plugins $(DEBIAN_FF3_DIR)/plugins
153
	dh_link usr/lib/firefox-addons/searchplugins $(DEBIAN_FF3_DIR)/searchplugins
154
	dh_link etc/$(DEBIAN_NAME)/pref $(DEBIAN_FF3_DIR)/defaults/syspref
155
	dh_link etc/$(DEBIAN_NAME)/profile $(DEBIAN_FF3_DIR)/defaults/profile
156
	dh_link $(DEBIAN_FF3_DIR)/icons/mozicon128.png usr/share/pixmaps/$(DEBIAN_NAME).png
157
	dh_link usr/share/myspell/dicts $(DEBIAN_FF3_DIR)/dictionaries
212 by Fabien Tassin
* Make the reporter extension a link as we already ship it
158
	dh_link $(DEBIAN_XUL_DIR)/chrome/reporter.jar $(DEBIAN_FF3_DIR)/chrome/reporter.jar
159
	dh_link $(DEBIAN_XUL_DIR)/chrome/reporter.manifest $(DEBIAN_FF3_DIR)/chrome/reporter.manifest
117.1.7 by Fabien Tassin
* Revert hardcoded lib path to the upstream path, move searchplugins to
160
207 by Fabien Tassin
* Rewrite substitution rules to make them more generic
161
pre-build:: $(subst_files) debian/migrator/ffox-3-beta-profile-migration-dialog
2 by Alexander Sack
initial firefox-trunk debian/ package
162
	set -e; for i in $(UUDECODE); do \
163
		uudecode -o debian/$$i debian/$$i.uu; \
89 by Fabien Tassin
* Change desktop file depending on branding:
164
		done ; \
117.1.22 by Alexander Sack
* ship firefox.desktop again to not break existing launchers (LP: #193902)
165
		cp debian/$(DESKTOP) debian/firefox.desktop; \
95 by Alexander Sack
* make debian/firefox.sh executable in pre-build:: target.
166
		for i in $(DEBIAN_EXECUTABLES); do \
167
			chmod a+x debian/$$i; \
168
		done
2 by Alexander Sack
initial firefox-trunk debian/ package
169
170
clean::
171
	set -e; for i in $(UUDECODE); do \
172
		rm -f debian/$$i; \
207 by Fabien Tassin
* Rewrite substitution rules to make them more generic
173
		done ; 
174
	rm -f debian/$(DEBIAN_NAME).desktop
175
	rm -f $(subst_files)
159.1.8 by Alexander Sack
* rename migrate-ffox-3-beta-profile => ffox-3-beta-profile-migration-dialog
176
	rm -f debian/migrator/ffox-3-beta-profile-migration-dialog
159.1.1 by Alexander Sack
* add gtk based profile migrator dialog, build it during |pre-build| and clean
177
	rm -f debian/migrator/*~
2 by Alexander Sack
initial firefox-trunk debian/ package
178