New package: duiadns-1.1

This commit is contained in:
Andrew J. Hesford 2020-07-20 23:08:17 -04:00 committed by Andrew J. Hesford
parent 22767c21e1
commit 33177c2a99
4 changed files with 61 additions and 0 deletions

8
srcpkgs/duiadns/INSTALL Normal file
View file

@ -0,0 +1,8 @@
# INSTALL
case "$ACTION" in
post)
if [ "$UPDATE" != "yes" ]; then
chown _duiadns:_duiadns etc/duiadns.conf
fi
;;
esac

View file

@ -0,0 +1,3 @@
#!/bin/sh
exec vlogger -t duiadns

View file

@ -0,0 +1,25 @@
#!/bin/sh
[ -f ./conf ] && . ./conf
# Make sure a configuration file exists
: ${CONFIG:=/etc/duiadns.conf}
[ -e "${CONFIG}" ] || exit 1
if command -v snooze >/dev/null 2>&1; then
# Use snooze if available because time control is better
# PERIOD is a set of snooze arguments in this context
: ${PERIOD:=-H /1 -M /5 -s 5m -T 1m}
# TIMEFILE tracks the last runtime
: ${TIMEFILE:=/var/cache/duiadns/timefile}
exec chpst -u _duiadns:_duiadns \
snooze ${PERIOD} -t "${TIMEFILE}" \
sh -c "/usr/bin/duiadns '${CONFIG}'; : > '${TIMEFILE}'"
else
# Fall back to dumb sleep if snooze is not available
# PERIOD is just the number of seconds to sleep in this context
sleep "${PERIOD:-300}" || exit 1
exec chpst -u _duiadns:_duiadns /usr/bin/duiadns "${CONFIG}"
fi

25
srcpkgs/duiadns/template Normal file
View file

@ -0,0 +1,25 @@
# Template file for 'duiadns'
pkgname=duiadns
version=1.1
revision=1
archs=noarch
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="python3-netifaces python3-netaddr python3-requests"
short_desc="Python client for Duiadns dynamic DNS hosting service"
maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="BSD-2-Clause"
homepage="https://github.com/ahesford/duiadns"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=d150f5d052ae3f2764bcfd6465c503fb9c620d994689ba093b5f926c72163638
system_accounts="_duiadns"
_duiadns_homedir="/var/empty"
_duiadns_descr="duiadns user"
make_dirs="/var/cache/duiadns 0755 _duiadns _duiadns"
conf_files="/etc/duiadns.conf"
post_install() {
vlicense LICENSE.txt
vinstall sample.conf 0600 etc duiadns.conf
vsv duiadns
}