3
# Uncomment this to turn on verbose mode.
6
# These are used for cross-compiling and for saving the configure script
7
# from having to guess our platform (since we know it already)
8
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
12
DEB_MOZ_APPLICATION=seamonkey
15
EXCLUDE := --exclude=CVS --exclude=.cvsignore
17
DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
18
DEBIAN_REV_CODE := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*-\([0-9]*\)[^-]*$$/0\1/ ; s/^.*\(..\)$$/\1/')
19
MOZILLA_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/-.*//; s/\+$(NOBINONLY)//')
21
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;')
23
export BUILD_OFFICIAL=1
24
export MOZ_BUILD_DATE=$(BUILD_DATE)$(DEBIAN_REV_CODE)
28
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
31
OPTFLAGS = -O2 -fno-strict-aliasing
34
# we are modern and build with 4.2 everywhere
41
DEB_DH_INSTALL_SOURCEDIR := debian/tmp
43
include /usr/share/cdbs/1/rules/debhelper.mk
44
include /usr/share/cdbs/1/class/autotools.mk
45
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
47
ifeq ($(DEB_BUILD_ARCH),ppc64)
48
OPTFLAGS = -mminimal-toc
51
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
52
DEBUGFLAGS = --enable-debug
55
# Let's give it a try without that
56
#ifneq ($(DEB_BUILD_ARCH),mips)
57
#ifneq ($(DEB_BUILD_ARCH),mipsel)
58
# CONFIGURE_OPTIONS = --enable-static --disable-shared
62
SHELL=/bin/bash # I use bashisms
64
DEB_MAKE_BUILD_TARGET = BUILD_MODULES=all
65
# DEB_MAKE_CLEAN_TARGET = clean distclean
69
TMP_DIR = $(DEB_SRCDIR)/debian/tmp
70
APPLICATIONS_DIR = $(TMP_DIR)/usr/share/applications
71
DIST = $(DEB_SRCDIR)/dist
73
LDFLAGS = -Wl,--as-needed
75
DEB_CONFIGURE_USER_FLAGS= \
76
--enable-application=suite \
77
--with-distribution-id=org.debian \
79
--with-default-mozilla-five-home=/usr/lib/$(DEB_MOZ_APPLICATION) \
80
--enable-default-toolkit=gtk2 \
84
--enable-system-cairo \
92
--enable-svg-renderer=cairo \
95
--disable-long-long-warning \
101
--enable-extensions=default,-venkman \
102
--disable-installer \
103
--disable-javaxpcom \
104
--disable-elf-dynstr-gc \
107
--enable-system-myspell \
115
install -d -m 755 $(DEB_SRCDIR)/debian/$(1)/var/lib/$(DEB_MOZ_APPLICATION)/chrome.d ;
116
JARS=`grep -E 'usr/share/$(DEB_MOZ_APPLICATION)/chrome$$' debian/$(1).install | grep -v ^# | awk '{ print $$1 }'` ; \
117
( for file in `(cd $(TMP_DIR) ; ls $$JARS)` ; do \
118
APP=chrome/`basename $$file` ; \
119
grep $$APP $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)/chrome/installed-chrome.txt ; \
120
done ) > $(DEB_SRCDIR)/debian/$(1)/var/lib/$(DEB_MOZ_APPLICATION)/chrome.d/00$(subst $(DEB_MOZ_APPLICATION)-,,$(1))
123
install/$(DEB_MOZ_APPLICATION)-browser::
124
install -d -m 755 $(TMP_DIR)/usr/share/applications
125
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/$(DEB_MOZ_APPLICATION).desktop $(TMP_DIR)/usr/share/applications
126
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/$(DEB_MOZ_APPLICATION)-navigator.desktop $(TMP_DIR)/usr/share/applications
127
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/$(DEB_MOZ_APPLICATION)-composer.desktop $(TMP_DIR)/usr/share/applications
129
install -d -m 755 $(TMP_DIR)/usr/share/pixmaps
130
install -m 644 $(DEB_SRCDIR)/suite/branding/icons/gtk/default.xpm $(TMP_DIR)/usr/share/pixmaps/$(DEB_MOZ_APPLICATION).xpm
131
install -m 644 $(DEB_SRCDIR)/xpfe/bootstrap/icons/gtk/editorWindow.xpm $(TMP_DIR)/usr/share/pixmaps/$(DEB_MOZ_APPLICATION)-composer.xpm
133
( cd debian/extras && uudecode *.uue )
134
install -d -m 755 $(TMP_DIR)/usr/share/$(DEB_MOZ_APPLICATION)/searchplugins
135
install -m 644 $(DEB_SRCDIR)/debian/extras/*.src $(DEB_SRCDIR)/debian/extras/*.gif $(TMP_DIR)/usr/share/$(DEB_MOZ_APPLICATION)/searchplugins
137
install -d -m 755 $(TMP_DIR)/usr/bin
138
install -m 755 $(DEB_SRCDIR)/debian/$(DEB_MOZ_APPLICATION)-runner $(TMP_DIR)/usr/bin/$(DEB_MOZ_APPLICATION)
140
install -d -m 755 $(TMP_DIR)/usr/sbin
141
install -m 755 $(DEB_SRCDIR)/debian/update-*-chrome $(TMP_DIR)/usr/sbin
143
install -d -m 755 $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)
144
install -m 644 $(DEB_SRCDIR)/dist/bin/.autoreg $(DEB_SRCDIR)/debian/$(DEB_MOZ_APPLICATION).cfg $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)
146
install -d -m 755 $(TMP_DIR)/etc/$(DEB_MOZ_APPLICATION)/pref
147
install -m 644 $(DEB_SRCDIR)/debian/base.js $(TMP_DIR)/etc/$(DEB_MOZ_APPLICATION)/pref
148
install -m 644 $(DEB_SRCDIR)/debian/$(DEB_MOZ_APPLICATION)rc $(TMP_DIR)/etc/$(DEB_MOZ_APPLICATION)
150
install -d -m 755 $(TMP_DIR)/usr/share/$(DEB_MOZ_APPLICATION)/defaults/pref
151
(echo "// Debian package version" ; \
152
echo "pref(\"general.useragent.product\",\"Gecko\");" ; \
153
echo "pref(\"general.useragent.productSub\",\"$(BUILD_DATE)\");" ; \
154
echo "pref(\"general.useragent.extra.$(DEB_MOZ_APPLICATION)Comment\",\"(Ubuntu-$(DEBIAN_VERSION))\");" ; \
155
) > $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)/defaults/pref/vendor.js
157
install -d -m 755 $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)/components
158
install -m 644 $(DEB_SRCDIR)/debian/homepagereset.js $(DEB_SRCDIR)/debian/about_debian.js $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)/components
160
$(call DO_CHROME,$(DEB_MOZ_APPLICATION)-browser)
161
grep -v \\.jar $(TMP_DIR)/usr/lib/$(DEB_MOZ_APPLICATION)/chrome/installed-chrome.txt >> $(DEB_SRCDIR)/debian/$(DEB_MOZ_APPLICATION)-browser/var/lib/$(DEB_MOZ_APPLICATION)/chrome.d/00browser
165
install/$(DEB_MOZ_APPLICATION)-chatzilla::
166
install -d -m 755 $(TMP_DIR)/usr/share/applications
167
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/chatzilla.desktop $(TMP_DIR)/usr/share/applications
169
install -d -m 755 $(TMP_DIR)/usr/share/pixmaps
170
install -m 644 $(DEB_SRCDIR)/xpfe/bootstrap/icons/gtk/chatzilla-window.xpm $(TMP_DIR)/usr/share/pixmaps/chatzilla.xpm
172
$(call DO_CHROME,$(DEB_MOZ_APPLICATION)-chatzilla)
174
install/$(DEB_MOZ_APPLICATION)-mailnews::
175
install -d -m 755 $(TMP_DIR)/usr/share/applications
176
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/$(DEB_MOZ_APPLICATION)-mail-compose.desktop $(TMP_DIR)/usr/share/applications
177
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/$(DEB_MOZ_APPLICATION)-mailnews.desktop $(TMP_DIR)/usr/share/applications
178
install -m 644 $(DEB_SRCDIR)/debian/menu_dir/$(DEB_MOZ_APPLICATION)-addressbook.desktop $(TMP_DIR)/usr/share/applications
180
install -d -m 755 $(TMP_DIR)/usr/share/pixmaps
181
install -m 644 $(DEB_SRCDIR)/xpfe/bootstrap/icons/gtk/addressbookWindow.xpm $(TMP_DIR)/usr/share/pixmaps/$(DEB_MOZ_APPLICATION)-addressbook.xpm
182
install -m 644 $(DEB_SRCDIR)/xpfe/bootstrap/icons/gtk/messengerWindow.xpm $(TMP_DIR)/usr/share/pixmaps/$(DEB_MOZ_APPLICATION)-mailnews.xpm
183
install -m 644 $(DEB_SRCDIR)/xpfe/bootstrap/icons/gtk/msgcomposeWindow.xpm $(TMP_DIR)/usr/share/pixmaps/$(DEB_MOZ_APPLICATION)-mail-compose.xpm
185
$(call DO_CHROME,$(DEB_MOZ_APPLICATION)-mailnews)
187
install/$(DEB_MOZ_APPLICATION)-dom-inspector::
188
$(call DO_CHROME,$(DEB_MOZ_APPLICATION)-dom-inspector)
190
binary-install/$(DEB_MOZ_APPLICATION)-browser::
191
dh_link -p$(DEB_MOZ_APPLICATION)-browser usr/lib/nss/libnssckbi.so /usr/lib/$(DEB_MOZ_APPLICATION)/libnssckbi.so
192
for lib in ssl3 softokn3 smime3 nss3 nspr4 plc4 plds4; do \
193
dh_link -p$(DEB_MOZ_APPLICATION)-browser usr/lib/lib$$lib.so.0d /usr/lib/$(DEB_MOZ_APPLICATION)/lib$$lib.so ; \
196
$(NOBINONLY): ../tarballs/$(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION).orig.tar.gz
198
echo "Cleaning $(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION).orig.tar.gz using remove.binonly.sh ..." ; \
199
rm -f ../tarballs/$(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION)+$(NOBINONLY).orig.tar.gz ; \
200
mkdir $(NOBINONLY).tmp ; \
201
( cd $(NOBINONLY).tmp ; \
202
tar zxf ../../tarballs/$(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION).orig.tar.gz ; \
203
sh ../debian/remove.binonly.sh > mozilla/REMOVED+$(NOBINONLY).txt 2>&1 ; \
204
tar zcf ../../tarballs/$(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION)+$(NOBINONLY).orig.tar.gz $(EXCLUDE) mozilla ) ; \
205
rm -rf $(NOBINONLY).tmp ; \
206
ls -l ../tarballs/$(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION).orig.tar.gz ; \
207
ls -l ../tarballs/$(DEB_MOZ_APPLICATION)_$(MOZILLA_VERSION)+$(NOBINONLY).orig.tar.gz