You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
789 B
32 lines
789 B
PACKAGE_NAME=justcaptcha
|
|
TARGET=${PACKAGE_NAME}d
|
|
|
|
SYSCTL=${shell which systemctl}
|
|
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
|
SYSDDIR=${SYSDDIR_:/%=%}
|
|
DESTDIR=/
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=2.0.1" -tags osusergo,netgo
|
|
|
|
all: ${TARGET}
|
|
|
|
.PHONY: ${TARGET}
|
|
|
|
${TARGET}:
|
|
go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go
|
|
|
|
run:
|
|
bin/${TARGET} -expiry 1m -listen 127.0.0.1:19134
|
|
|
|
install:
|
|
install -Dm 0755 bin/${TARGET} ${DESTDIR}usr/bin/${TARGET}
|
|
install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE
|
|
|
|
install -Dm 0644 init/systemd.service ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service
|
|
|
|
uninstall:
|
|
rm ${DESTDIR}usr/bin/${TARGET}
|
|
rm ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE
|
|
|
|
rm ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service
|