bug 456373 - create a makefile target for packaging a source tarball, r=ted a1.9.1b2=beltzner (actual code is NPOTDB)
authorRobert Kaiser <kairo@kairo.at>
Wed, 12 Nov 2008 13:45:23 +0100
changeset 21591 c0e944ed50432c7648236e95726207b1f7a8fd5a
parent 21590 aca67792c0014398de4d8ad473324c8cb248dc19
child 21592 3eaa593394b48cad38aa5d864ba0dc9fa42e45eb
push idunknown
push userunknown
push dateunknown
reviewersted
bugs456373
milestone1.9.1b2pre
bug 456373 - create a makefile target for packaging a source tarball, r=ted a1.9.1b2=beltzner (actual code is NPOTDB)
browser/build.mk
toolkit/mozapps/installer/package-name.mk
toolkit/mozapps/installer/packager.mk
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -61,16 +61,19 @@ install::
 	@$(MAKE) -C browser/installer install
 
 clean::
 	@$(MAKE) -C browser/installer clean
 
 distclean::
 	@$(MAKE) -C browser/installer distclean
 
+source-package::
+	@$(MAKE) -C browser/installer source-package
+
 ifdef ENABLE_TESTS
 # Implemented in testing/testsuite-targets.mk
 
 # Browser tests live in a slightly different location, so we correct the path
 ifdef TEST_PATH
 BROWSER_TEST_PATH = --test-path=../browser/$(TEST_PATH)
 else
 BROWSER_TEST_PATH =
--- a/toolkit/mozapps/installer/package-name.mk
+++ b/toolkit/mozapps/installer/package-name.mk
@@ -97,16 +97,18 @@ endif
 PKG_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 PKG_PATH =
 PKG_INST_BASENAME = $(PKG_BASENAME).installer
 PKG_INST_PATH = install/sea/
 PKG_UPDATE_BASENAME = $(PKG_BASENAME)
 PKG_UPDATE_PATH = update/
 PKG_LANGPACK_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).langpack
 PKG_LANGPACK_PATH = install/
+PKG_SRCPACK_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).source
+PKG_SRCPACK_PATH =
 
 else # "pretty" release package names
 
 ifndef MOZ_PKG_APPNAME
 MOZ_PKG_APPNAME = $(MOZ_APP_DISPLAYNAME)
 endif
 MOZ_PKG_APPNAME_LC = $(shell echo $(MOZ_PKG_APPNAME) | tr '[A-Z]' '[a-z]')
 
@@ -131,10 +133,12 @@ PKG_INST_BASENAME = $(MOZ_PKG_APPNAME_LC
 endif
 endif
 PKG_PATH = $(MOZ_PKG_PLATFORM)/$(AB_CD)/
 PKG_INST_PATH = $(PKG_PATH)
 PKG_UPDATE_BASENAME = $(MOZ_PKG_APPNAME_LC)-$(MOZ_PKG_VERSION)
 PKG_UPDATE_PATH = update/$(PKG_PATH)
 PKG_LANGPACK_BASENAME = $(AB_CD)
 PKG_LANGPACK_PATH = langpack/
+PKG_SRCPACK_BASENAME = $(MOZ_PKG_APPNAME_LC)-$(MOZ_PKG_VERSION).source
+PKG_SRCPACK_PATH = source/
 
 endif # MOZ_PKG_PRETTYNAMES
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -474,8 +474,21 @@ make-sdk:
 	$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/idl
 	(cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \
 	  (cd $(DIST)/$(MOZ_APP_NAME)-sdk/idl && tar -xf -)
 	$(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/lib
 # sdk/lib is the same as sdk/sdk/lib
 	(cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | \
 	  (cd $(DIST)/$(MOZ_APP_NAME)-sdk/lib && tar -xf -)
 	cd $(DIST) && $(MAKE_SDK)
+
+ifndef MOZ_PKG_SRCDIR
+MOZ_PKG_SRCDIR = $(topsrcdir)
+endif
+
+CREATE_SOURCE_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
+  --mode="go-w" --exclude=".hg*" --exclude="CVS" --exclude=".cvs*" -f
+
+# source-package creates a source tarball from the files in MOZ_PKG_SRCDIR,
+# which is either set to a clean checkout or defaults to $topsrcdir
+source-package:
+	@echo "Packaging source tarball..."
+	(cd $(MOZ_PKG_SRCDIR) && $(CREATE_SOURCE_TAR) - .) | bzip2 -vf > $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_SRCPACK_BASENAME).tar.bz2