Makefile.tarball 3.2 KB

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