Bug 510770 - Add a source-package target for XR; exclude some transient files from the source-package - r=ted,a=dveditz
authorChris Cooper <ccooper@deadsquid.com>
Thu, 12 May 2011 10:55:18 -0400
changeset 27409 b5e3b71282de22ab2c4c2d4041d8bd1d3f1eb21b
parent 27408 ce0dd43871e2f8e1868ecc39f48b701a2a597a2a
child 27410 8f8185f5888102a4cad7172fd138f36fd4686393
push id2723
push usercoop@mozilla.com
push dateThu, 12 May 2011 14:56:15 +0000
reviewersted, dveditz
bugs510770
milestone1.9.1.20pre
Bug 510770 - Add a source-package target for XR; exclude some transient files from the source-package - r=ted,a=dveditz
toolkit/mozapps/installer/packager.mk
xulrunner/build.mk
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -543,16 +543,29 @@ upload:
 		$(call QUOTED_WILDCARD,$(DIST)/$(SDK)) \
 		$(call QUOTED_WILDCARD,$(MOZ_SOURCESTAMP_FILE)) \
 		$(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f))))
 
 ifndef MOZ_PKG_SRCDIR
 MOZ_PKG_SRCDIR = $(topsrcdir)
 endif
 
+DIR_TO_BE_PACKAGED ?= ../$(notdir $(topsrcdir))
+SRC_TAR_EXCLUDE_PATHS += \
+  --exclude=".hg*" \
+  --exclude="CVS" \
+  --exclude=".cvs*" \
+  --exclude=".mozconfig*" \
+  --exclude="*.pyc" \
+  --exclude="$(MOZILLA_DIR)/Makefile" \
+  --exclude="$(MOZILLA_DIR)/dist"
+ifdef MOZ_OBJDIR
+SRC_TAR_EXCLUDE_PATHS += --exclude="$(MOZ_OBJDIR)"
+endif
 CREATE_SOURCE_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
-  --mode="go-w" --exclude=".hg*" --exclude="CVS" --exclude=".cvs*" -f
+  --mode="go-w" $(SRC_TAR_EXCLUDE_PATHS) -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
+	mkdir -p $(DIST)/$(PKG_SRCPACK_PATH)
+	(cd $(MOZ_PKG_SRCDIR) && $(CREATE_SOURCE_TAR) - $(DIR_TO_BE_PACKAGED)) | bzip2 -vf > $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_SRCPACK_BASENAME).tar.bz2
--- a/xulrunner/build.mk
+++ b/xulrunner/build.mk
@@ -78,15 +78,18 @@ install:
 	@$(MAKE) -C xulrunner/installer install
 
 sdk:
 	@$(MAKE) -C xulrunner/installer make-sdk
 
 distclean::
 	@$(MAKE) -C xulrunner/installer distclean
 
+source-package::
+	@$(MAKE) -C xulrunner/installer source-package
+
 upload::
 	@$(MAKE) -C xulrunner/installer upload
 
 ifeq ($(OS_TARGET),Linux)
 deb: package
 	@$(MAKE) -C xulrunner/installer deb
 endif