2022-06-26 16:46:26 +04:00
|
|
|
PACKAGE_NAME=justcaptcha
|
|
|
|
TARGET=${PACKAGE_NAME}d
|
2022-06-24 23:09:46 +04:00
|
|
|
|
|
|
|
SYSCTL=${shell which systemctl}
|
|
|
|
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
|
|
|
SYSDDIR=${SYSDDIR_:/%=%}
|
|
|
|
DESTDIR=/
|
|
|
|
|
2023-05-06 04:50:32 +04:00
|
|
|
VERSION=2.0.2
|
|
|
|
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo
|
2022-06-24 23:09:46 +04:00
|
|
|
|
2022-06-26 16:46:26 +04:00
|
|
|
all: ${TARGET}
|
2022-06-24 23:09:46 +04:00
|
|
|
|
2022-06-26 16:46:26 +04:00
|
|
|
.PHONY: ${TARGET}
|
2022-06-24 23:09:46 +04:00
|
|
|
|
2022-06-26 16:46:26 +04:00
|
|
|
${TARGET}:
|
2022-06-24 23:09:46 +04:00
|
|
|
go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go
|
|
|
|
|
2022-06-26 16:49:42 +04:00
|
|
|
run:
|
2022-06-26 21:00:34 +04:00
|
|
|
bin/${TARGET} -expiry 1m -listen 127.0.0.1:19134
|
2022-06-24 23:09:46 +04:00
|
|
|
|
|
|
|
install:
|
2022-06-26 16:46:26 +04:00
|
|
|
install -Dm 0755 bin/${TARGET} ${DESTDIR}usr/bin/${TARGET}
|
|
|
|
install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE
|
2022-06-24 23:09:46 +04:00
|
|
|
|
2023-01-08 17:02:43 +04:00
|
|
|
install -Dm 0644 init/systemd.service ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service
|
2022-06-24 23:09:46 +04:00
|
|
|
|
|
|
|
uninstall:
|
2022-06-26 16:46:26 +04:00
|
|
|
rm ${DESTDIR}usr/bin/${TARGET}
|
|
|
|
rm ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE
|
2022-06-24 23:09:46 +04:00
|
|
|
|
2022-06-26 16:46:26 +04:00
|
|
|
rm ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service
|