git » chasquid » commit e4b7899

Makefile: Add targets for installation

author Alberto Bertogli
2016-10-27 00:43:45 UTC
committer Alberto Bertogli
2016-11-03 00:51:59 UTC
parent f43fd3d3cfac882ca01e2d9a981aac9fd066339f

Makefile: Add targets for installation

This patch adds Makefile targets to install the binaries and the
skeleton configuration.

Makefile +14 -0

diff --git a/Makefile b/Makefile
index 02c23cb..844a377 100644
--- a/Makefile
+++ b/Makefile
@@ -37,4 +37,18 @@ test:
 	setsid -w ./cmd/chasquid-util/test.sh
 
 
+install-binaries: chasquid chasquid-util smtp-check
+	mkdir -p /usr/local/bin/
+	cp -a chasquid chasquid-util smtp-check /usr/local/bin/
+
+install-config-skeleton:
+	if ! [ -d /etc/chasquid ] ; then cp -arv etc / ; fi
+	
+	if ! [ -d /var/lib/chasquid ]; then \
+		mkdir -v /var/lib/chasquid; \
+		chmod -v 0700 /var/lib/chasquid ; \
+		chown -v mail:mail /var/lib/chasquid ; \
+	fi
+
+
 .PHONY: chasquid chasquid-util smtp-check spf-check test