Makefile.tarball 3.1 KB

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