29 lines
884 B
Makefile
29 lines
884 B
Makefile
help:
|
|
@echo "Usage: make [OPTION]"
|
|
@echo "Available options are:"
|
|
@echo "help"
|
|
@echo "install"
|
|
@echo "uninstall"
|
|
|
|
compile:
|
|
@echo "==> Compiling backup"
|
|
go build .
|
|
|
|
install: compile
|
|
@echo "==> Copying the hooks into /etc/pacman.d/hooks"
|
|
[[ -d /etc/pacman.d/hooks ]] || sudo mkdir /etc/pacman.d/hooks
|
|
sudo cp pre_backup.hook post_backup.hook /etc/pacman.d/hooks
|
|
@echo "==> Copying backup into /usr/local/bin"
|
|
sudo install -Dm755 backup /usr/local/bin/backup
|
|
@echo "==> Copying the config into /etc"
|
|
[[ -f /etc/update.toml ]] || sudo cp update.toml /etc
|
|
@echo "==> Finished."
|
|
|
|
uninstall:
|
|
@echo "==> Removing the hooks from /etc/pacman.d/hooks"
|
|
sudo rm /etc/pacman.d/hooks/pre_backup.hook /etc/pacman.d/hooks/post_backup.hook
|
|
@echo "==> Removing backup into /usr/local/bin"
|
|
sudo rm /usr/local/bin/backup
|
|
@echo "==> /etc/update.toml will remain"
|
|
@echo "==> Finished."
|