-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
65 lines (61 loc) · 1.99 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
BUILD_DIR=./build
.PHONY: build
build: clean
mkdir -p $(BUILD_DIR)
wget -P $(BUILD_DIR) https://github.com/runabove/beamium/archive/v$(VERSION).zip
unzip -q -d $(BUILD_DIR) $(BUILD_DIR)/v$(VERSION).zip
cd $(BUILD_DIR)/beamium-$(VERSION) && cargo build --release
mv $(BUILD_DIR)/beamium-$(VERSION)/target/release/beamium $(BUILD_DIR)/
.PHONY: deb
deb:
rm -f beamium*.deb
fpm -m "<[email protected]>" \
--description "Prometheus to Warp10 metrics forwarder" \
--url "https://github.com/ovh/beamium" \
--license "BSD-3-Clause" \
--version $(shell echo $$(./build/beamium --version | head -n 1 | awk '{print $$3}')-$$(lsb_release -cs)) \
-n beamium \
-d logrotate \
-s dir -t deb \
-a all \
--deb-user beamium \
--deb-group beamium \
--deb-no-default-config-files \
--config-files /etc/beamium/config.yaml \
--deb-init deb/beamium.init \
--directories /opt/beamium \
--directories /var/log/beamium \
--before-install deb/before-install.sh \
--after-install deb/after-install.sh \
--before-upgrade deb/before-upgrade.sh \
--after-upgrade deb/after-upgrade.sh \
--before-remove deb/before-remove.sh \
--after-remove deb/after-remove.sh \
--inputs deb/input
.PHONY: rpm
rpm:
rm -f beamium*.rpm
fpm -m "<[email protected]>" \
--description "Prometheus to Warp10 metrics forwarder" \
--url "https://github.com/ovh/beamium" \
--license "BSD-3-Clause" \
--version $(shell echo $$(./build/beamium --version | head -n 1 | awk '{print $$3}')) \
-n beamium \
-d logrotate \
-s dir -t rpm \
-a all \
--rpm-user beamium \
--rpm-group beamium \
--config-files /etc/beamium/config.yaml \
--rpm-init rpm/beamium.init \
--before-install rpm/before-install.sh \
--after-install rpm/after-install.sh \
--before-upgrade rpm/before-upgrade.sh \
--after-upgrade rpm/after-upgrade.sh \
--before-remove rpm/before-remove.sh \
--after-remove rpm/after-remove.sh \
--inputs rpm/input
.PHONY: clean
clean:
rm -rf build
rm -rf opt