From 0f66dcc489843886d0e092126b8c47fc20a27b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 18 Aug 2020 20:44:25 +0200 Subject: Move towards release. --- system/PKGBUILD | 15 +++++++++++---- system/calp.service | 7 +++++++ system/config.scm | 20 ++++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 system/calp.service create mode 100644 system/config.scm (limited to 'system') diff --git a/system/PKGBUILD b/system/PKGBUILD index 2edfb132..4482f371 100644 --- a/system/PKGBUILD +++ b/system/PKGBUILD @@ -8,16 +8,23 @@ license=('AGPL') depends=('guile>=2.2') makedepends=('ruby-sass') optdepends=('vdirsyncer': 'Download calendar files') -source=("https://github.com/HugoNikanor/$pkgname/archive/v$pkgver.tar.gz") +source=( + calp.service + config.scm + "https://github.com/HugoNikanor/$pkgname/archive/v$pkgver.tar.gz" +) build() { make } -check() { - make test -} +# check() { +# make test +# } package() { make DESTDIR="$pkgdir" install + install -m 644 -D -t $pkgdir/usr/lib/systemd/system calp.service + install -m 644 -D -t $pkgdir/etc/calp/config.scm config.scm } + diff --git a/system/calp.service b/system/calp.service new file mode 100644 index 00000000..42777d96 --- /dev/null +++ b/system/calp.service @@ -0,0 +1,7 @@ +[Unit] +Description=Calendar server + +[Service] +User=calp +ExecStart=calp --config /etc/calp/config.scm -- server +Restart=always diff --git a/system/config.scm b/system/config.scm new file mode 100644 index 00000000..bc3ce52c --- /dev/null +++ b/system/config.scm @@ -0,0 +1,20 @@ +(set-config! 'calendar-files (glob "/var/lib/calp/.local/var/cal/*")) + +(define (parse-links str) + (define regexp (make-regexp "https?://\\S+")) + (let recur ((str str)) + (let ((m (regexp-exec regexp str))) + (if (not m) + (list str) + (cons* (match:prefix m) + (a (match:substring m)) + (recur (match:suffix m))))))) + +(set-config! 'description-filter + (lambda (ev str) (parse-links str))) + +(set-config! 'week-start mon) +;; (set-config! 'default-calendar "Calendar") + +(set-config 'port 8082) +(set-config 'edit-mode #t) -- cgit v1.2.3