Makefile.tarball 3.2 KB

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