summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYasuaki Uechi2020-12-30 18:48:41 +0900
committerYasuaki Uechi2020-12-30 18:48:41 +0900
commiteeb75305899e8c2e701399cf438b1bc57e368e88 (patch)
treef0bad23facd330f83b47dfeb9a0da5ac2601f196
downloadaur-eeb75305899e8c2e701399cf438b1bc57e368e88.tar.gz
feat: init
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD39
-rw-r--r--cfddns.service10
4 files changed, 78 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b6a8299cc887
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = cfddns
+ pkgdesc = DDNS client for CloudFlare DNS
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/uetchy/cfddns
+ arch = any
+ license = MIT
+ makedepends = git
+ makedepends = python-dephell
+ depends = python
+ depends = python-cloudflare
+ depends = python-click
+ backup = etc/cfddns/cfddns.yml
+ source = .source::https://github.com/uetchy/cfddns/archives/v1.0.0.tar.gz
+ source = cfddns.service
+ sha256sums = SKIP
+ sha256sums = 1198d4d36c57c333acc7aa0a99339a66590145d098dd276b697ce639215bd5ca
+
+pkgname = cfddns
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..2c4b5c35dac8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+# Sources
+/src
+/.source
+/*.tar.gz
+
+# Built package
+/pkg
+/*.pkg.tar.xz
+/*.zst
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..8ff3f49c4eb2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Yasuaki Uechi <y@uechi.io> (https://uechi.io)
+
+pkgname=cfddns
+pkgver=1.0.0
+pkgrel=1
+pkgdesc='DDNS client for CloudFlare DNS'
+arch=('any')
+url='https://github.com/uetchy/cfddns'
+license=('MIT')
+depends=('python' 'python-cloudflare' 'python-click')
+makedepends=('git' 'python-dephell')
+backup=('etc/cfddns/cfddns.yml')
+source=(.source::"https://github.com/uetchy/${pkgname}/archives/v${pkgver}.tar.gz"
+ "${pkgname}.service")
+sha256sums=('SKIP' '1198d4d36c57c333acc7aa0a99339a66590145d098dd276b697ce639215bd5ca')
+
+prepare() {
+ cd "${srcdir}/.source"
+ dephell deps convert --level DEBUG --from pyproject.toml --to setup.py
+}
+
+build() {
+ cd "${srcdir}/.source"
+ /usr/bin/python setup.py build
+}
+
+package() {
+ cd "${srcdir}"/.source
+ /usr/bin/python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+
+ install -D -m600 "etc/cfddns.yml" \
+ "${pkgdir}/etc/cfddns/cfddns.yml"
+
+ install -D -m644 "LICENSE" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+
+ install -D -m644 "${srcdir}/${pkgname}.service" \
+ "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+} \ No newline at end of file
diff --git a/cfddns.service b/cfddns.service
new file mode 100644
index 000000000000..7df67411ff11
--- /dev/null
+++ b/cfddns.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Update CloudFlare DNS records
+After=network-online.target
+
+[Service]
+ExecStart=/usr/bin/cfddns -c /etc/cfddns/cfddns.yml /etc/cfddns/cfddns/domains.txt
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target