forked from blind-oracle/dnstap-bgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (53 loc) · 1.36 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
NAME := dnstap-bgp
MAINTAINER:= Igor Novgorodov <[email protected]>
DESCRIPTION := DNSTap to BGP exporter
LICENSE := MPLv2
GO ?= go
DEP ?= dep
VERSION := $(shell cat VERSION)
OUT := .out
PACKAGE := github.com/blind-oracle/$(NAME)
ARCH := amd64
all: build
build:
rm -rf $(OUT)
mkdir -p $(OUT)
go build -ldflags "-s -w -X main.version=$(VERSION)"
mv $(NAME) $(OUT)
mkdir -p $(OUT)/root/etc/$(NAME)
cp deploy/dnstap-bgp.conf $(OUT)/root/etc/$(NAME)/$(NAME).conf
deb:
make build
make build-deb
rpm:
make build
make build-rpm
build-deb:
fpm -s dir -t deb -n $(NAME) -v $(VERSION) \
--deb-priority optional \
--category admin \
--force \
--url https://$(PACKAGE) \
--description "$(DESCRIPTION)" \
-m "$(MAINTAINER)" \
--license "$(LICENSE)" \
-a $(ARCH) \
$(OUT)/$(NAME)=/usr/bin/$(NAME) \
deploy/$(NAME).service=/usr/lib/systemd/system/$(NAME).service \
deploy/$(NAME)=/etc/default/$(NAME) \
$(OUT)/root/=/
build-rpm:
fpm -s dir -t rpm -n $(NAME) -v $(VERSION) \
--force \
--rpm-compression bzip2 \
--rpm-os linux \
--url https://$(PACKAGE) \
--description "$(DESCRIPTION)" \
-m "$(MAINTAINER)" \
--license "$(LICENSE)" \
-a $(ARCH) \
--config-files /etc/$(NAME)/$(NAME).conf \
$(OUT)/$(NAME)=/usr/bin/$(NAME) \
deploy/$(NAME).service=/usr/lib/systemd/system/$(NAME).service \
deploy/$(NAME)=/etc/default/$(NAME) \
$(OUT)/root/=/