File: rules

package info (click to toggle)
iceweasel 2.0.0.19-0etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 298,784 kB
  • ctags: 317,912
  • sloc: cpp: 1,796,902; ansic: 987,677; xml: 109,036; makefile: 47,777; asm: 35,201; perl: 26,983; sh: 20,879; cs: 6,232; java: 5,513; python: 3,249; pascal: 459; lex: 306; php: 244; csh: 132; objc: 97; yacc: 79; ada: 49; awk: 14; sql: 4; sed: 4
file content (292 lines) | stat: -rwxr-xr-x 10,233 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# # from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

SHELL=/bin/bash # I use bashisms

DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/Version: *\(.*\)/\1/ p')
UPSTREAM_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/-.*$$//')
DEBIAN_REV_CODE := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*-\([0-9]*\)[^-]*$$/0\1/ ; s/^.*\(..\)$$/\1/')

BUILD_DATE=$(shell perl -e '($$s,$$m,$$h,$$d,$$M,$$y) = gmtime((stat("client.mk"))[9]); printf "%04d%02d%02d\n",$$y + 1900,$$M + 1,$$d;')

AUTOCONF_DIRS := ./nsprpub/build/autoconf/ ./build/autoconf/

export BUILD_OFFICIAL=1
export MOZ_BUILD_DATE=$(BUILD_DATE)$(DEBIAN_REV_CODE)

LIB_DIR := /usr/lib/iceweasel
SHARE_DIR := /usr/share/iceweasel

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	OPTFLAGS = -O0 -g
else
	OPTFLAGS = -O2 -g -fno-strict-aliasing

ifeq ($(DEB_BUILD_ARCH),ppc64)
       OPTFLAGS = -mminimal-toc
endif

endif

DEBUG_FLAG=
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	DEBUG_FLAG = --enable-debug
endif

CONFIGURE_OPTIONS = \
	--with-distribution-id=org.debian \
	--enable-default-toolkit=gtk2 \
	--with-default-mozilla-five-home=$(LIB_DIR) \
	--enable-pango \
	--with-user-appdir=.mozilla \
	--with-system-png=/usr \
	--with-system-jpeg=/usr \
	--disable-mailnews \
	--disable-composer \
	--disable-ldap \
	--enable-postscript \
	--disable-installer \
	--enable-xprint \
	--enable-crypto \
	--disable-strip \
	--disable-strip-libs \
	--enable-canvas \
	--enable-svg \
	--enable-svg-renderer=cairo \
	--enable-system-cairo \
	--enable-mathml \
	--disable-tests \
	--disable-gtktest \
	--disable-debug \
	--enable-xft \
	--enable-optimize="-pipe -w $(OPTFLAGS)" \
	--with-system-zlib=/usr \
	--without-system-nspr \
	--enable-xinerama \
	--enable-extensions=default \
	--disable-pedantic \
	--disable-long-long-warning \
	--enable-single-profile \
	--disable-profilesharing \
	--enable-gnomevfs \
	--enable-application=browser \
	--disable-installer \
	--disable-updater \
	--enable-chrome-format=flat \
	--disable-elf-dynstr-gc \
	--enable-system-myspell \
	$(DEBUG_FLAG)

ifneq ($(DEB_BUILD_ARCH),mips)
ifneq ($(DEB_BUILD_ARCH),mipsel)
	CONFIGURE_OPTIONS += --enable-static --disable-shared
endif
endif

configure: config.status
config.status:
	dh_testdir
	for dir in $(AUTOCONF_DIRS); do \
		for file in config.guess config.sub; do \
			sed -i '2!b;/^#/ i\exec "/usr/share/misc/'$$file'" "$$@"' $$dir/$$file ; \
		done ; \
	done
	LDFLAGS="-Wl,--as-needed" \
	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(CONFIGURE_OPTIONS)

build: build-stamp
build-stamp: config.status
	dh_testdir

	(cd debian \
		&& uudecode aboutCredits.png.uu \
		&& uudecode debsearch.png.uu \
		&& uudecode about.png.uu)

	rsvg-convert -w 40 -h 40 -o debian/document_icon.png debian/iceweasel_icon.svg
	composite -compose src-over -geometry -2+5 debian/document_icon.png browser/app/document.png debian/document.png
	rsvg-convert -w 128 -h 128 -o debian/mozicon128.png debian/iceweasel_icon.svg
	rsvg-convert -w 32 -h 32 -o debian/iceweasel.png debian/iceweasel_icon.svg
	convert debian/iceweasel.png debian/iceweasel.xpm
	rsvg-convert -w 16 -h 16 -o debian/mozicon16.png debian/iceweasel_icon.svg
	convert debian/mozicon16.png debian/mozicon16.xpm

	if [ ! -f browser/base/branding/aboutCredits.png.upstream ]; then \
		mv -f browser/base/branding/aboutCredits.png \
			browser/base/branding/aboutCredits.png.upstream; fi
	composite -compose src-over -gravity center -geometry +0-7 debian/mozicon128.png debian/aboutCredits.png browser/base/branding/aboutCredits.png

	if [ ! -f browser/base/branding/about.png.upstream ]; then \
		mv -f browser/base/branding/about.png \
			browser/base/branding/about.png.upstream; fi
	rsvg-convert -w 256 -a -o debian/iceweasel_logo.png debian/iceweasel_logo.svg
	composite -compose src-over -gravity center -geometry +0-26 debian/iceweasel_logo.png debian/about.png browser/base/branding/about.png

	if [ ! -f browser/base/branding/icon64.png.upstream ]; then \
		mv -f browser/base/branding/icon64.png \
			browser/base/branding/icon64.png.upstream; fi
	rsvg-convert -w 64 -h 64 -o browser/base/branding/icon64.png debian/iceweasel_icon.svg
	if [ ! -f browser/base/branding/icon48.png.upstream ]; then \
		mv -f browser/base/branding/icon48.png \
			browser/base/branding/icon48.png.upstream; fi
	rsvg-convert -w 48 -h 48 -o browser/base/branding/icon48.png debian/iceweasel_icon.svg
	convert browser/base/branding/icon48.png debian/mozicon50.xpm
	convert browser/base/branding/icon48.png debian/default.xpm

	if [ ! -f browser/themes/pinstripe/browser/preferences/Options.png.upstream ]; then \
		mv -f browser/themes/pinstripe/browser/preferences/Options.png \
			browser/themes/pinstripe/browser/preferences/Options.png.upstream; fi
	convert browser/themes/winstripe/browser/preferences/Options.png -chop 32x0+64 -background \#ffff -splice 32x0+64 debian/Options.png
	xsltproc debian/filter-globe.xsl debian/iceweasel_icon.svg > debian/globe.svg
	rsvg-convert -w 32 -h 32 -o debian/globe.png debian/globe.svg
	composite -dissolve 80 -geometry +64+0 debian/globe.png debian/Options.png debian/Options.tmp.png
	composite -compose src-over -geometry +64+32 debian/globe.png debian/Options.tmp.png debian/Options.png

	cp -f debian/Options.png browser/themes/pinstripe/browser/preferences/Options.png
	if [ ! -f browser/themes/winstripe/browser/preferences/Options.png.upstream ]; then \
		mv -f browser/themes/winstripe/browser/preferences/Options.png \
			browser/themes/winstripe/browser/preferences/Options.png.upstream; fi
	cp -f debian/Options.png browser/themes/winstripe/browser/preferences/Options.png

	LD_LIBRARY_PATH=$(CURDIR)/dist/lib \
	$(MAKE) STRIP=:

	touch build-stamp

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp MPL \
		debian/*.png \
		debian/*.xpm \
		debian/globe.svg
	mv -f browser/base/branding/icon48.png.upstream \
		browser/base/branding/icon48.png || true
	mv -f browser/base/branding/icon64.png.upstream \
		browser/base/branding/icon64.png || true
	mv -f browser/base/branding/about.png.upstream \
		browser/base/branding/about.png || true
	mv -f browser/base/branding/aboutCredits.png.upstream \
		browser/base/branding/aboutCredits.png || true
	mv -f browser/themes/pinstripe/browser/preferences/Options.png.upstream \
		browser/themes/pinstripe/browser/preferences/Options.png || true
	mv -f browser/themes/winstripe/browser/preferences/Options.png.upstream \
		browser/themes/winstripe/browser/preferences/Options.png || true

	-$(MAKE) distclean

	for dir in $(AUTOCONF_DIRS); do \
		for file in config.guess config.sub; do \
			sed -i '2!b;/^exec "/ d' $$dir/$$file ; \
		done ; \
	done
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	chmod 755 debian/iceweasel-xremote-client
# Remove execute on javascript files
	find debian/tmp -name '*.so' | xargs chmod a-x 
	chmod a-x debian/tmp/$(LIB_DIR)/components/*.js

# Exclude gnome components from iceweasel
	dh_install -piceweasel -Xgnome -Ximgicon
	dh_install -piceweasel-dom-inspector
	dh_install -piceweasel-gnome-support

#Install helpers
	install -m 755 debian/iceweasel-runner \
		debian/iceweasel/$(LIB_DIR)/iceweasel

# Install icons
	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/16x16/apps
	install -m 644 debian/mozicon16.png \
		debian/iceweasel/usr/share/icons/hicolor/16x16/apps/iceweasel.png
	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/32x32/apps
	install -m 644 debian/iceweasel.png \
		debian/iceweasel/usr/share/icons/hicolor/32x32/apps/iceweasel.png
	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/scalable/apps
	install -m 644 debian/iceweasel_icon.svg \
		debian/iceweasel/usr/share/icons/hicolor/scalable/apps/iceweasel.svg

# Remove unneeded configs
	rm -f debian/iceweasel/$(SHARE_DIR)/defaults/pref/firefox-l10n.js

# Add Debian package version to preferences
	echo // Debian package version \
		> debian/iceweasel/$(SHARE_DIR)/defaults/pref/vendor.js
	echo "pref(\"general.useragent.product\",\"Gecko\");" \
		>> debian/iceweasel/$(SHARE_DIR)/defaults/pref/vendor.js
	echo "pref(\"general.useragent.productSub\",\"$(BUILD_DATE)\");" \
		>> debian/iceweasel/$(SHARE_DIR)/defaults/pref/vendor.js
	echo "pref(\"general.useragent.extra.firefoxComment\",\"(Debian-$(DEBIAN_VERSION))\");" \
		>> debian/iceweasel/$(SHARE_DIR)/defaults/pref/vendor.js

	cp -f LICENSE MPL
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdebconf -i	
	dh_installdocs -i MPL
	dh_installexamples -i
	dh_installmenu -i
	dh_installman -i
	dh_installinfo -i
	dh_installmime -i
	dh_installchangelogs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdebconf -a
	dh_installdocs -a MPL
	dh_installexamples -a
	dh_installmenu -a
	dh_installman -a
	dh_installinfo -a
	dh_installmime -a
	dh_installchangelogs -a
	dh_link -a
	dh_strip -a --dbg-package=iceweasel-dbg
	for lib in $(CURDIR)/debian/iceweasel/usr/lib/iceweasel/libsoftokn3.so $(CURDIR)/debian/iceweasel/usr/lib/iceweasel/libfreebl*.so; do \
		LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/iceweasel $(CURDIR)/security/nss/cmd/shlibsign/*/shlibsign -v -i $$lib; \
	done
	dh_compress -piceweasel -XREADME.Debian
	dh_compress -a -Niceweasel
	dh_fixperms -a 
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure