forked from elastic/logstash-forwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (44 loc) · 1.59 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
.PHONY: default
default: compile
OBJECTS=logstash-forwarder
.PHONY: compile
compile: $(OBJECTS)
logstash-forwarder:
go build -o $@
.PHONY: clean
clean:
-rm $(OBJECTS)
-rm -rf build
.PHONY: generate-init-scripts
generate-init-script:
pleaserun --install --no-install-actions --install-prefix ./build \
--chdir /var/lib/logstash-forwarder \
--sysv-log-path /var/log/logstash-forwarder/ \
--overwrite -p sysv -v lsb-3.1 $(PREFIX)/bin/logstash-forwarder -config /etc/logstash-forwarder.conf
build/empty: | build
mkdir $@
.PHONY: rpm deb
deb: AFTER_INSTALL=pkg/ubuntu/after-install.sh
rpm: AFTER_INSTALL=pkg/centos/after-install.sh
rpm: BEFORE_INSTALL=pkg/centos/before-install.sh
rpm: BEFORE_REMOVE=pkg/centos/before-remove.sh
deb: AFTER_INSTALL=pkg/ubuntu/after-install.sh
deb: BEFORE_INSTALL=pkg/ubuntu/before-install.sh
deb: BEFORE_REMOVE=pkg/ubuntu/before-remove.sh
rpm deb: PREFIX=/opt/logstash-forwarder
rpm deb: VERSION=$(shell ./logstash-forwarder -version)
rpm deb: compile generate-init-script build/empty
fpm -f -s dir -t $@ -n logstash-forwarder -v $(VERSION) \
--architecture native \
--replaces lumberjack \
--description "a log shipping tool" \
--url "https://github.com/elasticsearch/logstash-forwarder" \
--after-install $(AFTER_INSTALL) \
--before-install $(BEFORE_INSTALL) \
--before-remove $(BEFORE_REMOVE) \
--config-files /etc/logstash-forwarder.conf \
./logstash-forwarder=$(PREFIX)/bin/ \
./logstash-forwarder.conf.example=/etc/logstash-forwarder.conf \
./build/etc=/ \
./build/empty/=/var/lib/logstash-forwarder/ \
./build/empty/=/var/log/logstash-forwarder/ \