2021-03-13 03:17:30 +04:00
|
|
|
TARGET=httpprocwatchd
|
|
|
|
|
2021-12-24 21:17:36 +04:00
|
|
|
SYSCTL=${shell which systemctl}
|
|
|
|
DESTDIR=/
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2021-12-24 21:17:36 +04:00
|
|
|
INSTALL_BINDIR=${DESTDIR}usr/bin
|
|
|
|
INSTALL_CONFIGDIR=${DESTDIR}etc/${TARGET}
|
|
|
|
INSTALL_SYSDSERVICEDIR=${DESTDIR}usr/lib/systemd/system
|
2022-01-02 05:32:00 +04:00
|
|
|
INSTALL_LICENSEDIR=${DESTDIR}usr/share/licenses/${TARGET}
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
LDFLAGS=-ldflags "-s -w"
|
|
|
|
|
2022-01-02 21:32:34 +04:00
|
|
|
SOURCES := ${wildcard *.go}
|
2022-01-02 05:14:52 +04:00
|
|
|
|
2021-12-24 21:17:36 +04:00
|
|
|
all: ${TARGET}
|
2021-03-13 03:17:30 +04:00
|
|
|
|
2022-01-02 05:14:52 +04:00
|
|
|
${TARGET}: ${SOURCES}
|
2021-12-24 21:17:36 +04:00
|
|
|
go build ${LDFLAGS}
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
install:
|
2021-12-24 21:17:36 +04:00
|
|
|
install -Dm 0755 ${TARGET} ${INSTALL_BINDIR}/${TARGET}
|
2022-01-02 02:58:24 +04:00
|
|
|
install -Dm 0644 contrib/config.example.json ${INSTALL_CONFIGDIR}/config.json
|
2022-01-02 05:32:00 +04:00
|
|
|
install -Dm 0644 LICENSE ${INSTALL_LICENSEDIR}/LICENSE
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
install-service:
|
2022-01-02 02:58:24 +04:00
|
|
|
install -Dm 0644 contrib/systemd/${TARGET}.service ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
|
2021-12-24 21:17:36 +04:00
|
|
|
${SYSCTL} daemon-reload
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
uninstall:
|
2021-12-24 21:17:36 +04:00
|
|
|
rm ${INSTALL_BINDIR}/${TARGET}
|
2022-01-02 05:32:00 +04:00
|
|
|
rm ${INSTALL_LICENSEDIR}/LICENSE
|
2021-03-13 03:17:30 +04:00
|
|
|
|
|
|
|
uninstall-service:
|
2021-12-24 21:17:36 +04:00
|
|
|
${SYSCTL} stop ${TARGET}.service
|
|
|
|
${SYSCTL} disable ${TARGET}.service
|
|
|
|
rm ${INSTALL_SYSDSERVICEDIR}/${TARGET}.service
|
|
|
|
${SYSCTL} daemon-reload
|
|
|
|
|
|
|
|
clean:
|
|
|
|
go clean
|