From 9ac720ef31d70a00b119188b66390ac1d1bd787d Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 28 Mar 2023 17:18:30 +0200 Subject: [PATCH] feat: Makefile --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b4ac000 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +PKGNAME := netcup-dns + +.PHONY: all +all: install + +.PHONY: install +install: notify cron + sudo python3 -m pip install --upgrade --force-reinstall . + sudo install -m0644 cron.d/$(PKGNAME) /etc/cron.d/$(PKGNAME) + + sudo install --directory -m755 /etc/$(PKGNAME)/ + sudo install -m0644 cfg/* /etc/$(PKGNAME)/ + +.PHONY: notify ## Check if execNotify is installed. +notify: + # `type` does not work e.g. on Ubuntu 18.04 + which de-p1st-execNotify + +.PHONY: cron ## Check if cron (e.g. cronie) is running. +cron: + # Check if cron.d exists + stat /etc/cron.d/ + # Check if cron is running + pgrep cron + +.PHONY: clean +clean: + sudo python3 -m pip uninstall -y $(PKGNAME) + rm -rf /etc/cron.d/$(PKGNAME) /etc/$(PKGNAME)