Makefile.tarball 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. ext/thirdparty \
  22. LICENSE.txt \
  23. NOTICE.txt \
  24. Makefile* \
  25. maven \
  26. tools/app_reg \
  27. tools/virtual-bootstrap \
  28. tools/relocatable.sh \
  29. VERSION
  30. # Check for things in BDIST_EXCLUDES in various apps
  31. PROD_EXCLUDES := \
  32. apps/beeswax/thrift \
  33. apps/hello \
  34. apps/jframegallery \
  35. build \
  36. desktop/conf \
  37. desktop/desktop.db \
  38. desktop/devtools.mk \
  39. desktop/libs/hadoop/regenerate-thrift.sh \
  40. ext/thirdparty/js/manifest.json \
  41. Makefile.tarball
  42. # Macro to remove things we don't want to package
  43. define remove_devtree_exclusions
  44. @find $(1) \( -name '.git' -o \
  45. -name '.gitignore' -o \
  46. -name '.*~' -o \
  47. -name '.#*' -o \
  48. -name '.pylintrc' -o \
  49. -name 'build' -o \
  50. -name 'logs' -o \
  51. -name 'tags' -o \
  52. -name 'target' -o \
  53. -name 'desktop.db' -o \
  54. -name 'app.reg' -o \
  55. -name '*.py[co]' -o \
  56. -name '.*.sw?' \) -prune -exec rm -rf {} \;
  57. endef
  58. ###################################
  59. # Packaging for production release
  60. ###################################
  61. # Make a tarball
  62. .PHONY: prod
  63. prod: $(BLD_DIR_PROD_TGZ)
  64. $(BLD_DIR_PROD_TGZ): $(BLD_DIR_PROD)
  65. @tar -C $(BLD_DIR_PROD)/.. -czf $(BLD_DIR_PROD_TGZ) hue-$(DESKTOP_VERSION)
  66. @echo "--- Generated $(BLD_DIR_PROD_TGZ)"
  67. .PHONY: $(BLD_DIR_PROD)
  68. $(BLD_DIR_PROD): apps docs locales
  69. @echo "--- Preparing general distribution tree at $@"
  70. @rm -rf $@
  71. @mkdir -p $@
  72. tar -cf - $(PROD_INCLUDES) | tar -C $(BLD_DIR_PROD) -xf -
  73. @echo "---- Removing exclusions"
  74. @for i in $(PROD_EXCLUDES) ; do rm -rf $(BLD_DIR_PROD)/$$i ; done
  75. $(call remove_devtree_exclusions,$(BLD_DIR_PROD))
  76. @echo "---- Copying misc files"
  77. @cp $(ROOT)/dist/* $(BLD_DIR_PROD)
  78. @mv $(BLD_DIR_PROD)/desktop/conf{.dist,}
  79. cp -r $(BLD_DIR_DOC) $(BLD_DIR_PROD)/docs
  80. @echo "---- Stripping Makefiles"
  81. @$(call STRIP_DEV, $(ROOT)/Makefile, $(BLD_DIR_PROD)/Makefile)
  82. @$(call STRIP_DEV, $(ROOT)/Makefile.vars.priv, $(BLD_DIR_PROD)/Makefile.vars.priv)
  83. @$(call STRIP_DEV, $(APPS_DIR)/Makefile, $(BLD_DIR_PROD)/apps/Makefile)
  84. @$(call STRIP_DEV, $(DESKTOP_DIR)/Makefile, $(BLD_DIR_PROD)/desktop/Makefile)
  85. @echo "---- Removing build directories"
  86. find $(BLD_DIR_PROD) -name build -prune -exec rm -rf {} \;
  87. @$(MAKE) -C $(BLD_DIR_PROD) ext-clean
  88. # END DEV ONLY >>>>