From d9dccdd95c727d59461f2ccde8d9398c0243feea Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Thu, 6 Aug 2015 17:12:40 +0200 Subject: [PATCH] Add a Makefile targets that installs the config files. This is useful for the new packer. Look at the bright side: we'll be able to delete a bunch of the other "install/dist" targets after it's finished. --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index e61bd0602005..87d4d7a6a2dc 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ CONF_PATH?=/etc/packetbeat VERSION?=1.0.0-beta2 ARCH?=$(shell uname -m) GODEP=$(GOPATH)/bin/godep +PREFIX?=/build GOFILES = $(shell find . -type f -name '*.go') packetbeat: $(GOFILES) @@ -64,6 +65,18 @@ darwin_dist: packetbeat tar czvf packetbeat-$(VERSION)-darwin.tgz packetbeat-$(VERSION)-darwin shasum packetbeat-$(VERSION)-darwin.tgz > packetbeat-$(VERSION)-darwin.tgz.sha1.txt +.PHONY: install_cfg +install_cfg: + cp etc/packetbeat.yml $(PREFIX)/packetbeat-linux.yml + cp etc/packetbeat.template.json $(PREFIX)/packetbeat.template.json + # darwin + cp etc/packetbeat.yml $(PREFIX)/packetbeat-darwin.yml + sed -i .bk 's/device: any/device: en0/' $(PREFIX)/packetbeat-darwin.yml + # win + cp etc/packetbeat.yml $(PREFIX)/packetbeat-win.yml + sed -i .bk 's/device: any/device: 1/' $(PREFIX)/packetbeat-win.yml + + .PHONY: gofmt gofmt: go fmt ./...