feat: update makefile (Arch Linux installation)

This commit is contained in:
Daniel Langbein 2023-06-16 14:07:53 +02:00
parent 4b5193ee7a
commit 84568a2402
3 changed files with 26 additions and 6 deletions

4
.gitignore vendored
View File

@ -3,3 +3,7 @@
/venv/
/build/
**/*.egg-info/
# makepkg
/packaging/netcup-dns/
/packaging/python-netcup-dns-git-*-any.pkg.tar.zst

View File

@ -4,8 +4,18 @@ PKGNAME := netcup-dns
all: install
.PHONY: install
install: nc-dnsapi requests notify cron
install: cron
sudo pacman -S --needed base-devel
cd packaging && makepkg -fCcsri && rm -rf $(PKGNAME)
${MAKE} install-files
.PHONY: install-pip
install-pip: nc-dnsapi requests exec-notify cron
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)/
@ -19,8 +29,8 @@ nc-dnsapi:
requests:
pip list | cut -f 1 -d ' ' | grep '^requests$$' || sudo pacman -S --needed python-requests
.PHONY: notify ## Check if exec-notify is installed.
notify:
.PHONY: exec-notify ## Check if exec-notify is installed.
exec-notify:
# `type` does not work e.g. on Ubuntu 18.04
which exec-notify
@ -31,7 +41,13 @@ cron:
# Check if cron is running
pgrep cron
.PHONY: clean
clean:
clean: 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)

View File

@ -5,7 +5,7 @@
_name=netcup-dns
pkgname="python-$_name-git"
pkgver=0.1.0
pkgver=r16.4b5193e
pkgrel=1
pkgdesc='update DNS records with your current external IP address using the netcup DNS API'
arch=(any)