2022-09-01 14:25:02 -04:00
|
|
|
BINARY_NAME=adept
|
|
|
|
|
|
|
|
all: build test
|
|
|
|
|
2023-02-11 15:33:08 -05:00
|
|
|
compile:
|
2022-09-01 14:25:02 -04:00
|
|
|
go build -o ${BINARY_NAME} adept.go
|
|
|
|
|
|
|
|
test:
|
|
|
|
go test -v ./...
|
|
|
|
|
|
|
|
run:
|
|
|
|
go build -o ${BINARY_NAME} adept.go
|
|
|
|
./${BINARY_NAME}
|
2022-09-02 13:43:32 -04:00
|
|
|
|
|
|
|
install:
|
|
|
|
useradd ${BINARY_NAME}
|
|
|
|
usermod -aG ${BINARY_NAME} ${BINARY_NAME}
|
|
|
|
cp ./${BINARY_NAME} /usr/bin/${BINARY_NAME}
|
|
|
|
chown root:root /usr/bin/${BINARY_NAME}
|
|
|
|
chmod 755 /usr/bin/${BINARY_NAME}
|
|
|
|
cp ./build/etc/systemd/system/${BINARY_NAME}.service /etc/systemd/system/${BINARY_NAME}.service
|
|
|
|
chown root:root /etc/systemd/system/${BINARY_NAME}.service
|
|
|
|
chmod 644 /etc/systemd/system/${BINARY_NAME}.service
|
|
|
|
mkdir /etc/${BINARY_NAME}
|
|
|
|
cp ./build/etc/${BINARY_NAME}/${BINARY_NAME}.toml /etc/${BINARY_NAME}/
|
|
|
|
chown -R ${BINARY_NAME}:${BINARY_NAME} /etc/${BINARY_NAME}
|
|
|
|
chmod 644 /etc/${BINARY_NAME}/${BINARY_NAME}.toml
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
userdel ${BINARY_NAME}
|
|
|
|
rm /usr/bin/${BINARY_NAME}
|
|
|
|
rm /etc/systemd/system/${BINARY_NAME}.service
|
|
|
|
rm -rf /etc/${BINARY_NAME}
|
2023-02-11 15:33:08 -05:00
|
|
|
|
2022-09-01 14:25:02 -04:00
|
|
|
clean:
|
|
|
|
go clean
|
2023-02-11 15:33:08 -05:00
|
|
|
|
|
|
|
.PHONY: all test clean
|