Makefile.tarball 2.8 KB

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