diff --git a/testing/xandikos/APKBUILD b/testing/xandikos/APKBUILD new file mode 100644 index 00000000000..3958f98dfc6 --- /dev/null +++ b/testing/xandikos/APKBUILD @@ -0,0 +1,43 @@ +# Contributor: Galen Abell +# Maintainer: Galen Abell +pkgname=xandikos +pkgver=0.2.5 +pkgrel=0 +pkgdesc="a lightweight yet complete CardDAV/CalDAV server that backs onto a Git repository" +url="https://xandikos.org" +arch="noarch" +license="GPL-3.0-or-later" +depends="python3 py3-aiohttp py3-icalendar py3-dulwich py3-defusedxml py3-jinja2 py3-multidict" +makedepends="py3-setuptools" +checkdepends="py3-pytest" +install="$pkgname.pre-install" +subpackages="$pkgname-doc $pkgname-openrc" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/jelmer/xandikos/archive/v$pkgver.tar.gz + xandikos.initd + xandikos.confd + " + +build() { + python3 setup.py build +} + +check() { + PYTHONPATH="." pytest +} + +package() { + python3 setup.py install --prefix=/usr --root="$pkgdir" + + install -m644 -D $pkgname.1 \ + "$pkgdir"/usr/share/man/man1/$pkgname + + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums="dbaf483bd4a8e267a667e46079f7c84d13e010c42879f9656a43460f215c02da5a8ff515b192268498b533993ef22e1062687be9ef7057211ce8206785af299e xandikos-0.2.5.tar.gz +8d49ef3ce004a666d4e9b1e97114d5bf381aa75538518ce7b15202bacf73ef90cd3ad751d6aae73b2b5768b37f58045ed3f34db0d004a8c5f479c1a79cbbcd60 xandikos.initd +8e1ef71e22809c9c7424dd518949e936d09d1da7f2911862d7943b71976554d74f72f186ea76bf8510b8fd95a75028fe369e5907c20695211425cf50c911388a xandikos.confd" diff --git a/testing/xandikos/xandikos.confd b/testing/xandikos/xandikos.confd new file mode 100644 index 00000000000..306cf7c7152 --- /dev/null +++ b/testing/xandikos/xandikos.confd @@ -0,0 +1,25 @@ +# Xandikos options + +# +# Directory where xandikos should store data +# + +ROOT_DIR="/var/lib/xandikos" + +# +# Default listening address +# + +LISTEN_ADDRESS="127.0.0.1" + +# +# Default listening port +# + +LISTEN_PORT="8080" + +# +# The name of the principal user. +# + +USER_PRINCIPAL="" diff --git a/testing/xandikos/xandikos.initd b/testing/xandikos/xandikos.initd new file mode 100644 index 00000000000..c47224cb892 --- /dev/null +++ b/testing/xandikos/xandikos.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run + +LOGS=/var/log/xandikos.log +USER=xandikos + +name=xandikos +description="xandikos caldav/carddav server" + +supervisor=supervise-daemon +supervise_daemon_args="-1 $LOGS -2 $LOGS" + +command=/usr/bin/xandikos +command_args="-d $ROOT_DIR -l $LISTEN_ADDRESS -p $LISTEN_PORT --current-user-principal $USER_PRINCIPAL --autocreate" +command_background="yes" + +start_stop_daemon_args="--user $USER:$USER" +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + need net + after firewall +} + +start_pre() { + if [ -z "$USER_PRINCIPAL" ]; then + eerror "You must specify a user principal" + return 1 + fi + + checkpath -f "$LOGS" -m 644 -o "$USER:$USER" + checkpath -d "$ROOT_DIR" -m 750 -o "$USER:$USER" +} diff --git a/testing/xandikos/xandikos.pre-install b/testing/xandikos/xandikos.pre-install new file mode 100644 index 00000000000..b1093b2f7f5 --- /dev/null +++ b/testing/xandikos/xandikos.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S xandikos 2>/dev/null +adduser -S -D -H -s /sbin/nologin -G xandikos -g xandikos xandikos 2>/dev/null + +exit 0