Bug 510770 - Add a source-package target for XR; exclude some transient files from the source package - r=ted
authorChris Cooper <ccooper@deadsquid.com>
Wed, 23 Mar 2011 15:01:28 -0400
changeset 63557 7e1308fc3b70b9ac4612f453d49effea67d22c08
parent 63556 c2f9c8bad8af40d60ce4af7ea0882c63f5181464
child 63558 63f173e21fd1ee205be00134bb1a9b607bcb3de5
push idunknown
push userunknown
push dateunknown
reviewersted
bugs510770
milestone2.2a1pre
Bug 510770 - Add a source-package target for XR; exclude some transient files from the source package - r=ted
toolkit/mozapps/installer/packager.mk
xulrunner/build.mk
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -720,16 +720,29 @@ upload: checksum
 	$(PYTHON) $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) \
 		$(UPLOAD_FILES) \
 		$(CHECKSUM_FILE)
 
 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