-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy pathMakefile.tarball
More file actions
136 lines (120 loc) · 4.61 KB
/
Makefile.tarball
File metadata and controls
136 lines (120 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# <<<< DEV ONLY
# Extended packaging rules to support Python version-specific virtualenv outputs.
PROD_INCLUDES := \
apps \
desktop \
ext/thirdparty \
LICENSE.txt \
NOTICE.txt \
Makefile* \
maven \
build \
app.reg \
desktop/conf \
desktop/desktop.db \
tools/app_reg \
tools/virtual-bootstrap \
tools/relocatable.py \
tools/load-balancer \
tools/scripts \
VERSION \
webpack-stats*.json \
package.json \
package-lock.json \
webpack.config*.js \
babel.config.js \
tsconfig.json
# Check for things in BDIST_EXCLUDES in various apps
# Excludes more dev-only content and handles packaging across architectures.
PROD_EXCLUDES := \
apps/beeswax/thrift \
apps/hello \
apps/jframegallery \
desktop/core/regenerate_thrift.sh \
desktop/core/ext-py3 \
desktop/devtools.mk \
desktop/libs/hadoop/regenerate-thrift.sh \
ext/thirdparty/js/manifest.json \
Makefile.tarball
# Macro to remove things we don't want to package
define remove_devtree_exclusions
@find $(1) \( -name '.git' -o \
-name '.gitignore' -o \
-name '.*~' -o \
-name '.#*' -o \
-name '.pylintrc' -o \
-name 'logs' -o \
-name 'tags' -o \
-name 'target' -o \
-name '.*.sw?' \) -not -path '*/boto/*' -prune -exec rm -rf {} \;
endef
###################################
# Packaging for production release
###################################
.PHONY: release
release:
@echo "--- Preparing general distribution tree at $@"
@rm -rf $(BLD_DIR_PROD) $(BLD_DIR_PROD_TGZ)
@mkdir -p $(BLD_DIR_PROD)
@tar --exclude="build/release" -chf - $(PROD_INCLUDES) | tar -C $(BLD_DIR_PROD) -xf -
@echo "---- Removing exclusions"
@for i in $(PROD_EXCLUDES) ; do rm -rf $(BLD_DIR_PROD)/$$i ; done
@echo "---- Removing *.py[co] files"
@find $(BLD_DIR_PROD) -iname \*.py[co] -exec rm -f {} \;
@echo "---- Performing remove_devtree_exclusions"
$(call remove_devtree_exclusions,$(BLD_DIR_PROD))
@echo "---- Copying misc files"
@cp $(ROOT)/dist/* $(BLD_DIR_PROD)
@mv $(BLD_DIR_PROD)/desktop/conf{.dist,}
@cp -r $(BLD_DIR_DOC) $(BLD_DIR_PROD)/docs
@echo "---- Stripping Makefiles"
@$(call STRIP_DEV, $(ROOT)/Makefile, $(BLD_DIR_PROD)/Makefile)
@$(call STRIP_DEV, $(ROOT)/Makefile.vars.priv, $(BLD_DIR_PROD)/Makefile.vars.priv)
@$(call STRIP_DEV, $(APPS_DIR)/Makefile, $(BLD_DIR_PROD)/apps/Makefile)
@$(call STRIP_DEV, $(DESKTOP_DIR)/Makefile, $(BLD_DIR_PROD)/desktop/Makefile)
@tar --exclude="build/release" -C $(BLD_DIR_PROD)/.. -chzf $(BLD_DIR_PROD_TGZ) hue-$(DESKTOP_VERSION)
@echo "---- $(BLD_DIR_PROD_TGZ)"
# Make a tarball
.PHONY: prod
prod: $(BLD_DIR_PROD_TGZ)
$(BLD_DIR_PROD_TGZ): $(BLD_DIR_PROD)
@tar --exclude="python" --exclude="build/release/prod" -C $(BLD_DIR_PROD)/.. -czf $(BLD_DIR_PROD_TGZ) hue-$(DESKTOP_VERSION)
@echo "--- Generated $(BLD_DIR_PROD_TGZ)"
.PHONY: $(BLD_DIR_PROD)
$(BLD_DIR_PROD): apps docs locales
@echo "--- Preparing general distribution tree at $@"
@rm -rf $@
@mkdir -p $@
tar --exclude="python" --exclude="build/release/prod" -cf - $(PROD_INCLUDES) | tar -C $(BLD_DIR_PROD) -xf -
@echo "---- Removing exclusions"
@for i in $(PROD_EXCLUDES) ; do rm -rf $(BLD_DIR_PROD)/$$i ; done
$(call remove_devtree_exclusions,$(BLD_DIR_PROD))
@echo "---- Copying misc files"
@cp $(ROOT)/dist/* $(BLD_DIR_PROD)
@mv $(BLD_DIR_PROD)/desktop/conf{.dist,}
cp -r $(BLD_DIR_DOC) $(BLD_DIR_PROD)/docs
@echo "---- Stripping Makefiles"
@$(call STRIP_DEV, $(ROOT)/Makefile, $(BLD_DIR_PROD)/Makefile)
@$(call STRIP_DEV, $(ROOT)/Makefile.vars.priv, $(BLD_DIR_PROD)/Makefile.vars.priv)
@$(call STRIP_DEV, $(APPS_DIR)/Makefile, $(BLD_DIR_PROD)/apps/Makefile)
@$(call STRIP_DEV, $(DESKTOP_DIR)/Makefile, $(BLD_DIR_PROD)/desktop/Makefile)
@echo "---- Removing build directories"
find $(BLD_DIR_PROD) -name build -prune -exec rm -rf {} \;
@PYTHON_VER=$(PYTHON_VER) ENV_PYTHON=$(ENV_PYTHON) VIRTUAL_ENV=$(BLD_DIR_ENV) $(MAKE) -C $(BLD_DIR_PROD) ext-clean
# END DEV ONLY >>>>