-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (50 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
55 lines (50 loc) · 1.64 KB
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
TARGET = release
PREFIX = /usr/local
SYSCONFDIR = "$(PREFIX)/etc"
all:
ifeq ($(TARGET), release)
cargo build --release
else
cargo build
endif
install:
mkdir -p $(SYSCONFDIR)/intecture/certs
sed 's~{{sysconfdir}}~$(SYSCONFDIR)~' resources/auth.json.tpl > $(SYSCONFDIR)/intecture/auth.json
chmod 0644 $(SYSCONFDIR)/intecture/auth.json
install -m 0755 target/$(TARGET)/inauth $(PREFIX)/bin/
install -m 0755 target/$(TARGET)/inauth_cli $(PREFIX)/bin/
if [ -f /etc/rc.conf ]; then \
install -m 555 resources/init/freebsd /etc/rc.d/inauth; \
elif stat --format=%N /proc/1/exe|grep -qs systemd ; then \
if [ -d /usr/lib/systemd/system ]; then \
install -m 644 resources/init/systemd /usr/lib/systemd/system/inauth.service; \
elif [ -d /lib/systemd/system ]; then \
install -m 644 resources/init/systemd /lib/systemd/system/inauth.service; \
fi; \
elif [ -f /etc/redhat-release ]; then \
install -m 755 resources/init/redhat /etc/init.d/inauth; \
elif [ -f /etc/debian_version ]; then \
install -m 755 resources/init/debian /etc/init.d/inauth; \
fi;
uninstall:
rm -f $(PREFIX)/bin/inauth \
$(PREFIX)/bin/inauth_cli \
$(SYSCONFDIR)/intecture/auth.json \
/lib/systemd/system/inauth.service \
/usr/lib/systemd/system/inauth.service \
/etc/init.d/inauth \
/etc/rc.d/inauth
if [ -d $SYSCONFDIR/intecture/certs -a -z "$(ls -A $SYSCONFDIR/intecture/certs)" ]; then \
rmdir $(SYSCONFDIR)/intecture/certs; \
fi
if [ -d $SYSCONFDIR/intecture -a -z "$(ls -A $SYSCONFDIR/intecture)" ]; then \
rmdir $(SYSCONFDIR)/intecture; \
fi
test:
ifeq ($(TARGET), release)
cargo test --release
else
cargo test
endif
clean:
cargo clean