#!/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 := firefox MOZ_MOZDIR := # Various build defaults # 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 = 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.9.0) CAIRO_SYSTEM_BD = libcairo2-dev (>= 1.10.0), libpixman-1-dev (>= 0.19.2) SQLITE_SYSTEM_BD = libsqlite3-dev (>= 3.7.10) HUNSPELL_SYSTEM_BD = libhunspell-dev VPX_SYSTEM_BD = libvpx-dev NSS_SYSTEM_BD = libnss3-dev (>= 3.13.2) # Build-dependencies when using in-tree libraries CAIRO_TREE_BD = libxrender-dev # Additional build-dependencies EXTRA_SYSTEM_BD = \n\tlibjpeg62-dev,\n\tlibpng12-dev,\n\tzlib1g-dev,\n\tlibbz2-dev,\n\tlibevent-dev,\n\tlibffi-dev (>= 3.0.9) EXTRA_DEFAULT_BD = 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) DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) # 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) 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)/browser/config/version.txt) MOZ_LIBDIR = usr/lib/$(MOZ_APP_NAME) MOZ_INCDIR = usr/include/$(MOZ_APP_NAME) MOZ_IDLDIR = usr/share/idl/$(MOZ_APP_NAME) MOZ_SDKDIR = usr/lib/$(MOZ_APP_NAME)-devel MOZ_ADDONDIR = usr/lib/$(MOZ_APP_NAME)-addons NSPR_DEPENDS := $(NULL) NSS_DEPENDS := $(NULL) CAIRO_DEPENDS := $(NULL) DEB_AUTO_UPDATE_DEBIAN_CONTROL = no MOZ_PYTHON := $(shell which python) DISTRIB := $(shell lsb_release -i -s) 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_NO_OPTIMIZE = 1 endif ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) MOZ_NO_OPTIMIZE = 1 MOZ_DEBUG = 1 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 # powerpc sucks ifneq (,$(filter powerpc,$(DEB_HOST_ARCH))) MOZ_WANT_UNIT_TESTS = 0 endif # Ensure the crash reporter gets disabled for derivatives ifneq (Ubuntu, $(DISTRIB)) 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 = unofficial endif endif ifeq (official,$(BRANDING)) MOZ_BRANDING_OPTION = --enable-official-branding else MOZ_BRANDING_OPTION = --with-branding=$(BRANDING_DIR) endif BRANDING_DIR = browser/branding/$(BRANDING) MOZ_DISPLAY_NAME = $(shell cat $(DEB_BUILDDIR)/$(BRANDING_DIR)/locales/en-US/brand.properties \ | grep brandShortName | sed -e 's/brandShortName\=//') export LDFLAGS export DEB_BUILD_HARDENING=1 ifeq (Ubuntu, $(DISTRIB)) export MOZ_UA_VENDOR=Ubuntu endif DIST_SEARCHPLUGIN_DIR = $(MOZ_LIBDIR)/distribution/searchplugins 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 (linux-gnu, $(DEB_HOST_GNU_SYSTEM)) LANGPACK_DIR := linux-$(DEB_HOST_GNU_CPU)/xpi else LANGPACK_DIR := $(DEB_HOST_GNU_SYSTEM)-$(DEB_HOST_GNU_CPU)/xpi endif ifeq ($(MOZ_APP_BASENAME), $(MOZ_APP_NAME)) PLUGIN_BREAKS := flashplugin-installer (<= 11.2.202.233ubuntu0.10.04.1), adobe-flashplugin (<= 11.1.102.63-0lucid1) PLUGIN_CONFLICTS := gcu-plugin (<= 0.10.12-2ubuntu1), gecko-mediaplayer (<= 0.9.9.2-1ubuntu0.10.04.1), \ mozilla-gtk-vnc (<= 0.3.10-2ubuntu2.1), mozilla-opensc (<= 0.11.12-1ubuntu3.2), \ mozilla-plugin-pcmanx (<= 0.3.9-2ubuntu2), mozplugger (<= 1.13.3-1ubuntu1), \ xine-plugin (<= 1.0.2-1ubuntu2), mozilla-virt-viewer (<= 0.0.3-6ubuntu7.xul191.1) APP_CONTROL_ARGS := -Vapp:Provides="firefox-3.6, firefox-3.5, firefox-3.0, firefox-2, firefox-2-dom-inspector, firefox-2-libthai" \ -Vapp:Conflicts="firefox-3.6 (<< 3.6~hg20100117r33523), firefox-3.5 (<< 3.6~hg20100117r33523), \ firefox-3.0 (<< 3.6~hg20100117r33523), firefox-3.6-gnome-support (<< 3.6~hg20100117r33523), \ firefox-2 (<< 3), firefox-2-libthai (<< 3), firefox-2-dom-inspector (<< 3), \ abrowser (<= 4.0~b11+build3+nobinonly-0ubuntu1), abrowser-branding (<= 4.0~b11+build3+nobinonly-0ubuntu1), \ firefox-branding (<= 4.0~b11+build3+nobinonly-0ubuntu1), $(PLUGIN_CONFLICTS)" \ -Vapp:Replaces="firefox-3.6, firefox-3.5, firefox-3.0, firefox-3.6-gnome-support, firefox-2, firefox-2-libthai, \ firefox-2-dom-inspector, abrowser, abrowser-branding, firefox-branding, kubuntu-firefox-installer" \ -Vapp:Breaks="$(PLUGIN_BREAKS)" DEV_CONTROL_ARGS := -Vdev:Provides="firefox-3.6-dev, firefox-3.5-dev, firefox-3.0-dev, firefox-2-dev" \ -Vdev:Replaces="firefox-3.6-dev, firefox-3.5-dev, firefox-3.0-dev, firefox-2-dev" \ -Vdev:Conflicts="firefox-3.6-dev (<< 3.6~hg20100117r33523+nobinonly), firefox-3.5-dev (<< 3.6~hg20100117r33523), \ firefox-3.0-dev (<< 3.6~hg20100117r33523), firefox-2-dev (<< 3)" GS_CONTROL_ARGS := -Vgs:Provides="firefox-3.6-gnome-support, firefox-3.5-gnome-support, firefox-3.0-gnome-support, firefox-2" \ -Vgs:Conflicts="firefox-3.6-gnome-support (<< 3.6~hg20100117r33523+nobinonly), \ firefox-3.5-gnome-support (<< 3.6~hg20100117r33523), firefox-3.0-gnome-support (<< 3.6~hg20100117r33523), \ firefox-2 (<< 3)" \ -Vgs:Replaces="firefox-3.6-gnome-support, firefox-3.5-gnome-support, firefox-3.0-gnome-support, firefox-2-gnome-support" DBG_CONTROL_ARGS := -Vdbg:Conflicts="firefox-3.6-dbg (<< 3.6~hg20100117r33523+nobinonly), firefox-3.5-dbg (<< 3.6~hg20100117r33523), \ firefox-2-dbg (<< 3)" \ -Vdbg:Replaces="firefox-3.6-dbg, firefox-3.5-dbg, firefox-2-dbg" \ -Vdbg:Provides="firefox-3.6-dbg, firefox-3.5-dbg, firefox-2-dbg" endif DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME) := -- -Vsupport:Suggests="$(MOZ_APP_NAME)-gnome-support, kmozillahelper (>= 0.6)" $(APP_CONTROL_ARGS) DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME)-dev := -- -Vnspr:Depends=$(NSPR_DEPENDS) -Vnss:Depends=$(NSS_DEPENDS) -Vcairo:Depends=$(CAIRO_DEPENDS) $(DEV_CONTROL_ARGS) GCONF_DEPENDS := libgconf2-4 DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME)-gnome-support := -- -Vgconf:Depends="$(GCONF_DEPENDS)" $(GS_CONTROL_ARGS) ifneq (,$(DBG_CONTROL_ARGS)) DEB_DH_GENCONTROL_ARGS_$(MOZ_APP_NAME)-dbg := -- $(DBG_CONTROL_ARGS) endif # 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_OVERRIDE_SHLIBS="$(MOZ_OVERRIDE_SHLIBS)" \ -DMOZ_BRANDING_OPTION="$(MOZ_BRANDING_OPTION)" -DTOPSRCDIR="$(CURDIR)" -DDEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \ -DMOZ_ADDONDIR="$(MOZ_ADDONDIR)" -DMOZ_SDKDIR="$(MOZ_SDKDIR)" -DMOZ_DISTDIR="$(MOZ_DISTDIR)" -DMOZ_UPDATE_CHANNEL="$(CHANNEL)" \ -DMOZ_OBJDIR="$(MOZ_OBJDIR)" -DDEB_BUILDDIR="$(DEB_BUILDDIR)" -DMOZ_PYTHON="$(MOZ_PYTHON)" -DMOZ_PROFILE_PREFIX=".mozilla/" 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_DEBUG)) DEB_DEFINES += -DMOZ_DEBUG endif ifeq (official, $(BRANDING)) DEB_DEFINES += -DMOZ_OFFICIAL_BRANDING endif ifneq ($(MOZ_APP_NAME),$(MOZ_APP_BASENAME)) DEB_DEFINES += -DMOZ_APP_RENAME 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)/firefox.sh \ $(NULL) subst_files = \ debian/usr.bin.$(MOZ_APP_NAME) \ debian/README.Debian \ debian/firefox.sh \ debian/apport/blacklist \ debian/apport/native-origins \ debian/apport/source_$(MOZ_APP_NAME).py \ debian/$(MOZ_APP_NAME).desktop \ debian/$(MOZ_APP_NAME)-gnome-support.install \ debian/$(MOZ_APP_NAME).dirs \ debian/$(MOZ_APP_NAME).install \ debian/$(MOZ_APP_NAME).links \ debian/$(MOZ_APP_NAME).manpages \ debian/$(MOZ_APP_NAME).postinst \ debian/$(MOZ_APP_NAME).postrm \ debian/$(MOZ_APP_NAME).preinst \ debian/$(MOZ_APP_NAME).prerm \ debian/$(MOZ_APP_NAME).1 \ debian/$(MOZ_APP_NAME)-mozsymbols.install \ debian/$(MOZ_APP_NAME)-dev.install \ debian/$(MOZ_APP_NAME)-dev.links \ debian/$(MOZ_APP_NAME).lintian-overrides \ debian/$(MOZ_APP_NAME)-restart-required.update-notifier \ debian/config/mozconfig \ debian/$(MOZ_APP_NAME)-locale.preinst \ $(NULL) pkgconfig_files = \ debian/pkgconfig/mozilla-plugin.pc \ debian/pkgconfig/libxul.pc \ debian/pkgconfig/mozilla-nspr.pc \ $(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)/$@ %.pc: WCHAR_CFLAGS = $(shell cat $(MOZ_OBJDIR)/config/autoconf.mk | grep WCHAR_CFLAGS | sed 's/^[^=]*=[[:space:]]*\(.*\)$$/\1/') %.pc: %.pc.in debian/stamp-makefile-build $(MOZ_PYTHON) $(DEB_BUILDDIR)/$(MOZ_MOZDIR)/config/Preprocessor.py -Fsubstitution --marker="%%" $(DEB_DEFINES) -DWCHAR_CFLAGS="$(WCHAR_CFLAGS)" $(CURDIR)/$< > $(CURDIR)/$@ debian/usr.bin.firefox.in: if [ "$(DISTRIB_VERSION_MAJOR)" -ge "10" ]; then \ cp $(CURDIR)/debian/usr.bin.firefox.apparmor.10.04 $(CURDIR)/debian/usr.bin.firefox.in ; \ else \ cp $(CURDIR)/debian/usr.bin.firefox.apparmor.9.10 $(CURDIR)/debian/usr.bin.firefox.in ; \ fi make-buildsymbols: debian/stamp-makebuildsymbols debian/stamp-makebuildsymbols: 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/* make-langpack-xpis: debian/stamp-make-langpack-xpis debian/stamp-make-langpack-xpis: 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)/browser/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 $@ common-build-arch:: run-tests $(pkgconfig_files) make-langpack-xpis common-install-arch common-install-indep:: $(foreach dir,$(MOZ_LIBDIR) $(MOZ_INCDIR) $(MOZ_IDLDIR) $(MOZ_SDKDIR), \ if [ -d debian/tmp/$(dir)-$(MOZ_VERSION) ]; \ then \ mv debian/tmp/$(dir)-$(MOZ_VERSION) debian/tmp/$(dir); \ fi; ) common-binary-arch:: make-buildsymbols binary-install/$(MOZ_APP_NAME):: 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) GNOME_SUPPORT_FILES = libmozgnome.so binary-post-install/$(MOZ_APP_NAME):: $(foreach file,$(GNOME_SUPPORT_FILES),rm -fv debian/$(MOZ_APP_NAME)/$(MOZ_LIBDIR)/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-post-install-arch:: @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)/$(LANGPACK_DIR)/$(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} $(MOZ_ADDONDIR)/extensions ; \ cp $(CURDIR)/$(MOZ_DISTDIR)/$(LANGPACK_DIR)/$(MOZ_APP_NAME)-$(MOZ_VERSION).$${language}.langpack.xpi \ $(CURDIR)/debian/$(MOZ_APP_NAME)-locale-$${pkgname}/$(MOZ_ADDONDIR)/extensions/$${id}.xpi ; \ dh_installdirs -p$(MOZ_APP_NAME)-locale-$${pkgname} $(DIST_SEARCHPLUGIN_DIR)/locale/$${language} ; \ cp -r $(CURDIR)/$(MOZ_DISTDIR)/xpi-stage/locale-$${language}/searchplugins/*.xml \ $(CURDIR)/debian/$(MOZ_APP_NAME)-locale-$${pkgname}/$(DIST_SEARCHPLUGIN_DIR)/locale/$${language}/. ; \ fi \ done < $(CURDIR)/debian/config/locales.shipped common-binary-fixup-arch:: @while read line ; \ do \ line=`echo $$line | sed 's/#.*//' | sed '/^$$/d'` ; \ if [ ! -z "$$line" ] ; \ then \ pkgname=`echo $$line | sed 's/\([^:]*\):*\([^:]*\)/\2/'` ; \ cp $(CURDIR)/debian/$(MOZ_APP_NAME)-locale.preinst $(CURDIR)/debian/$(MOZ_APP_NAME)-locale-$${pkgname}.preinst ; \ fi \ done < $(CURDIR)/debian/config/locales.shipped 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 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 pre-build:: $(subst_files) # KDE integration cp $(DEB_SRCDIR)/toolkit/content/widgets/dialog.xml $(DEB_SRCDIR)/toolkit/content/widgets/dialog-kde.xml cp $(DEB_SRCDIR)/toolkit/content/widgets/preferences.xml $(DEB_SRCDIR)/toolkit/content/widgets/preferences-kde.xml cp $(DEB_SRCDIR)/browser/base/content/browser.xul $(DEB_SRCDIR)/browser/base/content/browser-kde.xul 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 ifdef PATCHES_ARCH ARCH = $(PATCHES_ARCH) else ARCH = $(DEB_HOST_ARCH) endif enable-dist-patches: perl $(CURDIR)/debian/build/enable-dist-patches.pl $(CODENAME) $(ARCH) $(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/$(MOZ_APP_NAME)-locale-*.preinst rm -f debian/usr.bin.firefox.in rm -f debian/stamp-* rm -rf debian/l10n-mergedirs rm -rf compare-locales