diff --git a/.gitignore b/.gitignore index dfd7c8a..bb25b83 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ drop lib templates/ docs/ +man/*.gz diff --git a/makefile b/makefile index 21ebbda..a40acec 100644 --- a/makefile +++ b/makefile @@ -10,6 +10,7 @@ LOC ?= ./bin/ include mk/build.mk include mk/commands.mk +include mk/install.mk include mk/setup.mk include mk/dev.mk -include mk/migration.mk diff --git a/mk/install.mk b/mk/install.mk new file mode 100644 index 0000000..18c51bf --- /dev/null +++ b/mk/install.mk @@ -0,0 +1,26 @@ +# DESTDIR envvar is a way to install the application in a different root (for building packages for example). +PREFIX ?= /usr/local +BINDIR ?= $(PREFIX)/bin +SHAREDIR ?= $(PREFIX)/share +DOCDIR ?= $(SHAREDIR)/doc/dnsmanagerd +MANDIR ?= $(SHAREDIR)/man + +install-dnsmanagerd: build-server + $(Q)install -D -m 555 ./bin/dnsmanagerd $(DESTDIR)$(BINDIR)/dnsmanagerd +install-dnsmanager-client: build-client + $(Q)install -D -m 555 ./bin/dnsmanager-client $(DESTDIR)$(BINDIR)/dnsmanager-client +install-binaries: install-dnsmanagerd install-dnsmanager-client + +gz-man-dnsmanager-client:; $(Q)gzip -k --best ./man/dnsmanager-client.1 +gz-man-dnsmanagerd:; $(Q)gzip -k --best ./man/dnsmanagerd.1 + +install-man-dnsmanagerd: gz-man-dnsmanagerd + $(Q)install -D -m 444 ./man/dnsmanagerd.1.gz $(DESTDIR)$(MANDIR)/man1/dnsmanagerd.1.gz +install-man-dnsmanager-client: gz-man-dnsmanager-client + $(Q)install -D -m 444 ./man/dnsmanager-client.1.gz $(DESTDIR)$(MANDIR)/man1/dnsmanager-client.1.gz +install-man: install-man-dnsmanagerd install-man-dnsmanager-client + +install-dev-doc: doc ; install -D docs/ $(DESTDIR)$(DOCDIR) + +# By default, dev documentation isn't installed. +install: install-binaries install-man #install-dev-doc