From 84568a2402a17b62b9cd8ec90c482e040c648296 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Fri, 16 Jun 2023 14:07:53 +0200 Subject: [PATCH] feat: update makefile (Arch Linux installation) --- .gitignore | 4 ++++ Makefile | 26 +++++++++++++++++++++----- packaging/PKGBUILD | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index a96649f..19b78e9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ /venv/ /build/ **/*.egg-info/ + +# makepkg +/packaging/netcup-dns/ +/packaging/python-netcup-dns-git-*-any.pkg.tar.zst diff --git a/Makefile b/Makefile index 67e261d..a0074f4 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index 69644bb..b06a56b 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -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)