| 
									
										
										
										
											2016-09-23 16:45:08 +08:00
										 |  |  | PROJECT = rabbitmq_server_release | 
					
						
							| 
									
										
										
										
											2016-12-06 02:34:50 +08:00
										 |  |  | PROJECT_DESCRIPTION = RabbitMQ Server | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 20:37:00 +08:00
										 |  |  | # Propagate PROJECT_VERSION (from the command line or environment) to
 | 
					
						
							|  |  |  | # other components. If PROJECT_VERSION is unset, then an empty variable
 | 
					
						
							|  |  |  | # is propagated and the default version will fallback to the default
 | 
					
						
							|  |  |  | # value from rabbitmq-components.mk.
 | 
					
						
							| 
									
										
										
										
											2016-12-09 02:02:49 +08:00
										 |  |  | export RABBITMQ_VERSION = $(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Release artifacts are put in $(PACKAGES_DIR).
 | 
					
						
							|  |  |  | PACKAGES_DIR ?= $(abspath PACKAGES) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # List of plugins to include in a RabbitMQ release.
 | 
					
						
							| 
									
										
										
										
											2016-12-07 18:20:41 +08:00
										 |  |  | include plugins.mk | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-07 18:30:12 +08:00
										 |  |  | DEPS = rabbit_common rabbit $(PLUGINS) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-01 00:35:48 +08:00
										 |  |  | DEP_PLUGINS = rabbit_common/mk/rabbitmq-dist.mk \
 | 
					
						
							|  |  |  | 	      rabbit_common/mk/rabbitmq-run.mk \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	      rabbit_common/mk/rabbitmq-tools.mk | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
 | 
					
						
							|  |  |  | # reviewed and merged.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git | 
					
						
							|  |  |  | ERLANG_MK_COMMIT = rabbitmq-tmp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-20 23:52:22 +08:00
										 |  |  | ifneq ($(wildcard deps/.hex/cache.erl),) | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | deps:: restore-hex-cache-ets-file | 
					
						
							| 
									
										
										
										
											2018-12-20 23:52:22 +08:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | include rabbitmq-components.mk | 
					
						
							|  |  |  | include erlang.mk | 
					
						
							| 
									
										
										
										
											2019-01-28 17:23:43 +08:00
										 |  |  | include stats.mk | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Mix Hex cache management.
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # We restore the initial Hex cache.ets file from an Erlang term created
 | 
					
						
							|  |  |  | # at the time the source archive was prepared.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # See the `$(SOURCE_DIST)` recipe for the reason behind this step.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | restore-hex-cache-ets-file: deps/.hex/cache.ets | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | deps/.hex/cache.ets: deps/.hex/cache.erl | 
					
						
							|  |  |  | 	$(gen_verbose) $(call erlang,$(call restore_hex_cache_from_erl_term,$<,$@)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | define restore_hex_cache_from_erl_term | 
					
						
							|  |  |  |   In = "$(1)", | 
					
						
							|  |  |  |   Out = "$(2)", | 
					
						
							|  |  |  |   {ok, [Props, Entries]} = file:consult(In), | 
					
						
							|  |  |  |   Name = proplists:get_value(name, Props), | 
					
						
							|  |  |  |   Type = proplists:get_value(type, Props), | 
					
						
							|  |  |  |   Access = proplists:get_value(protection, Props), | 
					
						
							|  |  |  |   NamedTable = proplists:get_bool(named_table, Props), | 
					
						
							|  |  |  |   Keypos = proplists:get_value(keypos, Props), | 
					
						
							|  |  |  |   Heir = proplists:get_value(heir, Props), | 
					
						
							|  |  |  |   ReadConc = proplists:get_bool(read_concurrency, Props), | 
					
						
							|  |  |  |   WriteConc = proplists:get_bool(write_concurrency, Props), | 
					
						
							|  |  |  |   Compressed = proplists:get_bool(compressed, Props), | 
					
						
							|  |  |  |   Options0 = [ | 
					
						
							|  |  |  |     Type, | 
					
						
							|  |  |  |     Access, | 
					
						
							|  |  |  |     {keypos, Keypos}, | 
					
						
							|  |  |  |     {heir, Heir}, | 
					
						
							|  |  |  |     {read_concurrency, ReadConc}, | 
					
						
							|  |  |  |     {write_concurrency, WriteConc}], | 
					
						
							|  |  |  |   Options1 = case NamedTable of | 
					
						
							|  |  |  |     true  -> [named_table | Options0]; | 
					
						
							|  |  |  |     false -> Options0 | 
					
						
							|  |  |  |   end, | 
					
						
							|  |  |  |   Options2 = case Compressed of | 
					
						
							|  |  |  |     true  -> [compressed | Options0]; | 
					
						
							|  |  |  |     false -> Options0 | 
					
						
							|  |  |  |   end, | 
					
						
							|  |  |  |   Tab = ets:new(Name, Options2), | 
					
						
							|  |  |  |   [true = ets:insert(Tab, Entry) || Entry <- Entries], | 
					
						
							|  |  |  |   ok = ets:tab2file(Tab, Out), | 
					
						
							|  |  |  |   init:stop(). | 
					
						
							|  |  |  | endef | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Distribution.
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: source-dist clean-source-dist | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SOURCE_DIST_BASE ?= rabbitmq-server | 
					
						
							| 
									
										
										
										
											2018-10-01 22:26:18 +08:00
										 |  |  | SOURCE_DIST_SUFFIXES ?= tar.xz | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # The first source distribution file is used by packages: if the archive
 | 
					
						
							|  |  |  | # type changes, you must update all packages' Makefile.
 | 
					
						
							|  |  |  | SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: $(SOURCE_DIST_FILES) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | source-dist: $(SOURCE_DIST_FILES) | 
					
						
							|  |  |  | 	@: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RSYNC ?= rsync | 
					
						
							|  |  |  | RSYNC_V_0 = | 
					
						
							|  |  |  | RSYNC_V_1 = -v | 
					
						
							|  |  |  | RSYNC_V_2 = -v | 
					
						
							|  |  |  | RSYNC_V = $(RSYNC_V_$(V)) | 
					
						
							|  |  |  | RSYNC_FLAGS += -a $(RSYNC_V)		\
 | 
					
						
							|  |  |  | 	       --exclude '.sw?' --exclude '.*.sw?'	\
 | 
					
						
							|  |  |  | 	       --exclude '*.beam'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:34:18 +08:00
										 |  |  | 	       --exclude '*.d'				\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '*.pyc'			\
 | 
					
						
							|  |  |  | 	       --exclude '.git*'			\
 | 
					
						
							|  |  |  | 	       --exclude '.hg*'				\
 | 
					
						
							|  |  |  | 	       --exclude '.travis.yml'			\
 | 
					
						
							|  |  |  | 	       --exclude '.*.plt'			\
 | 
					
						
							|  |  |  | 	       --exclude '$(notdir $(ERLANG_MK_TMP))'	\
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:08 +08:00
										 |  |  | 	       --exclude '_build/'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude 'cover/'			\
 | 
					
						
							|  |  |  | 	       --exclude 'deps/'			\
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 	       --exclude 'doc/'				\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 15:35:55 +08:00
										 |  |  | 	       --exclude 'ebin/'			\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'erl_crash.dump'		\
 | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:36 +08:00
										 |  |  | 	       --exclude 'escript/'			\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'MnesiaCore.*'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '$(notdir $(DEPS_DIR))/'	\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'hexer*'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 15:35:55 +08:00
										 |  |  | 	       --exclude 'logs/'			\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'packaging'			\
 | 
					
						
							| 
									
										
										
										
											2016-10-29 00:59:59 +08:00
										 |  |  | 	       --exclude '/plugins/'			\
 | 
					
						
							|  |  |  | 	       --include 'cli/plugins'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '$(notdir $(DIST_DIR))/'	\
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:34:18 +08:00
										 |  |  | 	       --exclude 'test'				\
 | 
					
						
							|  |  |  | 	       --exclude 'xrefr'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/$(notdir $(PACKAGES_DIR))/'	\
 | 
					
						
							|  |  |  | 	       --exclude '/PACKAGES/'			\
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:08 +08:00
										 |  |  | 	       --exclude '/amqp_client/doc/'		\
 | 
					
						
							|  |  |  | 	       --exclude '/amqp_client/rebar.config'	\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/cowboy/doc/'			\
 | 
					
						
							|  |  |  | 	       --exclude '/cowboy/examples/'		\
 | 
					
						
							| 
									
										
										
										
											2017-03-07 01:05:29 +08:00
										 |  |  | 	       --exclude '/rabbit/escript/'		\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/rabbitmq_amqp1_0/test/swiftmq/build/'\
 | 
					
						
							|  |  |  | 	       --exclude '/rabbitmq_amqp1_0/test/swiftmq/swiftmq*'\
 | 
					
						
							| 
									
										
										
										
											2017-03-07 01:05:29 +08:00
										 |  |  | 	       --exclude '/rabbitmq_cli/escript/'	\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/rabbitmq_mqtt/test/build/'	\
 | 
					
						
							|  |  |  | 	       --exclude '/rabbitmq_mqtt/test/test_client/'\
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:08 +08:00
										 |  |  | 	       --exclude '/ranch/doc/'			\
 | 
					
						
							|  |  |  | 	       --exclude '/ranch/examples/'		\
 | 
					
						
							|  |  |  | 	       --exclude '/sockjs/examples/'		\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --delete					\
 | 
					
						
							|  |  |  | 	       --delete-excluded | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TAR ?= tar | 
					
						
							|  |  |  | TAR_V_0 = | 
					
						
							|  |  |  | TAR_V_1 = -v | 
					
						
							|  |  |  | TAR_V_2 = -v | 
					
						
							|  |  |  | TAR_V = $(TAR_V_$(V)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GZIP ?= gzip | 
					
						
							|  |  |  | BZIP2 ?= bzip2 | 
					
						
							|  |  |  | XZ ?= xz | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ZIP ?= zip | 
					
						
							|  |  |  | ZIP_V_0 = -q | 
					
						
							|  |  |  | ZIP_V_1 = | 
					
						
							|  |  |  | ZIP_V_2 = | 
					
						
							|  |  |  | ZIP_V = $(ZIP_V_$(V)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 15:35:55 +08:00
										 |  |  | .PHONY: $(SOURCE_DIST) | 
					
						
							| 
									
										
										
										
											2017-01-18 17:55:18 +08:00
										 |  |  | .PHONY: clean-source-dist distclean-packages clean-unpacked-source-dist | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | $(SOURCE_DIST): $(ERLANG_MK_RECURSIVE_DEPS_LIST) | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(dir $@) | 
					
						
							| 
									
										
										
										
											2016-09-21 18:22:00 +08:00
										 |  |  | 	$(gen_verbose) $(RSYNC) $(RSYNC_FLAGS) ./ $@/ | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 	$(verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > "$@/git-revisions.txt" | 
					
						
							|  |  |  | 	$(verbose) echo "$(PROJECT) $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> "$@/git-revisions.txt" | 
					
						
							| 
									
										
										
										
											2018-12-20 21:20:07 +08:00
										 |  |  | 	$(verbose) echo "$$(TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > "$@.git-times.txt" | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(verbose) cat packaging/common/LICENSE.head > $@/LICENSE | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $@/deps/licensing | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 	$(verbose) set -e; for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(RSYNC) $(RSYNC_FLAGS) \
 | 
					
						
							|  |  |  | 		 $$dep \
 | 
					
						
							|  |  |  | 		 $@/deps; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		rm -f \
 | 
					
						
							|  |  |  | 		 $@/deps/rabbit_common/rebar.config \
 | 
					
						
							|  |  |  | 		 $@/deps/rabbit_common/rebar.lock; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		if test -f $@/deps/$$(basename $$dep)/erlang.mk && \
 | 
					
						
							|  |  |  | 		   test "$$(wc -l $@/deps/$$(basename $$dep)/erlang.mk | awk '{print $$1;}')" = "1" && \
 | 
					
						
							|  |  |  | 		   grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$" $@/deps/$$(basename $$dep)/erlang.mk; then \
 | 
					
						
							|  |  |  | 			echo "include ../../erlang.mk" > $@/deps/$$(basename $$dep)/erlang.mk; \
 | 
					
						
							|  |  |  | 		fi; \
 | 
					
						
							|  |  |  | 		sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$|include ../../erlang.mk|" \
 | 
					
						
							|  |  |  | 		 $@/deps/$$(basename $$dep)/Makefile && \
 | 
					
						
							|  |  |  | 		rm $@/deps/$$(basename $$dep)/Makefile.bak; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		mix_exs=$@/deps/$$(basename $$dep)/mix.exs; \
 | 
					
						
							|  |  |  | 		if test -f $$mix_exs; then \
 | 
					
						
							|  |  |  | 			(cd $$(dirname "$$mix_exs") && \
 | 
					
						
							| 
									
										
										
										
											2017-12-11 18:26:15 +08:00
										 |  |  | 			 env DEPS_DIR=$@/deps HOME=$@/deps MIX_ENV=prod FILL_HEX_CACHE=yes mix local.hex --force && \
 | 
					
						
							| 
									
										
										
										
											2018-04-19 22:02:42 +08:00
										 |  |  | 			 env DEPS_DIR=$@/deps HOME=$@/deps MIX_ENV=prod FILL_HEX_CACHE=yes mix deps.get --only prod && \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 			 cp $(DEPS_DIR)/rabbit_common/mk/rabbitmq-mix.mk . && \
 | 
					
						
							|  |  |  | 			 rm -rf _build deps); \
 | 
					
						
							|  |  |  | 		fi; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		if test -f "$$dep/license_info"; then \
 | 
					
						
							|  |  |  | 			cp "$$dep/license_info" "$@/deps/licensing/license_info_$$(basename "$$dep")"; \
 | 
					
						
							|  |  |  | 			cat "$$dep/license_info" >> $@/LICENSE; \
 | 
					
						
							|  |  |  | 		fi; \
 | 
					
						
							|  |  |  | 		find "$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $@/deps/licensing \; ; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		(cd $$dep; \
 | 
					
						
							|  |  |  | 		 echo "$$(basename "$$dep") $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		 >> "$@/git-revisions.txt"; \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 21:21:20 +08:00
										 |  |  | 		! test -d $$dep/.git || (cd $$dep; \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		 echo "$$(env TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
 | 
					
						
							|  |  |  | 		 >> "$@.git-times.txt"; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	done | 
					
						
							|  |  |  | 	$(verbose) cat packaging/common/LICENSE.tail >> $@/LICENSE | 
					
						
							|  |  |  | 	$(verbose) find $@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $@ \; | 
					
						
							|  |  |  | 	$(verbose) for file in $$(find $@ -name '*.app.src'); do \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		sed -E -i.bak \
 | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | 		  -e 's/[{]vsn[[:blank:]]*,[[:blank:]]*(""|"0.0.0")[[:blank:]]*}/{vsn, "$(PROJECT_VERSION)"}/' \
 | 
					
						
							| 
									
										
										
										
											2016-12-06 01:14:25 +08:00
										 |  |  | 		  -e 's/[{]broker_version_requirements[[:blank:]]*,[[:blank:]]*\[\][[:blank:]]*}/{broker_version_requirements, ["$(PROJECT_VERSION)"]}/' \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		  $$file; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		rm $$file.bak; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2016-12-07 19:18:37 +08:00
										 |  |  | 	$(verbose) echo "PLUGINS := $(PLUGINS)" > $@/plugins.mk | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | # Remember the latest Git timestamp.
 | 
					
						
							|  |  |  | 	$(verbose) sort -r < "$@.git-times.txt" | head -n 1 > "$@.git-time.txt" | 
					
						
							|  |  |  | # Mix Hex component requires a cache file, otherwise it refuses to build
 | 
					
						
							|  |  |  | # offline... That cache is an ETS table with all the applications we
 | 
					
						
							|  |  |  | # depend on, plus some versioning informations and checksums. There
 | 
					
						
							|  |  |  | # are two problems with that: the table contains a date (`last_update`
 | 
					
						
							|  |  |  | # field) and `ets:tab2file()` produces a different file each time it's
 | 
					
						
							|  |  |  | # called.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # To make our source archive reproducible, we fix the time of the
 | 
					
						
							|  |  |  | # `last_update` field to the last Git commit and dump the content of the
 | 
					
						
							|  |  |  | # table as an Erlang term to a text file.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # The ETS file must be recreated before compiling RabbitMQ. See the
 | 
					
						
							|  |  |  | # `restore-hex-cache-ets-file` Make target.
 | 
					
						
							|  |  |  | 	$(verbose) $(call erlang,$(call dump_hex_cache_to_erl_term,$@,$@.git-time.txt)) | 
					
						
							|  |  |  | # Fix file timestamps to have reproducible source archives.
 | 
					
						
							|  |  |  | 	$(verbose) find $@ -print0 | xargs -0 touch -t "$$(cat "$@.git-time.txt")" | 
					
						
							| 
									
										
										
										
											2018-12-20 21:21:47 +08:00
										 |  |  | 	$(verbose) rm "$@.git-times.txt" "$@.git-time.txt" | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | define dump_hex_cache_to_erl_term | 
					
						
							|  |  |  |   In = "$(1)/deps/.hex/cache.ets", | 
					
						
							|  |  |  |   Out = "$(1)/deps/.hex/cache.erl", | 
					
						
							|  |  |  |   {ok, DateStr} = file:read_file("$(2)"), | 
					
						
							|  |  |  |   {match, Date} = re:run(DateStr, | 
					
						
							|  |  |  |     "^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})\.([0-9]{2})", | 
					
						
							|  |  |  |     [{capture, all_but_first, list}]), | 
					
						
							|  |  |  |   [Year, Month, Day, Hour, Min, Sec] = [erlang:list_to_integer(V) || V <- Date], | 
					
						
							|  |  |  |   {ok, Tab} = ets:file2tab(In), | 
					
						
							|  |  |  |   true = ets:insert(Tab, {last_update, {{Year, Month, Day}, {Hour, Min, Sec}}}), | 
					
						
							|  |  |  |   Props = [ | 
					
						
							|  |  |  |     Prop | 
					
						
							|  |  |  |     || {Key, _} = Prop <- ets:info(Tab), | 
					
						
							|  |  |  |     Key =:= name orelse | 
					
						
							|  |  |  |     Key =:= type orelse | 
					
						
							|  |  |  |     Key =:= protection orelse | 
					
						
							|  |  |  |     Key =:= named_table orelse | 
					
						
							|  |  |  |     Key =:= keypos orelse | 
					
						
							|  |  |  |     Key =:= heir orelse | 
					
						
							|  |  |  |     Key =:= read_concurrency orelse | 
					
						
							|  |  |  |     Key =:= write_concurrency orelse | 
					
						
							|  |  |  |     Key =:= compressed], | 
					
						
							|  |  |  |   Entries = ets:tab2list(Tab), | 
					
						
							|  |  |  |   ok = file:write_file(Out, io_lib:format("~p.~n~p.~n", [Props, Entries])), | 
					
						
							|  |  |  |   ok = file:delete(In), | 
					
						
							|  |  |  |   init:stop(). | 
					
						
							|  |  |  | endef | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).manifest: $(SOURCE_DIST) | 
					
						
							|  |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							|  |  |  | 		find $(notdir $(SOURCE_DIST)) | LC_COLLATE=C sort > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-20 21:22:21 +08:00
										 |  |  | ifeq ($(shell tar --version | grep -c "GNU tar"),0) | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --uid 0 \
 | 
					
						
							|  |  |  | 				    --gid 0 \
 | 
					
						
							|  |  |  | 				    --numeric-owner \
 | 
					
						
							|  |  |  | 				    --no-acls \
 | 
					
						
							|  |  |  | 				    --no-fflags \
 | 
					
						
							|  |  |  | 				    --no-xattrs | 
					
						
							| 
									
										
										
										
											2018-12-20 21:22:21 +08:00
										 |  |  | else | 
					
						
							|  |  |  | TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --owner 0 \
 | 
					
						
							|  |  |  | 				    --group 0 \
 | 
					
						
							|  |  |  | 				    --numeric-owner | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).tar.gz: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(GZIP) --best > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).tar.bz2: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(BZIP2) > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).tar.xz: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(XZ) > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(verbose) rm -f $@ | 
					
						
							|  |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | 		$(ZIP) $(ZIP_V) --names-stdin $@ < $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 17:55:18 +08:00
										 |  |  | clean:: clean-source-dist | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | clean-source-dist: | 
					
						
							|  |  |  | 	$(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-* | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 17:55:18 +08:00
										 |  |  | distclean:: distclean-packages | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | distclean-packages: | 
					
						
							|  |  |  | 	$(gen_verbose) rm -rf -- $(PACKAGES_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-29 00:59:59 +08:00
										 |  |  | ## If a dependency doesn't have a clean target - do not call it
 | 
					
						
							| 
									
										
										
										
											2016-10-19 22:41:53 +08:00
										 |  |  | clean-unpacked-source-dist: | 
					
						
							|  |  |  | 	for d in deps/*; do \
 | 
					
						
							|  |  |  | 		if test -f $$d/Makefile; then \
 | 
					
						
							| 
									
										
										
										
											2016-10-29 00:59:59 +08:00
										 |  |  | 			(! make -n clean) || (make -C $$d clean || exit $$?); \
 | 
					
						
							| 
									
										
										
										
											2016-10-19 22:41:53 +08:00
										 |  |  | 		fi; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Packaging.
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: packages package-deb \ | 
					
						
							|  |  |  | 	package-rpm package-rpm-fedora package-rpm-suse \
 | 
					
						
							|  |  |  | 	package-windows package-standalone-macosx \
 | 
					
						
							| 
									
										
										
										
											2017-03-07 02:37:04 +08:00
										 |  |  | 	package-standalone-linux-x86_64 \
 | 
					
						
							|  |  |  | 	package-standalone-freebsd-x86_64 \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	package-generic-unix | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # This variable is exported so sub-make instances know where to find the
 | 
					
						
							|  |  |  | # archive.
 | 
					
						
							|  |  |  | PACKAGES_SOURCE_DIST_FILE ?= $(firstword $(SOURCE_DIST_FILES)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-01 21:46:27 +08:00
										 |  |  | packages package-deb package-rpm \ | 
					
						
							|  |  |  | package-rpm-redhat package-rpm-fedora package-rpm-rhel6 package-rpm-rhel7 \ | 
					
						
							|  |  |  | package-rpm-suse package-rpm-opensuse package-rpm-sles11 \ | 
					
						
							|  |  |  | package-windows package-standalone-macosx \ | 
					
						
							| 
									
										
										
										
											2017-03-07 02:37:04 +08:00
										 |  |  | package-standalone-linux-x86_64 \ | 
					
						
							|  |  |  | package-standalone-freebsd-x86_64 \ | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | package-generic-unix: $(PACKAGES_SOURCE_DIST_FILE) | 
					
						
							|  |  |  | 	$(verbose) $(MAKE) -C packaging $@ \
 | 
					
						
							|  |  |  | 		SOURCE_DIST_FILE=$(abspath $(PACKAGES_SOURCE_DIST_FILE)) | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | # Installation.
 | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | .PHONY: manpages web-manpages distclean-manpages | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | manpages web-manpages distclean-manpages: | 
					
						
							|  |  |  | 	$(MAKE) -C $(DEPS_DIR)/rabbit $@ DEPS_DIR=$(DEPS_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: install install-erlapp install-scripts install-bin install-man \ | 
					
						
							|  |  |  | 	install-windows install-windows-erlapp install-windows-scripts \
 | 
					
						
							|  |  |  | 	install-windows-docs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DESTDIR ?= | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PREFIX ?= /usr/local | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | WINDOWS_PREFIX ?= rabbitmq-server-windows-$(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | MANDIR ?= $(PREFIX)/share/man | 
					
						
							|  |  |  | RMQ_ROOTDIR ?= $(PREFIX)/lib/erlang | 
					
						
							|  |  |  | RMQ_BINDIR ?= $(RMQ_ROOTDIR)/bin | 
					
						
							|  |  |  | RMQ_LIBDIR ?= $(RMQ_ROOTDIR)/lib | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | RMQ_ERLAPP_DIR ?= $(RMQ_LIBDIR)/rabbitmq_server-$(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | RMQ_AUTOCOMPLETE_DIR ?= $(RMQ_ROOTDIR)/autocomplete | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | SCRIPTS = rabbitmq-defaults \
 | 
					
						
							|  |  |  | 	  rabbitmq-env \
 | 
					
						
							|  |  |  | 	  rabbitmq-server \
 | 
					
						
							|  |  |  | 	  rabbitmqctl \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 	  rabbitmq-plugins \
 | 
					
						
							| 
									
										
										
										
											2016-10-31 19:36:56 +08:00
										 |  |  | 	  rabbitmq-diagnostics \
 | 
					
						
							| 
									
										
										
										
											2019-02-26 18:46:52 +08:00
										 |  |  | 	  rabbitmq-queues \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 	  cuttlefish | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | AUTOCOMPLETE_SCRIPTS = bash_autocomplete.sh zsh_autocomplete.sh | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | WINDOWS_SCRIPTS = rabbitmq-defaults.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-echopid.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-env.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-plugins.bat \
 | 
					
						
							| 
									
										
										
										
											2016-10-31 19:36:56 +08:00
										 |  |  | 		  rabbitmq-diagnostics.bat \
 | 
					
						
							| 
									
										
										
										
											2019-02-26 18:46:52 +08:00
										 |  |  | 		  rabbitmq-queues.bat \
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 		  rabbitmq-server.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-service.bat \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		  rabbitmqctl.bat \
 | 
					
						
							|  |  |  | 		  cuttlefish | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNIX_TO_DOS ?= todos | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | inst_verbose_0 = @echo " INST  " $@; | 
					
						
							|  |  |  | inst_verbose = $(inst_verbose_$(V)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install: install-erlapp install-scripts | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install-erlapp: dist | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR) | 
					
						
							|  |  |  | 	$(inst_verbose) cp -r \
 | 
					
						
							|  |  |  | 		LICENSE* \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit/ebin \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		$(DEPS_DIR)/rabbit/priv \
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 		$(DEPS_DIR)/rabbit/INSTALL \
 | 
					
						
							|  |  |  | 		$(DIST_DIR) \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(RMQ_ERLAPP_DIR) | 
					
						
							|  |  |  | 	$(verbose) echo "Put your EZs here and use rabbitmq-plugins to enable them." \
 | 
					
						
							|  |  |  | 		> $(DESTDIR)$(RMQ_ERLAPP_DIR)/$(notdir $(DIST_DIR))/README | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	@# FIXME: Why do we copy headers? | 
					
						
							|  |  |  | 	$(verbose) cp -r \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit/include \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(RMQ_ERLAPP_DIR) | 
					
						
							|  |  |  | 	@# rabbitmq-common provides headers too: copy them to | 
					
						
							|  |  |  | 	@# rabbitmq_server/include. | 
					
						
							|  |  |  | 	$(verbose) cp -r \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit_common/include \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(RMQ_ERLAPP_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:25 +08:00
										 |  |  | CLI_ESCRIPTS_DIR = escript | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-27 22:49:52 +08:00
										 |  |  | install-escripts: | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:25 +08:00
										 |  |  | 	$(verbose) $(MAKE) -C $(DEPS_DIR)/rabbitmq_cli install \
 | 
					
						
							|  |  |  | 		PREFIX="$(RMQ_ERLAPP_DIR)/$(CLI_ESCRIPTS_DIR)" | 
					
						
							| 
									
										
										
										
											2016-10-27 22:49:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | install-scripts: install-escripts | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(SCRIPTS); do \
 | 
					
						
							|  |  |  | 		cp "$(DEPS_DIR)/rabbit/scripts/$$script" \
 | 
					
						
							|  |  |  | 			"$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin"; \
 | 
					
						
							|  |  |  | 		chmod 0755 "$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin/$$script"; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2017-01-17 01:57:42 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | # FIXME: We do symlinks to scripts in $(RMQ_ERLAPP_DIR))/sbin but this
 | 
					
						
							|  |  |  | # code assumes a certain hierarchy to make relative symlinks.
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | install-bin: install-scripts install-autocomplete-scripts | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_BINDIR) | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(SCRIPTS); do \
 | 
					
						
							|  |  |  | 		test -e $(DESTDIR)$(RMQ_BINDIR)/$$script || \
 | 
					
						
							|  |  |  | 			ln -sf ../lib/$(notdir $(RMQ_ERLAPP_DIR))/sbin/$$script \
 | 
					
						
							|  |  |  | 			 $(DESTDIR)$(RMQ_BINDIR)/$$script; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | install-autocomplete-scripts: | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_AUTOCOMPLETE_DIR) | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(AUTOCOMPLETE_SCRIPTS); do \
 | 
					
						
							| 
									
										
										
										
											2017-01-25 02:02:52 +08:00
										 |  |  | 		cp "scripts/$$script" \
 | 
					
						
							|  |  |  | 			"$(DESTDIR)$(RMQ_AUTOCOMPLETE_DIR)" && \
 | 
					
						
							|  |  |  | 		chmod 0755 "$(DESTDIR)$(RMQ_AUTOCOMPLETE_DIR)/$$script"; \
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | install-man: manpages | 
					
						
							|  |  |  | 	$(inst_verbose) sections=$$(ls -1 $(DEPS_DIR)/rabbit/docs/*.[1-9] \
 | 
					
						
							|  |  |  | 		| sed -E 's/.*\.([1-9])$$/\1/' | uniq | sort); \
 | 
					
						
							|  |  |  | 	for section in $$sections; do \
 | 
					
						
							|  |  |  | 		mkdir -p $(DESTDIR)$(MANDIR)/man$$section; \
 | 
					
						
							|  |  |  | 		for manpage in $(DEPS_DIR)/rabbit/docs/*.$$section; do \
 | 
					
						
							|  |  |  | 			gzip < $$manpage \
 | 
					
						
							|  |  |  | 			 > $(DESTDIR)$(MANDIR)/man$$section/$$(basename $$manpage).gz; \
 | 
					
						
							|  |  |  | 		done; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | install-windows: install-windows-erlapp install-windows-scripts install-windows-docs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install-windows-erlapp: dist | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX) | 
					
						
							|  |  |  | 	$(inst_verbose) cp -r \
 | 
					
						
							|  |  |  | 		LICENSE* \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit/ebin \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		$(DEPS_DIR)/rabbit/priv \
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 		$(DEPS_DIR)/rabbit/INSTALL \
 | 
					
						
							|  |  |  | 		$(DIST_DIR) \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(WINDOWS_PREFIX) | 
					
						
							|  |  |  | 	$(verbose) echo "Put your EZs here and use rabbitmq-plugins.bat to enable them." \
 | 
					
						
							|  |  |  | 		> $(DESTDIR)$(WINDOWS_PREFIX)/$(notdir $(DIST_DIR))/README.txt | 
					
						
							|  |  |  | 	$(verbose) $(UNIX_TO_DOS) $(DESTDIR)$(WINDOWS_PREFIX)/plugins/README.txt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	@# FIXME: Why do we copy headers? | 
					
						
							|  |  |  | 	$(verbose) cp -r \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit/include \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(WINDOWS_PREFIX) | 
					
						
							|  |  |  | 	@# rabbitmq-common provides headers too: copy them to | 
					
						
							|  |  |  | 	@# rabbitmq_server/include. | 
					
						
							|  |  |  | 	$(verbose) cp -r \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit_common/include \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(WINDOWS_PREFIX) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-03 19:47:02 +08:00
										 |  |  | install-windows-escripts: | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:25 +08:00
										 |  |  | 	$(verbose) $(MAKE) -C $(DEPS_DIR)/rabbitmq_cli install \
 | 
					
						
							|  |  |  | 		PREFIX="$(WINDOWS_PREFIX)/$(CLI_ESCRIPTS_DIR)" | 
					
						
							| 
									
										
										
										
											2016-11-03 19:47:02 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | install-windows-scripts: install-windows-escripts | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX)/sbin | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(WINDOWS_SCRIPTS); do \
 | 
					
						
							|  |  |  | 		cp "$(DEPS_DIR)/rabbit/scripts/$$script" \
 | 
					
						
							|  |  |  | 			"$(DESTDIR)$(WINDOWS_PREFIX)/sbin"; \
 | 
					
						
							|  |  |  | 		chmod 0755 "$(DESTDIR)$(WINDOWS_PREFIX)/sbin/$$script"; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install-windows-docs: install-windows-erlapp | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX)/etc | 
					
						
							| 
									
										
										
										
											2018-11-08 06:52:20 +08:00
										 |  |  | 	$(inst_verbose) man $(DEPS_DIR)/rabbit/docs/rabbitmq-service.8 > tmp-readme-service.txt | 
					
						
							|  |  |  | 	$(verbose) col -bx < ./tmp-readme-service.txt > $(DESTDIR)$(WINDOWS_PREFIX)/readme-service.txt | 
					
						
							|  |  |  | 	$(verbose) rm -f ./tmp-readme-service.txt | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) cp $(DEPS_DIR)/rabbit/docs/rabbitmq.config.example \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(WINDOWS_PREFIX)/etc | 
					
						
							|  |  |  | 	$(verbose) for file in \
 | 
					
						
							|  |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/readme-service.txt \
 | 
					
						
							|  |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/LICENSE* \
 | 
					
						
							|  |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/INSTALL \
 | 
					
						
							|  |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/etc/rabbitmq.config.example; do \
 | 
					
						
							|  |  |  | 		$(UNIX_TO_DOS) "$$file"; \
 | 
					
						
							|  |  |  | 		case "$$file" in \
 | 
					
						
							|  |  |  | 		*.txt) ;; \
 | 
					
						
							|  |  |  | 		*.example) ;; \
 | 
					
						
							|  |  |  | 		*) mv "$$file" "$$file.txt" ;; \
 | 
					
						
							|  |  |  | 		esac; \
 | 
					
						
							|  |  |  | 	done |