diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-02-24 18:19:42 -0500 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-02-24 18:19:42 -0500 |
commit | f32da4ead891548cd23ec0dd6408ef3125b4e9e3 (patch) | |
tree | f118423267ae571876899c384cee5ff85d4a8cc6 /Makefile | |
parent | 5961303fc6e8f87e61a7abb1b4c14d24e7e30758 (diff) |
debian package will include service file; install target will enable service
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -15,6 +15,7 @@ INSTALL_MKDIR = $(INSTALL) -d -m 755 | |||
15 | 15 | ||
16 | prefix ?= /usr | 16 | prefix ?= /usr |
17 | bindir ?= $(prefix)/bin | 17 | bindir ?= $(prefix)/bin |
18 | etcdir ?= /etc | ||
18 | 19 | ||
19 | # Targets | 20 | # Targets |
20 | all: tuntox tuntox_nostatic | 21 | all: tuntox tuntox_nostatic |
@@ -45,15 +46,22 @@ clean: | |||
45 | rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h | 46 | rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h |
46 | 47 | ||
47 | install: tuntox_nostatic | 48 | install: tuntox_nostatic |
48 | $(INSTALL_MKDIR) -d $(DESTDIR)$(bindir) | 49 | install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir) |
49 | cp tuntox_nostatic $(DESTDIR)$(bindir)/tuntox | 50 | install -d -m700 $(DESTDIR)$(etcdir)/tuntox |
50 | install scripts/tokssh $(DESTDIR)$(bindir)/ | 51 | install -D -T tuntox_nostatic $(DESTDIR)$(bindir)/tuntox |
52 | install -D scripts/tokssh -t $(DESTDIR)$(bindir)/ | ||
53 | install -m0644 -D -t $(DESTDIR)$(etcdir)/systemd/system scripts/tuntox.service | ||
54 | ifeq ($(SKIP_SYSTEMCTL),) | ||
55 | systemctl daemon-reload | ||
56 | systemctl restart tuntox | ||
57 | systemctl status tuntox | ||
58 | endif | ||
51 | 59 | ||
52 | debs = ../tuntox_0.0.9-1_amd64.deb ../tuntox-dbgsym_0.0.9-1_amd64.deb | 60 | debs = ../tuntox_0.0.9-1_amd64.deb ../tuntox-dbgsym_0.0.9-1_amd64.deb |
53 | .PHONY: install-debs debs | 61 | .PHONY: install-debs debs |
54 | install-debs: $(debs) | 62 | install-debs: $(debs) |
55 | $(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(debs) | 63 | $(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(debs) |
56 | $(debs) debs: | 64 | $(debs) debs: |
57 | fakeroot ./debian/rules binary | 65 | fakeroot -- sh -c 'SKIP_SYSTEMCTL=y ./debian/rules binary' |
58 | 66 | ||
59 | .PHONY: all clean tuntox | 67 | .PHONY: all clean tuntox |