-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
48 lines (41 loc) · 2.14 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
DEB_VERSION:=1.0-$(shell date +%Y%m%d%H%M%S -d "$(shell git show -s --format=%cD HEAD)" )-$(shell git rev-parse HEAD | cut -c -8)
BINS=check_dhcp libpacketmark.so
all: $(BINS) deb
clean:
rm -f $(BINS) gatemon_*.deb
check_dhcp: check_dhcp.c
$(CC) $(CFLAGS) -o $@ $+
libpacketmark.so:
mkdir -p libpacketmark
curl --location --continue-at - --silent --show-error --output libpacketmark/libpacketmark.c https://github.com/freifunk-gluon/packages/raw/master/libs/libpacketmark/src/libpacketmark.c
curl --location --continue-at - --silent --show-error --output libpacketmark/Makefile https://github.com/freifunk-gluon/packages/raw/master/libs/libpacketmark/src/Makefile
make -C libpacketmark
archlinux: $(BINS)
makepkg -s
deb: $(BINS)
checkinstall -D \
--default \
--backup=no \
--fstrans=yes \
--install=no \
--pkgname=gatemon \
--nodoc \
--pkglicense=custom \
--requires="curl,dnsutils,monitoring-plugins-basic,monitoring-plugins-standard"
install: $(BINS)
install -d $(DESTDIR)$(PREFIX)/opt
install -d $(DESTDIR)$(PREFIX)/opt/gatemon
install -Dm755 gatemon.sh $(DESTDIR)$(PREFIX)/opt/gatemon/gatemon.sh
install -Dm755 check_dhcp $(DESTDIR)$(PREFIX)/opt/gatemon/check_dhcp
install -Dm644 VERSION $(DESTDIR)$(PREFIX)/opt/gatemon/VERSION
install -Dm644 gatemon.cfg $(DESTDIR)$(PREFIX)/etc/gatemon.cfg
install -Dm644 gatemon.cron $(DESTDIR)$(PREFIX)/etc/cron.d/gatemon
install -Dm644 gatemon.root.service $(DESTDIR)$(PREFIX)/lib/systemd/system/gatemon.root.service
install -Dm644 gatemon.nonroot.service $(DESTDIR)$(PREFIX)/lib/systemd/system/gatemon.nonroot.service
install -Dm644 gatemon-setup.nonroot.service $(DESTDIR)$(PREFIX)/lib/systemd/system/gatemon-setup.nonroot.service
ln -sf /lib/systemd/system/gatemon.root.service $(DESTDIR)$(PREFIX)/lib/systemd/system/gatemon.service
install -Dm644 gatemon.timer $(DESTDIR)$(PREFIX)/lib/systemd/system/gatemon.timer
install -Dm755 libpacketmark/libpacketmark.so $(DESTDIR)$(PREFIX)/opt/gatemon/libpacketmark/libpacketmark.so
install -d $(DESTDIR)$(PREFIX)/opt/gatemon/checks
for file in checks/*; do install -m755 "$$file" $(DESTDIR)$(PREFIX)/opt/gatemon/checks/; done