de-p1st-monitor/Makefile

48 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2023-06-15 16:26:11 +02:00
PKGNAME := de-p1st-monitor
.PHONY: all
all: install-pkgbuild
.PHONY: install-pkgbuild
install-pkgbuild: cron ## Install with pacman (on Arch Linux)
sudo pacman -S --needed base-devel
cd packaging && makepkg -fCcsri && rm -rf $(PKGNAME)
${MAKE} install-files
.PHONY: install-pip
2023-06-16 14:06:34 +02:00
install-pip: exec-notify cron ## Install with pip
2023-06-15 16:26:11 +02:00
sudo python3 -m pip install --upgrade --force-reinstall .
${MAKE} install-files
.PHONY: install-files
install-files:
sudo install -m0644 cron.d/$(PKGNAME) /etc/cron.d/$(PKGNAME)
sudo install --directory -m755 /etc/$(PKGNAME)/
2023-10-05 18:21:01 +02:00
sudo install -m0644 src/de/p1st/monitor/data/* /etc/$(PKGNAME)/
2023-06-15 16:26:11 +02:00
2023-06-16 14:06:34 +02:00
.PHONY: exec-notify ## Check if exec-notify is installed.
exec-notify:
2023-06-15 16:26:11 +02:00
# `type` does not work e.g. on Ubuntu 18.04
which exec-notify
.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-pkgbuild
clean-pkgbuild: clean-files
sudo pacman -Rns python-$(PKGNAME)-git
.PHONY: clean-pip
clean-pip: clean-files
sudo python3 -m pip uninstall -y $(PKGNAME)
.PHONY: clean-files
clean-files:
sudo rm -rf /etc/cron.d/$(PKGNAME) /etc/$(PKGNAME) /var/log/$(PKGNAME).cron