1- all : carbon-clickhouse
1+ NAME: =carbon-clickhouse
2+ MAINTAINER: ="Roman Lomonosov <
[email protected] >"
3+ DESCRIPTION: ="Graphite metrics receiver with ClickHouse as storage"
24
35GO ?= go
46export GOPATH := $(CURDIR ) /_vendor
7+ TEMPDIR: =$(shell mktemp -d)
8+ VERSION: =$(shell sh -c 'grep "const Version" $(NAME ) .go | cut -d\" -f2')
9+
10+ all : $(NAME )
511
612submodules :
713 git submodule init
814 git submodule update --recursive
915
10- carbon-clickhouse :
11- $(GO ) build carbon-clickhouse.go
16+ $(NAME ) :
17+ $(GO ) build $(NAME ) .go
18+
19+ gox-build :
20+ rm -rf out
21+ mkdir -p out
22+ gox -os=" linux" -arch=" amd64" -arch=" 386" -output=" out/$( NAME) -{{.OS}}-{{.Arch}}" github.com/lomik/$(NAME )
23+ ls -la out/
24+ mkdir -p out/root/etc/$(NAME ) /
25+ ./out/$(NAME ) -linux-amd64 -config-print-default > out/root/etc/$(NAME ) /$(NAME ) .conf
26+
27+ fpm-deb :
28+ make fpm-build-deb ARCH=amd64
29+ make fpm-build-deb ARCH=386
30+ fpm-rpm :
31+ make fpm-build-rpm ARCH=amd64
32+ make fpm-build-rpm ARCH=386
33+
34+ fpm-build-deb :
35+ fpm -s dir -t deb -n $(NAME ) -v $(VERSION ) \
36+ --deb-priority optional --category admin \
37+ --force \
38+ --deb-compression bzip2 \
39+ --url https://github.com/lomik/$(NAME ) \
40+ --description $(DESCRIPTION ) \
41+ -m $(MAINTAINER ) \
42+ --license " MIT" \
43+ -a $(ARCH ) \
44+ --config-files /etc/$(NAME ) /$(NAME ) .conf \
45+ out/$(NAME ) -linux-$(ARCH ) =/usr/bin/$(NAME ) \
46+ deploy/systemd/$(NAME ) .service=/usr/lib/systemd/system/$(NAME ) .service \
47+ out/root/=/
48+
49+
50+ fpm-build-rpm :
51+ fpm -s dir -t rpm -n $(NAME ) -v $(VERSION ) \
52+ --force \
53+ --rpm-compression bzip2 --rpm-os linux \
54+ --url https://github.com/lomik/$(NAME ) \
55+ --description $(DESCRIPTION ) \
56+ -m $(MAINTAINER ) \
57+ --license " MIT" \
58+ -a $(ARCH ) \
59+ --config-files /etc/$(NAME ) /$(NAME ) .conf \
60+ out/$(NAME ) -linux-$(ARCH ) =/usr/bin/$(NAME ) \
61+ deploy/systemd/$(NAME ) .service=/usr/lib/systemd/system/$(NAME ) .service \
62+ out/root/=/
0 commit comments