forked from TritonDataCenter/sdc-zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (52 loc) · 1.67 KB
/
Makefile
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
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Copyright (c) 2014, Joyent, Inc.
#
NAME=sdc-zookeeper
# Files
SMF_MANIFESTS_IN=deps/zookeeper-common/smf/manifests/zookeeper.xml.in
include ./tools/mk/Makefile.defs
include ./tools/mk/Makefile.smf.defs
RELEASE_TARBALL=$(NAME)-pkg-$(STAMP).tar.bz2
ROOT := $(shell pwd)
RELSTAGEDIR := /tmp/$(STAMP)
#
# Targets
#
.PHONY: all
all: $(SMF_MANIFESTS) | sdc-scripts
# Needed for 'check-manifests' target.
check:: deps/zookeeper-common/.git
.PHONY: release
release: all
@echo "Building $(RELEASE_TARBALL)"
@mkdir -p $(RELSTAGEDIR)/root/opt/smartdc/boot
cp -r $(ROOT)/deps/sdc-scripts/* \
$(RELSTAGEDIR)/root/opt/smartdc/boot
cp -r $(ROOT)/deps/zookeeper-common/boot/* \
$(RELSTAGEDIR)/root/opt/smartdc/boot
cp -r $(ROOT)/boot/* \
$(RELSTAGEDIR)/root/opt/smartdc/boot
@mkdir -p $(RELSTAGEDIR)/root/opt/smartdc/zookeeper
cp -r $(ROOT)/deps/zookeeper-common/sapi_manifests \
$(RELSTAGEDIR)/root/opt/smartdc/zookeeper
cp -r $(ROOT)/deps/zookeeper-common/smf \
$(RELSTAGEDIR)/root/opt/smartdc/zookeeper
(cd $(RELSTAGEDIR) && $(TAR) -jcf $(ROOT)/$(RELEASE_TARBALL) root)
@rm -rf $(RELSTAGEDIR)
.PHONY: publish
publish: release
@if [[ -z "$(BITS_DIR)" ]]; then \
@echo "error: 'BITS_DIR' must be set for 'publish' target"; \
exit 1; \
fi
mkdir -p $(BITS_DIR)/$(NAME)
cp $(ROOT)/$(RELEASE_TARBALL) $(BITS_DIR)/$(NAME)/$(RELEASE_TARBALL)
include ./tools/mk/Makefile.deps
include ./tools/mk/Makefile.smf.targ
include ./tools/mk/Makefile.targ
sdc-scripts: deps/sdc-scripts/.git