#!/usr/bin/make -f DISTRIB_VERSION_MAJOR = $(shell lsb_release -s -r | cut -d '.' -f 1) DISTRIB_VERSION_MINOR = $(shell lsb_release -s -r | cut -d '.' -f 2) DISTRIB_CODENAME = $(shell lsb_release -s -c) include $(CURDIR)/debian/config/branch.mk MOZ_APP_BASENAME := thunderbird MOZ_MOZDIR := mozilla # Various build options # tree = use in-tree libs, system = use system libs MOZ_OVERRIDE_SHLIBS ?= # 1 = Enable crashreporter (if supported) MOZ_ENABLE_BREAKPAD ?= 0 # 1 = Disable official branding and crash reporter (the crash reporter builds but is not enabled in application.ini) MOZ_BUILD_UNOFFICIAL ?= 1 # 1 = Build without jemalloc suitable for valgrind debugging MOZ_VALGRIND ?= 0 # 1 = Profile guided build MOZ_BUILD_PGO ?= 0 # 1 = Build and run the testsuite MOZ_WANT_UNIT_TESTS ?= 0 # 1 = Turn on debugging bits and disable optimizations MOZ_DEBUG ?= 0 # 1 = Disable optimizations MOZ_NO_OPTIMIZE ?= 0 # Whether to use in-tree or system libs # tree = force in-tree, system = force system, default = use upstream default MOZ_USE_CAIRO ?= default MOZ_USE_NSPR ?= default MOZ_USE_NSS ?= default MOZ_USE_SQLITE ?= default MOZ_USE_HUNSPELL ?= default MOZ_USE_VPX ?= default # Build-dependencies when using system libraries NSPR_SYSTEM_BD = libnspr4-dev (>= 4.8.8) CAIRO_SYSTEM_BD = libcairo2-dev (>= 1.10.0), libfreetype6-dev, libpixman-1-dev (>= 0.19.2) SQLITE_SYSTEM_BD = libsqlite3-dev (>= 3.7.5) HUNSPELL_SYSTEM_BD = libhunspell-dev VPX_SYSTEM_BD = libvpx-dev NSS_SYSTEM_BD = libnss3-dev (>= 3.12.10) # Build-dependencies when using in-tree libraries CAIRO_TREE_BD = libxrender-dev # Additional build-dependencies EXTRA_SYSTEM_BD = \n\tlibfreetype6-dev (>= 2.0.1),\n\tlibjpeg62-dev,\n\tlibpng12-dev,\n\tzlib1g-dev,\n\tlibbz2-dev,\n\tlibevent-dev, EXTRA_DEFAULT_BD = \n\tlibfreetype6-dev (>= 2.0.1), DEFAULT_TREE_LIBS = CAIRO NSPR NSS SQLITE HUNSPELL VPX DEFAULT_SYSTEM_LIBS = # 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) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) # Other things which should be defined before including the CDBS rules DEB_TAR_SRCDIR := mozilla # We need this to execute before the debian/control target gets called clean:: pre-auto-update-debian-control # We need this to run before apply-patches post-patches:: enable-dist-patches -include /usr/share/cdbs/1/rules/tarball.mk -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/rules/patchsys-quilt.mk -include /usr/share/cdbs/1/class/makefile.mk include $(CURDIR)/debian/build/get-orig-source.mk MOZ_OBJDIR := $(DEB_BUILDDIR)/$(MOZ_MOZDIR)/obj-$(DEB_HOST_GNU_TYPE) MOZ_DISTDIR := $(MOZ_OBJDIR)/$(MOZ_MOZDIR)/dist # Define other variables used throughout the build MOZ_APP_NAME := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p') MOZ_APP_NAME_SUFFIX := $(shell echo $(MOZ_APP_NAME) | sed 's/\($(MOZ_APP_BASENAME)\)\-*\(.*\)/\2/' ) DEB_MAKE_MAKEFILE := client.mk # Without this, CDBS passes CFLAGS and CXXFLAGS options to client.mk, which breaks the build DEB_MAKE_EXTRA_ARGS := # These normally come from autotools.mk, which we no longer include (because we # don't want to run configure) ifeq (1, $(MOZ_BUILD_PGO)) DEB_MAKE_BUILD_TARGET := profiledbuild endif DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(CURDIR)/debian/tmp DEB_MAKE_CLEAN_TARGET := distclean DEB_DH_STRIP_ARGS := --dbg-package=$(MOZ_APP_NAME)-dbg # We don't want build-tree/mozilla/README to be shipped as a doc DEB_INSTALL_DOCS_ALL := $(NULL) MOZ_VERSION = $(shell cat $(DEB_BUILDDIR)/mail/config/version.txt) MOZ_PREFIX := /usr MOZ_LIBDIR = $(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-$(MOZ_VERSION) MOZ_INCDIR = $(MOZ_PREFIX)/include/$(MOZ_APP_NAME)-$(MOZ_VERSION) MOZ_IDLDIR = $(MOZ_PREFIX)/share/idl/$(MOZ_APP_NAME)-$(MOZ_VERSION) MOZ_SDKDIR = $(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-devel-$(MOZ_VERSION) NSPR_DEPENDS := $(NULL) NSS_DEPENDS := $(NULL) CAIRO_DEPENDS := $(NULL) DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME)-dev = -- -Vnspr:Depends=$(NSPR_DEPENDS) -Vnss:Depends=$(NSS_DEPENDS) -Vcairo:Depends=$(CAIRO_DEPENDS) DEB_AUTO_UPDATE_DEBIAN_CONTROL = no MOZ_PYTHON := $(shell which python) DISTRIB := $(shell lsb_release -i -s) $(foreach pkg, APP GS DEV DBG, $(foreach rel, PROVIDES BREAKS REPLACES CONFLICTS, $(eval BRANCH_SUBSTVARS += -D$(pkg)_$(rel)="$($(pkg)_$(rel))"))) NO_AUTO_REFRESH_LOCALES ?= 0 CFLAGS = -g CXXFLAGS = -g LDFLAGS = $(shell echo $$LDFLAGS | sed -e 's/-Wl,-Bsymbolic-functions//') ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) MOZ_WANT_UNIT_TESTS=0 endif ifeq (1,$(MOZ_VALGRIND)) MOZ_BUILD_UNOFFICIAL = 1 endif ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) MOZ_BUILD_PGO = 0 MOZ_NO_OPTIMIZE = 1 endif ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) MOZ_NO_OPTIMIZE = 1 MOZ_DEBUG = 1 MOZ_BUILD_UNOFFICIAL = 1 endif ifeq (1, $(MOZ_BUILD_PGO)) # See https://bugzilla.mozilla.org/show_bug.cgi?id=602245 MOZ_WANT_UNIT_TESTS = 0 # We don't really want the crash reporter on for PGO builds yet MOZ_ENABLE_BREAKPAD = 0 MOZ_BUILD_UNOFFICIAL = 1 endif include $(CURDIR)/debian/build/testsuite.mk ifneq ($(MOZ_APP_NAME),$(MOZ_APP_BASENAME)) # We don't want to make builds which change MOZ_APP_NAME official MOZ_BUILD_UNOFFICIAL = 1 endif # enable the crash reporter only on i386, amd64 and armel ifeq (,$(filter i386 amd64 armel,$(DEB_HOST_ARCH))) MOZ_ENABLE_BREAKPAD = 0 endif BRANDING = $(CHANNEL) ifneq (,$(filter release beta, $(BRANDING))) BRANDING = official endif ifeq (1,$(MOZ_BUILD_UNOFFICIAL)) ifneq (,$(filter official aurora, $(BRANDING))) BRANDING = nightly endif endif ifeq (official,$(BRANDING)) BRANDING_DIR = other-licenses/branding/thunderbird MOZ_BRANDING_OPTION = --enable-official-branding else BRANDING_DIR = mail/branding/$(BRANDING) MOZ_BRANDING_OPTION = --with-branding=$(BRANDING_DIR) endif MOZ_DISPLAY_NAME = $(shell cat $(DEB_BUILDDIR)/$(BRANDING_DIR)/locales/en-US/brand.properties \ | grep brandShortName | sed -e 's/brandShortName\=//') ifeq (nightly,$(CHANNEL)) ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -lt "1104" && echo "1")) # Disable crashreporter on nightly builds older than Natty MOZ_ENABLE_BREAKPAD = 0 endif endif export LDFLAGS export DEB_BUILD_HARDENING=1 ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1104" && echo "1")) MOZ_ENABLE_GLOBALMENU := 1 endif ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1110" && echo "1")) MOZ_ENABLE_UNITY_INTEGRATION := 1 UNITY_DEPENDS = libindicate5, libdbusmenu-gtk4, libunity6, libebook1.2-12, libedataserver1.2-15 endif ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1010" && echo "1")) MOZ_SYSTEM_DICTDIR = /usr/share/hunspell else MOZ_SYSTEM_DICTDIR = /usr/share/myspell/dicts endif export MOZCONFIG=$(CURDIR)/debian/config/mozconfig ifneq (1,$(MOZ_BUILD_UNOFFICIAL)) export BUILD_OFFICIAL=1 endif ifeq (1,$(MOZ_ENABLE_BREAKPAD)) # Needed to enable crashreported in application.ini export MOZILLA_OFFICIAL=1 endif ifeq (1,$(MOZ_BUILD_PGO)) CC = $(shell which gcc-4.5) CXX = $(shell which g++-4.5) export CC export CXX endif ifdef LOCAL_BRANCH export LOCAL_REPO=$(shell dirname $(LOCAL_BRANCH)) endif ifeq ($(MOZ_APP_BASENAME),$(MOZ_APP_NAME)) # We need to add an epoch to the version of the thunderbird-locale- packages. Don't do this for thunderbird-trunk-locale- though LOCALE_PACKAGES := $(shell cat $(CURDIR)/debian/control | grep "^Package:[[:space:]]*$(MOZ_APP_NAME)-locale\-" | sed -n -e 's/^Package\:[[:space:]]*\([^[:space:]]*\)/\1/ p') DEB_VERSION := $(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/.*: //p') $(foreach locale_package, $(LOCALE_PACKAGES), $(eval DEB_DH_GENCONTROL_ARGS_$(locale_package) = -- -v1:$(DEB_VERSION))) DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME) := -- -Vapp:Replaces="mozilla-thunderbird, thunderbird-gnome-support (<= 3.0.4+nobinonly-0ubuntu3)" -Vapp:Conflicts=mozilla-thunderbird \ -Vapp:Breaks="thunderbird-gnome-support (<= 3.0.4+nobinonly-0ubuntu3)" endif DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME)-gnome-support = -- -Vunity:Depends="$(UNITY_DEPENDS)" # Defines used for the Mozilla text preprocessor DEB_DEFINES = -DMOZ_LIBDIR="$(MOZ_LIBDIR)" -DMOZ_APP_NAME="$(MOZ_APP_NAME)" -DMOZ_APP_BASENAME="$(MOZ_APP_BASENAME)"\ -DMOZ_INCDIR="$(MOZ_INCDIR)" -DMOZ_IDLDIR="$(MOZ_IDLDIR)" -DMOZ_VERSION="$(MOZ_VERSION)" -DDEB_HOST_ARCH="$(DEB_HOST_ARCH)" \ -DMOZ_DISPLAY_NAME="$(MOZ_DISPLAY_NAME)" -DMOZ_SYSTEM_DICTDIR="$(MOZ_SYSTEM_DICTDIR)" -DMOZ_OVERRIDE_SHLIBS="$(MOZ_OVERRIDE_SHLIBS)" \ -DMOZ_BRANDING_OPTION="$(MOZ_BRANDING_OPTION)" -DTOPSRCDIR="$(CURDIR)" -DDEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \ -DMOZ_PREFIX="$(MOZ_PREFIX)" -DMOZ_SDKDIR="$(MOZ_SDKDIR)" -DMOZ_DISTDIR="$(MOZ_DISTDIR)" \ -DMOZ_OBJDIR="$(MOZ_OBJDIR)" -DDEB_BUILDDIR="$(DEB_BUILDDIR)" -DMOZ_PYTHON="$(MOZ_PYTHON)" -DMOZ_PROFILE_PREFIX="." SHLIB_OVERRIDE = $(if $(shell test "system" = "$(MOZ_OVERRIDE_SHLIBS)" && echo "1"), $(eval MOZ_USE_$(1) = system), \ $(if $(shell test "tree" = "$(MOZ_OVERRIDE_SHLIBS)" && echo "1"), $(eval MOZ_USE_$(1) = tree),)) DEFINE_DEFAULT_TREE_LIB = $(if $(shell test "system" != "$(MOZ_USE_$(1))" && echo "1"), $(eval DEB_DEFINES += -DMOZ_TREE_$(1)); $(eval MOZ_TREE_$(1) = 1),) DEFINE_DEFAULT_SYSTEM_LIB = $(if $(shell test "tree" = "$(MOZ_USE_$(1))" && echo "1"), $(eval DEB_DEFINES += -DMOZ_TREE_$(1)); $(eval MOZ_TREE_$(1) = 1),) $(foreach lib, $(DEFAULT_TREE_LIBS) $(DEFAULT_SYSTEM_LIBS), $(call SHLIB_OVERRIDE,$(lib))) $(foreach lib, $(DEFAULT_TREE_LIBS) $(DEFAULT_SYSTEM_LIBS), $(eval DEB_DEFINES += -DMOZ_USE_$(lib)="$(MOZ_USE_$(lib))")) $(foreach lib, $(DEFAULT_TREE_LIBS), $(call DEFINE_DEFAULT_TREE_LIB,$(lib))) $(foreach lib, $(DEFAULT_SYSTEM_LIBS), $(call DEFINE_DEFAULT_SYSTEM_LIB,$(lib))) ifeq (1, $(MOZ_ENABLE_BREAKPAD)) DEB_DEFINES += -DMOZ_ENABLE_BREAKPAD endif ifeq (1, $(MOZ_VALGRIND)) DEB_DEFINES += -DMOZ_VALGRIND endif ifeq (1,$(MOZ_NO_OPTIMIZE)) DEB_DEFINES += -DMOZ_NO_OPTIMIZE endif ifeq (1,$(MOZ_WANT_UNIT_TESTS)) DEB_DEFINES += -DMOZ_WANT_UNIT_TESTS endif ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) DEB_DEFINES += -DDEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" endif ifeq (1,$(MOZ_BUILD_PGO)) DEB_DEFINES += -DMOZ_BUILD_PGO endif ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1104" && echo "1")) DEB_DEFINES += -DMOZ_DISABLE_GNOMEVFS DEB_DEFINES += -DMOZ_DISABLE_CONTROL_CENTER endif ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1204" && echo "1")) DEB_DEFINES += -DMOZ_DISABLE_GCONF endif ifneq (,$(filter aurora beta, $(CHANNEL))) DEB_DEFINES += -DMOZ_UPDATE_CHANNEL="$(CHANNEL)" endif ifeq (1,$(MOZ_DEBUG)) DEB_DEFINES += -DMOZ_DEBUG endif ifneq (,$(findstring armel,$(DEB_HOST_ARCH))) DEB_DEFINES += -DDEB_ENABLE_THUMB2 endif ifeq (1,$(MOZ_ENABLE_GLOBALMENU)) DEB_DEFINES += -DMOZ_ENABLE_GLOBALMENU endif ifeq (official, $(BRANDING)) DEB_DEFINES += -DMOZ_OFFICIAL_BRANDING endif ifeq (1,$(MOZ_ENABLE_UNITY_INTEGRATION)) DEB_DEFINES += -DMOZ_ENABLE_UNITY_INTEGRATION endif ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1110" && echo "1")) DEB_DEFINES += -DMOZ_NEW_SYSPREF endif ifneq (1, $(MOZ_TREE_NSPR)) NSPR_DEPENDS = libnspr4-dev endif ifneq (1, $(MOZ_TREE_CAIRO)) CAIRO_DEPENDS = libcairo2-dev endif ifneq (1, $(MOZ_TREE_NSS)) NSS_DEPENDS = libnss3-dev endif DEBIAN_EXECUTABLES = \ $(MOZ_APP_NAME)$(MOZ_LIBDIR)/thunderbird.sh \ $(NULL) subst_files = \ debian/config/mozconfig \ debian/$(MOZ_APP_NAME).dirs \ debian/$(MOZ_APP_NAME).install \ debian/$(MOZ_APP_NAME).links \ debian/$(MOZ_APP_NAME).manpages \ debian/thunderbird.sh \ debian/$(MOZ_APP_NAME).xml \ debian/$(MOZ_APP_NAME).desktop \ debian/$(MOZ_APP_NAME)-dev.install \ debian/$(MOZ_APP_NAME)-dev.links \ debian/$(MOZ_APP_NAME)-gnome-support.install \ debian/$(MOZ_APP_NAME)-mozsymbols.install \ debian/$(MOZ_APP_NAME)-globalmenu.dirs \ debian/$(MOZ_APP_NAME).lintian-overrides \ debian/$(MOZ_APP_NAME).postinst \ debian/$(MOZ_APP_NAME).postrm \ debian/$(MOZ_APP_NAME).preinst \ debian/apport/blacklist \ debian/apport/native-origins \ debian/apport/source_$(MOZ_APP_NAME).py \ $(NULL) SYSLIBS_BD = $(NULL) APPEND_BDS = $(if $(shell test "x$(1)" != "x" && echo "1" ), $(eval SYSLIBS_BD += \n\t$(1),),) $(foreach lib, $(DEFAULT_TREE_LIBS) $(DEFAULT_SYSTEM_LIBS), $(if $(shell test "$(MOZ_TREE_$(lib))" != "1" && echo "1"), $(call APPEND_BDS,$($(lib)_SYSTEM_BD)),$(call APPEND_BDS,$($(lib)_TREE_BD)))) ifeq (system, $(MOZ_OVERRIDE_SHLIBS)) SYSLIBS_BD += $(EXTRA_SYSTEM_BD) else ifneq (tree, $(MOZ_OVERRIDE_SHLIBS)) SYSLIBS_BD += $(EXTRA_DEFAULT_BD) endif debian/control:: debian/control.in debian/control.langpacks debian/control.langpacks.unavail debian/config/locales.shipped debian/config/locales.all @echo "" @echo "*****************************" @echo "* Refreshing debian/control *" @echo "*****************************" @echo "" @sed -e 's/@SYSLIBS_BD@/$(SYSLIBS_BD)/g' \ -e 's/@MOZ_APP_NAME@/$(MOZ_APP_NAME)/g' < debian/control.in > debian/control @perl debian/build/dump-langpack-control-entries.pl -i $(CURDIR)/debian/config -t $(CURDIR)/debian > debian/control.tmp @sed -e 's/@MOZ_APP_NAME@/$(MOZ_APP_NAME)/g' < debian/control.tmp >> debian/control && rm -f debian/control.tmp BRANCH := ifneq (,$(MOZ_APP_NAME_SUFFIX)) BRANCH = -$(MOZ_APP_NAME_SUFFIX) endif $(subst_files): $(foreach file, $(subst_files), $(subst $(BRANCH),,$(file).in)) $(MOZ_PYTHON) $(DEB_BUILDDIR)/$(MOZ_MOZDIR)/config/Preprocessor.py -Fsubstitution --marker="%%" $(DEB_DEFINES) $(CURDIR)/$(subst $(BRANCH),,$@.in) > $(CURDIR)/$@ debian/stamp-buildsymbols: debian/stamp-makefile-build ifeq (1, $(MOZ_ENABLE_BREAKPAD)) # create build symbols cd $(MOZ_OBJDIR); \ $(MAKE) buildsymbols MOZ_SYMBOLS_EXTRA_BUILDID=$(shell date -d "`dpkg-parsechangelog | grep Date: | sed -e 's/^Date: //'`" +%y%m%d%H%M%S)-$(DEB_HOST_GNU_CPU) endif touch $@ compare-locales/scripts/compare-locales: cp -r $(CURDIR)/debian/compare-locales $(CURDIR) chmod +x $(CURDIR)/compare-locales/scripts/* debian/stamp-langpack-xpi-build: compare-locales/scripts/compare-locales @echo "" @echo "********************************" @echo "* Building language pack xpi's *" @echo "********************************" @echo "" rm -rf $(CURDIR)/debian/l10n-mergedirs mkdir $(CURDIR)/debian/l10n-mergedirs @export PATH=$(CURDIR)/compare-locales/scripts/:$$PATH ; \ export PYTHONPATH=$(CURDIR)/compare-locales/lib ; \ cd $(MOZ_OBJDIR)/mail/locales ; \ while read line ; \ do \ line=`echo $$line | sed 's/#.*//' | sed '/^$$/d'` ; \ if [ ! -z "$$line" ] ; \ then \ language=`echo $$line | sed 's/\([^:]*\):*\([^:]*\)/\1/'` ; \ echo "" ; \ echo "" ; \ echo "* Building $${language}" ; \ echo "" ; \ $(MAKE) merge-$$language LOCALE_MERGEDIR=$(CURDIR)/debian/l10n-mergedirs/$$language || exit 1 ; \ $(MAKE) langpack-$$language LOCALE_MERGEDIR=$(CURDIR)/debian/l10n-mergedirs/$$language || exit 1 ; \ fi \ done < $(CURDIR)/debian/config/locales.shipped touch $@ debian/messagingmenu/messagingmenu@mozilla.com.xpi: cd $(CURDIR)/debian/messagingmenu; \ sh build.sh || exit 1; \ mv $(CURDIR)/debian/messagingmenu/messagingmenu.xpi $(CURDIR)/debian/messagingmenu/messagingmenu@mozilla.com.xpi debian/eds/edsintegration@mozilla.com.xpi: cd $(CURDIR)/debian/eds; \ LIBXUL_SDK=$(CURDIR)/$(MOZ_DISTDIR) sh build.sh || exit 1; \ mv $(CURDIR)/debian/eds/edsintegration.xpi $(CURDIR)/debian/eds/edsintegration@mozilla.com.xpi common-build-arch:: debian/stamp-testsuite debian/messagingmenu/messagingmenu@mozilla.com.xpi debian/eds/edsintegration@mozilla.com.xpi common-build-indep:: debian/stamp-langpack-xpi-build common-binary-arch:: debian/stamp-buildsymbols common-binary-post-install-indep:: @echo "" @echo "**********************************" @echo "* Installing language pack xpi's *" @echo "**********************************" @echo "" @while read line ; \ do \ line=`echo $$line | sed 's/#.*//' | sed '/^$$/d'` ; \ if [ ! -z "$$line" ] ; \ then \ language=`echo $$line | sed 's/\([^:]*\):*\([^:]*\)/\1/'` ; \ pkgname=`echo $$line | sed 's/\([^:]*\):*\([^:]*\)/\2/'` ; \ id=`python $(CURDIR)/debian/build/get-xpi-id.py $(CURDIR)/$(MOZ_DISTDIR)/linux-$(DEB_HOST_GNU_CPU)/xpi/$(MOZ_APP_NAME)-$(MOZ_VERSION).$${language}.langpack.xpi` ; \ [ $$? -eq 0 ] || exit 1 ; \ echo "Installing $(MOZ_APP_NAME)-$(MOZ_VERSION).$${language}.langpack.xpi to $${id}.xpi in $(MOZ_APP_NAME)-locale-$${pkgname}" ; \ dh_installdirs -p$(MOZ_APP_NAME)-locale-$${pkgname} usr/lib/$(MOZ_APP_NAME)-addons/extensions ; \ cp $(CURDIR)/$(MOZ_DISTDIR)/linux-$(DEB_HOST_GNU_CPU)/xpi/$(MOZ_APP_NAME)-$(MOZ_VERSION).$${language}.langpack.xpi \ $(CURDIR)/debian/$(MOZ_APP_NAME)-locale-$${pkgname}/usr/lib/$(MOZ_APP_NAME)-addons/extensions/$${id}.xpi ; \ fi \ done < $(CURDIR)/debian/config/locales.shipped binary-install/$(MOZ_APP_NAME):: convert -resize 32x32 debian/$(MOZ_APP_NAME)/usr/share/pixmaps/$(MOZ_APP_NAME).png debian/$(MOZ_APP_NAME)/usr/share/pixmaps/$(MOZ_APP_NAME).xpm ifeq (1, $(MOZ_ENABLE_UNITY_INTEGRATION)) echo "$(MOZ_PREFIX)/share/applications/$(MOZ_APP_NAME).desktop" > debian/$(MOZ_APP_NAME)/usr/share/indicators/messages/applications/$(MOZ_APP_NAME) endif ifeq (1,$(MOZ_ENABLE_BREAKPAD)) install -m 0644 $(CURDIR)/debian/apport/blacklist $(CURDIR)/debian/$(MOZ_APP_NAME)/etc/apport/blacklist.d/$(MOZ_APP_NAME) endif install -m 0644 $(CURDIR)/debian/apport/native-origins $(CURDIR)/debian/$(MOZ_APP_NAME)/etc/apport/native-origins.d/$(MOZ_APP_NAME) ifeq (1, $(MOZ_ENABLE_GLOBALMENU)) binary-install/$(MOZ_APP_NAME)-globalmenu:: unzip -o -d debian/$(MOZ_APP_NAME)-globalmenu$(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-addons/extensions/globalmenu@ubuntu.com/ $(MOZ_DISTDIR)/xpi-stage/globalmenu.xpi find debian/$(MOZ_APP_NAME)-globalmenu$(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-addons/extensions/globalmenu@ubuntu.com/ -type f -executable | xargs chmod -x endif GNOME_SUPPORT_FILES = libmozgnome.so binary-post-install/$(MOZ_APP_NAME):: $(foreach file,$(GNOME_SUPPORT_FILES),rm -fv debian/$(MOZ_APP_NAME)/usr/lib/firefox-*/components/$(file);) true ifeq (1, $(MOZ_TREE_NSPR)) binary-post-install/$(MOZ_APP_NAME)-dev:: rm -f debian/$(MOZ_APP_NAME)-dev$(MOZ_INCDIR)/nspr/md/_linux.cfg dh_link -p$(MOZ_APP_NAME)-dev $(MOZ_INCDIR)/nspr/prcpucfg.h $(MOZ_INCDIR)/nspr/md/_linux.cfg endif common-binary-predeb-arch:: $(foreach file,$(DEBIAN_EXECUTABLES),chmod a+x debian/$(file);) # we want the gnome dependencies not to be in the main package at shlibdeps runtime, hence we dont # install them at binary-install/* stage, but copy them over _after_ the shlibdeps had been generated $(foreach file,$(GNOME_SUPPORT_FILES),mv debian/$(MOZ_APP_NAME)-gnome-support$(MOZ_LIBDIR)/components/$(file) debian/$(MOZ_APP_NAME)$(MOZ_LIBDIR)/components/;) true ifeq (1, $(MOZ_TREE_NSS)) binary-predeb/$(MOZ_APP_NAME):: $(foreach lib,libsoftokn3.so libfreebl3.so libnssdbm3.so, \ LD_LIBRARY_PATH=debian/$(MOZ_APP_NAME)$(MOZ_LIBDIR):$$LD_LIBRARY_PATH \ $(MOZ_DISTDIR)/bin/shlibsign -v -i debian/$(MOZ_APP_NAME)$(MOZ_LIBDIR)/$(lib);) endif pre-build:: $(subst_files) cp $(CURDIR)/debian/syspref.js $(CURDIR)/debian/$(MOZ_APP_BASENAME).js $(shell /usr/bin/docbook-to-man $(CURDIR)/debian/thunderbird.sgml > $(CURDIR)/debian/$(MOZ_APP_NAME).1) mkdir -p $(DEB_SRCDIR)/mozilla/extensions/globalmenu (cd debian/globalmenu && tar -cvhf - .) | (cd $(DEB_SRCDIR)/mozilla/extensions/globalmenu && tar -xf -) get-compare-locales: mkdir -p compare-locales-tmp hg clone http://hg.mozilla.org/build/compare-locales compare-locales-tmp ifdef HGTAG cd compare-locales-tmp; \ hg update $(HGTAG); \ printf "TAG=%s" $(HGTAG) > REV else cd compare-locales-tmp; \ CHANGESET=`hg summary | grep parent | cut -d ' ' -f 2 | cut -d : -f 2`; \ printf "CHANGESET=%s" $$CHANGESET > REV endif cd compare-locales-tmp; \ find . -name *.pyc | xargs rm -f; \ rm -rf .hg .hgtags .hgignore tests *.py rm -rf debian/compare-locales mv compare-locales-tmp debian/compare-locales refresh-supported-locales: real-refresh-supported-locales debian/control real-refresh-supported-locales: @echo "" @echo "****************************************" @echo "* Refreshing list of shipped languages *" @echo "****************************************" @echo "" @if [ ! -f $(CURDIR)/upstream-shipped-locales ] ; \ then \ if [ ! -z $(TARBALL) ] ; \ then \ tarball_opts="-o $(TARBALL)" ; \ else \ tarball_opts="" ; \ fi ; \ python debian/build/extract-file.py -d $(CURDIR) $$tarball_opts upstream-shipped-locales ; \ touch $(CURDIR)/upstream-shipped-locales.stamp ; \ fi ifdef LANGPACK_O_MATIC @perl debian/build/refresh-supported-locales.pl -s $(CURDIR)/upstream-shipped-locales -l $(LANGPACK_O_MATIC) -o $(CURDIR)/debian/config -b $(CURDIR)/debian/config/locales.blacklist else @perl debian/build/refresh-supported-locales.pl -s $(CURDIR)/upstream-shipped-locales -o $(CURDIR)/debian/config -b $(CURDIR)/debian/config/locales.blacklist endif @if [ -f $(CURDIR)/upstream-shipped-locales.stamp ] ; \ then \ rm -f $(CURDIR)/upstream-shipped-locales $(CURDIR)/upstream-shipped-locales.stamp ; \ fi pre-auto-refresh-supported-locales: cp debian/config/locales.shipped debian/config/locales.shipped.old auto-refresh-supported-locales: pre-auto-refresh-supported-locales real-refresh-supported-locales @if ! cmp -s debian/config/locales.shipped debian/config/locales.shipped.old ; \ then \ echo "" ; \ echo "****************************************************************************" ; \ echo "* List of shipped locales is out of date. Please refresh and try again *" ; \ echo "* To refresh, run \"debian/rules refresh-supported-locales\" in the source *" ; \ echo "* directory. If you are in bzr, you will need to pass the location of the *" ; \ echo "* upstream tarball, using \"TARBALL=/path/to/tarball\". If extra information *" ; \ echo "* is required for new locales, you will also need to pass the location of *" ; \ echo "* langpack-o-matic, using \"LANGPACK_O_MATIC=/path/to/langpack-o-matic\" *" ; \ echo "****************************************************************************" ; \ echo "" ; \ rm -f debian/config/locales.shipped.old ; \ exit 1 ; \ fi rm -f debian/config/locales.shipped.old pre-auto-update-debian-control: cp debian/control debian/control.old touch debian/control.in post-auto-update-debian-control: @if ! cmp -s debian/control debian/control.old ; \ then \ echo "" ; \ echo "*************************************************************************" ; \ echo "* debian/control file is out of date. Please refresh and try again *" ; \ echo "* To refresh, run \"debian/rules debian/control\" in the source directory *" ; \ echo "*************************************************************************" ; \ echo "" ; \ rm -f debian/control.old ; \ exit 1 ; \ fi rm -f debian/control.old ifdef PATCHES_DIST CODENAME = $(PATCHES_DIST) else CODENAME = $(DISTRIB_CODENAME) endif enable-dist-patches: perl $(CURDIR)/debian/build/enable-dist-patches.pl $(CODENAME) $(CURDIR)/debian/patches/series ifeq (1, $(NO_AUTO_REFRESH_LOCALES)) clean:: post-auto-update-debian-control else clean:: auto-refresh-supported-locales post-auto-update-debian-control endif perl $(CURDIR)/debian/build/enable-dist-patches.pl --clean $(CURDIR)/debian/patches/series rm -f $(subst_files) rm -f debian/stamp-* rm -f debian/messagingmenu/*.xpi rm -f debian/eds/*.xpi rm -f debian/eds/components/*.xpt rm -rf debian/l10n-mergedirs rm -rf compare-locales rm -f debian/$(MOZ_APP_BASENAME).js