~poptart/hosaka-pki

ref: c88889c4303fe6b561bf20b1d8402e8b5735fe86 hosaka-pki/Makefile -rw-r--r-- 741 bytes
c88889c4 — terrorbyte More functions 2 years ago
                                                                                
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
include config.mk

all: check

check:
	shellcheck -a -x -s sh ./hosaka-pki.sh

config:
	@sed -e "s%{{SSLDIR}}%${SSLDIR}%g" \
		-e "s%{{SSHDIR}}%${SSHDIR}%g" \
		-e "s%{{CONFIGDIR}}%${CONFIGDIR}%g" \
		< config.def > config

install:
	@printf "installing hosaka-pki"
	@mkdir -p "${CONFIGDIR}" "${CONFIGDIR}/ssl" \
		"${CONFIGDIR}/ssh" "${CONFIGDIR}/util"
	@chown 0700 "${CONFIGDIR}/ssl" "${CONFIGDIR}/ssh"
	@cp -f config "${CONFIGDIR}/config"
	@cp -f openssl.cnf.tmpl "${CONFIGDIR}/openssl.cnf.tmpl"
	@sed -e "s%{{CONFIGDIR}}%${CONFIGDIR}%g" \
		< hosaka-pki.sh > ${PREFIX}/bin/hosaka-pki
	@chown 755 ${PREFIX}/bin/hosaka-pki
	@printf "hosaka-pki installed into: ${CONFIGDIR}\\n"

clean:
	@printf "cleaning"

.PHONY:
	all clean install check