forked from wandnz/systemd-named-netns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (26 loc) · 1.51 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
.PHONY: all install uninstall
LIBDIR ?= /usr/lib
all:
install:
install --directory $(DESTDIR)/$(LIBDIR)/systemd/system $(DESTDIR)/etc/default $(DESTDIR)/usr/bin $(DESTDIR)/usr/sbin
install --owner=root --group=root --mode=644 services/netns@.service $(DESTDIR)/$(LIBDIR)/systemd/system/
install --owner=root --group=root --mode=644 services/netns-bridge@.service $(DESTDIR)/$(LIBDIR)/systemd/system/
install --owner=root --group=root --mode=644 services/netns-raw@.service $(DESTDIR)/$(LIBDIR)/systemd/system/
install --owner=root --group=root --mode=644 services/netns-veth@.service $(DESTDIR)/$(LIBDIR)/systemd/system/
install --owner=root --group=root --mode=644 configs/netns $(DESTDIR)/etc/default/
install --owner=root --group=root --mode=755 scripts/chnetns $(DESTDIR)/usr/bin/
install --owner=root --group=root --mode=755 scripts/netnsinit $(DESTDIR)/usr/sbin/
install --owner=root --group=root --mode=755 scripts/netnsctl $(DESTDIR)/usr/sbin/
systemctl daemon-reload || true
uninstall:
systemctl disable --now "netns-veth@" || true
systemctl disable --now "netns-bridge@" || true
systemctl disable --now "netns-raw@" || true
systemctl disable --now "netns@" || true
rm -f $(DESTDIR)/$(LIBDIR)/systemd/system/netns@.service
rm -f $(DESTDIR)/$(LIBDIR)/systemd/system/netns-bridge@.service
rm -f $(DESTDIR)/$(LIBDIR)/systemd/system/netns-raw@.service
rm -f $(DESTDIR)/$(LIBDIR)/systemd/system/netns-veth@.service
rm -f $(DESTDIR)/usr/bin/chnetns
rm -f $(DESTDIR)/usr/sbin/netnsinit
rm -f $(DESTDIR)/usr/sbin/netnsctl