Makefile.tarball 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # <<<< DEV ONLY
  18. PROD_INCLUDES := \
  19. apps \
  20. desktop \
  21. example-hadoop-confs \
  22. ext/thirdparty \
  23. LICENSE.txt \
  24. Makefile* \
  25. tools/app_reg \
  26. tools/virtual-bootstrap \
  27. VERSION_DATA
  28. PROD_EXCLUDES := \
  29. Makefile.tarball \
  30. desktop/apps/jframegallery \
  31. desktop/apps/beeswax \
  32. desktop/conf \
  33. desktop/desktop.db \
  34. desktop/apps/hello \
  35. desktop/apps/visualizer \
  36. desktop/devtools.mk \
  37. ext/thirdparty/README.md \
  38. ext/thirdparty/js/manifest.json
  39. # Macro to remove things we don't want to package
  40. define remove_devtree_exclusions
  41. @find $(1) \( -name '.git' -o \
  42. -name '.gitignore' -o \
  43. -name '.*~' -o \
  44. -name '.#*' -o \
  45. -name '.pylintrc' -o \
  46. -name 'tags' -o \
  47. -name 'desktop.db' -o \
  48. -name 'app.reg' -o \
  49. -name '*.py[co]' -o \
  50. -name '.*.sw?' \) -prune -exec rm -rf {} \;
  51. endef
  52. ###################################
  53. # Packaging for production release
  54. ###################################
  55. # Make a tarball
  56. .PHONY: prod
  57. prod: $(BLD_DIR_PROD_TGZ)
  58. $(BLD_DIR_PROD_TGZ): $(BLD_DIR_PROD)
  59. @tar -C $(BLD_DIR_PROD)/.. -czf $(BLD_DIR_PROD_TGZ) hue-$(DESKTOP_VERSION)
  60. @echo "--- Generated $(BLD_DIR_PROD_TGZ)"
  61. .PHONY: $(BLD_DIR_PROD)
  62. $(BLD_DIR_PROD): crepo docs
  63. @echo "--- Preparing general distribution tree at $@"
  64. @rm -rf $@
  65. @mkdir -p $@
  66. tar -cf - $(PROD_INCLUDES) | tar -C $(BLD_DIR_PROD) -xf -
  67. @echo "---- Removing exclusions"
  68. @for i in $(PROD_EXCLUDES) ; do rm -rf $(BLD_DIR_PROD)/$$i ; done
  69. $(call remove_devtree_exclusions,$(BLD_DIR_PROD))
  70. @echo "---- Copying misc files"
  71. @cp $(ROOT)/dist/* $(BLD_DIR_PROD)
  72. @mv $(BLD_DIR_PROD)/desktop/conf{.dist,}
  73. cp -r $(BLD_DIR_DOC) $(BLD_DIR_PROD)/docs
  74. @echo "---- Stripping Makefiles"
  75. @$(call STRIP_DEV, $(ROOT)/Makefile, $(BLD_DIR_PROD)/Makefile)
  76. @$(call STRIP_DEV, $(ROOT)/Makefile.vars.priv, $(BLD_DIR_PROD)/Makefile.vars.priv)
  77. @$(call STRIP_DEV, $(APPS_DIR)/Makefile, $(BLD_DIR_PROD)/apps/Makefile)
  78. @$(call STRIP_DEV, $(DESKTOP_DIR)/Makefile, $(BLD_DIR_PROD)/desktop/Makefile)
  79. @cd $(BLD_DIR_PROD) && make distclean
  80. # END DEV ONLY >>>>