diff options
author | atomlong | 2021-09-13 16:40:17 +0800 |
---|---|---|
committer | atomlong | 2021-09-13 16:40:17 +0800 |
commit | 4e2de21c1598b33c9169fc8872d1eb5fcbb44023 (patch) | |
tree | 5732ec89bdb024dbbd2bf537a3a3221484708ca9 | |
download | aur-4e2de21c1598b33c9169fc8872d1eb5fcbb44023.tar.gz |
Initial commit.
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 32 | ||||
-rw-r--r-- | destdir.patch | 52 | ||||
-rw-r--r-- | freenom-script.install | 10 |
4 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c5e0d61bbb9b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = freenom-script + pkgdesc = Freenom.com Domain Renewal and Dynamic DNS script. + pkgver = 20210824 + pkgrel = 1 + url = https://github.com/mkorthof/freenom-script + install = freenom-script.install + arch = any + license = GPL3 + depends = curl + source = freenom-script::git+https://github.com/mkorthof/freenom-script.git + source = destdir.patch + md5sums = SKIP + md5sums = 0ffe8df86934847971d6e2e04e211e60 + +pkgname = freenom-script diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..acb3e23b9635 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: atom.long <atom.long@hotmail.com> + +pkgname=freenom-script +pkgver=20210824 +pkgrel=1 +pkgdesc="Freenom.com Domain Renewal and Dynamic DNS script." +arch=('any') +url="https://github.com/mkorthof/freenom-script" +license=('GPL3') +depends=('curl') +source=("${pkgname}::git+${url}.git" + destdir.patch) +md5sums=('SKIP' + '0ffe8df86934847971d6e2e04e211e60') +install=freenom-script.install + +pkgver() { + cd "${srcdir}/${pkgname}" + git show -s --format="%ci" HEAD | sed -e 's/-//g' -e 's/ .*//' +} + +prepare() { + cd "${srcdir}/${pkgname}" + patch -Np1 -i "${srcdir}/destdir.patch" +} + +package() { + cd "${srcdir}/${pkgname}" + make DESTDIR="${pkgdir}" install +} + +# vim:set ts=2 sw=2 et: diff --git a/destdir.patch b/destdir.patch new file mode 100644 index 000000000000..050ba3e50e71 --- /dev/null +++ b/destdir.patch @@ -0,0 +1,52 @@ +diff --git "a/Makefile" "b/Makefile" +index 6c1dafc..ab77c51 100644 +--- "a/Makefile" ++++ "b/Makefile" +@@ -1,9 +1,9 @@ + CONF = freenom.conf + SCRIPT = freenom.sh +-SYSDDIR = /lib/systemd/system +-CRONDIR = /etc/cron.d +-INSTDIR = /usr/local/bin +-CONFDIR = /usr/local/etc ++SYSDDIR = $(DESTDIR)/usr/lib/systemd/system ++CRONDIR = $(DESTDIR)/etc/cron.d ++INSTDIR = $(DESTDIR)/usr/local/bin ++CONFDIR = $(DESTDIR)/usr/local/etc + + ifneq ("$(shell grep ^staff: /etc/group)", "") + GROUP = staff +@@ -50,12 +50,14 @@ ifeq ("$(wildcard $(SCRIPT))","") + $(error ERROR: Installation File "$(SCRIPT)" not found) + endif + ifeq ("$(EXISTCONF)", "0") ++ $(shell mkdir -p $(CONFDIR)) + $(shell install -C -m 644 -o root -g $(GROUP) $(CONF) $(CONFDIR)) + $(info Remember to edit "$(CONF)" and set your email and password) + else + $(info File "$(CONFDIR)/$(CONF)" already exists) + endif + ifeq ("$(wildcard $(INSTDIR)/$(SCRIPT))","") ++ $(shell mkdir -p $(INSTDIR)) + $(shell install -C -m 755 -o root -g $(GROUP) $(SCRIPT) $(INSTDIR)) + else + $(info File "$(INSTDIR)/$(SCRIPT)" already exists) +@@ -68,7 +70,8 @@ ifeq ("$(SCHED)", "systemd") + ifneq ("$(LISTUNITS)", "") + $(info Systemd unit files already installed) + else +- $(shell install -C -D -m 644 -o root -g root systemd/* $(SYSDDIR)) ++ $(shell mkdir -p $(SYSDDIR)) ++ $(shell install -C -m 644 -o root -g root systemd/* $(SYSDDIR)) + $(shell systemctl daemon-reload) + ifeq ("$(wildcard $(SYSDDIR)/freenom-*)","") + $(info To schedule domain renewals and updates, use these commands:) +@@ -82,7 +85,7 @@ else ifeq ("$(SCHED)", "cron") + ifeq ("$(wildcard cron.d/freenom)","") + $(error ERROR: Installation path "cron.d/freenom/*" not found) + else +- $(shell install -C -m 644 -o root -g root cron.d/freenom $(CRONDIR)/freenom) ++ $(shell install -C -D -m 644 -o root -g root cron.d/freenom $(CRONDIR)/freenom) + $(info Edit "$(CRONDIR)/freenom" to schedule domain renewals and updates) + $(info $() $() * replace example.tk with your domain and uncomment line(s)) + $(info See README.md for details) diff --git a/freenom-script.install b/freenom-script.install new file mode 100644 index 000000000000..f8326a12d19a --- /dev/null +++ b/freenom-script.install @@ -0,0 +1,10 @@ +post_install() { + cat << EOF +Remember to edit "/usr/local/etc/freenom.conf" and set your email and password +To schedule domain renewals and updates, use these commands: +- systemctl enable --now freenom-renew@example.tk.timer +- systemctl enable --now freenom-renew-all.timer +- systemctl enable --now freenom-update@example.tk.timer + * replace 'example.tk' with your domain +EOF +} |