bug 490482, add makefile targets to repackage an deb into a localized deb, r=blassey
authorAxel Hecht <l10n@mozilla.com>
Thu, 05 Nov 2009 14:02:24 +0100
changeset 65759 456c735dcaf59c6fb9122e8ba1f517f80b3bce19
parent 65758 c6029e2f1f0d61f7a9a1c7e41e898247bee9470c
child 65760 efbc26f7c2d906cade9d24347e8743a30d57fa63
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs490482
bug 490482, add makefile targets to repackage an deb into a localized deb, r=blassey
mobile/locales/Makefile.in
--- a/mobile/locales/Makefile.in
+++ b/mobile/locales/Makefile.in
@@ -15,16 +15,17 @@
 #
 # The Initial Developer of the Original Code is
 # the Mozilla Foundation <http://www.mozilla.org/>.
 # Portions created by the Initial Developer are Copyright (C) 2007
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Mark Finkle <mfinkle@mozilla.com>
+#   Axel Hecht <l10n@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -56,16 +57,21 @@ SUBMAKEFILES += \
         $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
         $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
         $(NULL)
 
 MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox-mobile.mozilla.org
 PREF_JS_EXPORTS = $(firstword $(wildcard $(LOCALE_SRCDIR)/mobile-l10n.js) \
                        @srcdir@/en-US/mobile-l10n.js )
 
+# Shouldn't := DEB_BUILD_ARCH despite the $(shell ) as deb isn't everywhere
+DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_PKG_NAME = fennec_$(MOZ_APP_VERSION)_$(DEB_BUILD_ARCH).deb
+DATASTAGE = $(CURDIR)/data-stage
+
 SEARCH_PLUGINS = $(shell cat \
   $(firstword $(wildcard $(LOCALE_SRCDIR)/searchplugins/list.txt) \
        @srcdir@/en-US/searchplugins/list.txt ) )
 
 searchplugins::
 	@echo "$(AB_CD).jar:" > tmp-search.jar.mn
 	@for line in $(foreach plugin,$(SEARCH_PLUGINS),"locale/$(AB_CD)/browser/searchplugins/$(notdir $(plugin)).xml ($(plugin).xml)"); do \
 	    echo " $$line" >> tmp-search.jar.mn; \
@@ -145,14 +151,45 @@ endif
 # different locations that on all other platforms
 ifeq (Darwin, $(OS_ARCH))
 GECKO_PLATFORM_INI_PATH="$(STAGEDIST)/../Frameworks/XUL.framework/Versions/$(MOZILLA_VERSION)/platform.ini"
 FENNEC_APPLICATION_INI_PATH="$(STAGEDIST)/../Resources/application.ini"
 else
 GECKO_PLATFORM_INI_PATH="$(STAGEDIST)/xulrunner/platform.ini"
 FENNEC_APPLICATION_INI_PATH="$(STAGEDIST)/application.ini"
 endif
-    
+
 ident:
 	@printf "gecko_revision "
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(GECKO_PLATFORM_INI_PATH) Build SourceStamp
 	@printf "fennec_revision "
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(FENNEC_APPLICATION_INI_PATH) App SourceStamp
+
+# special targets just to do the debian single locale packages
+wget-deb:
+ifndef WGET
+	$(error Wget not installed)
+endif
+	$(WGET) -nv -N  $(EN_US_BINARY_URL)/$(DEB_PKG_NAME)
+
+$(DATASTAGE): $(DEB_PKG_NAME)
+	$(RM) -rf $(DATASTAGE)
+	$(NSINSTALL) -D $(DATASTAGE)
+	ar -p $(DEB_PKG_NAME) data.tar.gz | $(TAR) -zx -C $(DATASTAGE)
+	$(MAKE) clobber-zip AB_CD=en-US STAGEDIST=$(DATASTAGE)/$(installdir)/$(MOZ_APP_NAME)
+# XXX hack around multi-locale deb right now
+	$(RM) $(DATASTAGE)/$(installdir)/$(MOZ_APP_NAME)/chrome/??.*
+	$(RM) $(DATASTAGE)/$(installdir)/$(MOZ_APP_NAME)/chrome/??-??.*
+
+repackage-deb: $(DATASTAGE)
+	$(RM) -rf $(AB_CD)
+	$(NSINSTALL) -D $(AB_CD)
+	cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
+	  tar --exclude=install.rdf --exclude=chrome.manifest --exclude=crashreporter.app $(TAR_CREATE_FLAGS) - * | ( cd $(DATASTAGE)/$(installdir)/$(MOZ_APP_NAME) && tar -xf - )
+	$(NSINSTALL) $(DEB_PKG_NAME) $(AB_CD)
+	cd $(DATASTAGE) && $(TAR) -zcf $(CURDIR)/$(AB_CD)/data.tar.gz *
+	$(MAKE) clobber-zip STAGEDIST=$(DATASTAGE)/$(installdir)/$(MOZ_APP_NAME)
+	cd $(AB_CD) && ar -rv $(DEB_PKG_NAME) data.tar.gz
+	$(RM) $(AB_CD)/data.tar.gz
+
+deb-%: AB_CD=$*
+deb-%: clobber-% langpack-%
+	@$(MAKE) repackage-deb AB_CD=$(AB_CD)