adept/Makefile

38 lines
962 B
Makefile
Raw Normal View History

BINARY_NAME=adept
all: build test
build:
go build -o ${BINARY_NAME} adept.go
test:
go test -v ./...
run:
go build -o ${BINARY_NAME} adept.go
./${BINARY_NAME}
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}
clean:
go clean
rm ${BINARY_NAME}