aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-18 20:44:25 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-18 20:44:25 +0200
commit0f66dcc489843886d0e092126b8c47fc20a27b54 (patch)
tree577dae0fcaf3635889e0bdb46c199e811e3f6253
parentMade --port also option. (diff)
downloadcalp-0f66dcc489843886d0e092126b8c47fc20a27b54.tar.gz
calp-0f66dcc489843886d0e092126b8c47fc20a27b54.tar.xz
Move towards release.
-rw-r--r--Makefile8
-rw-r--r--module/.gitignore1
-rw-r--r--production-main2
-rw-r--r--system/PKGBUILD15
-rw-r--r--system/calp.service7
-rw-r--r--system/config.scm20
6 files changed, 42 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index f1be069c..a93fe173 100644
--- a/Makefile
+++ b/Makefile
@@ -34,12 +34,8 @@ install: all
install -d $(DESTDIR)/usr/share/calp/www
rsync -a static $(DESTDIR)/usr/share/calp/www
install -m 644 -D -t $(DESTDIR)/usr/share/doc/calp README
- install -m 755 -D -t $(DESTDIR)/usr/lib/calp/ main
- install -m 755 -D -t $(DESTDIR)/usr/lib/calp/ tzget
- install -d $(DESTDIR)/usr/bin
- ln -s -f /usr/lib/calp/main $(DESTDIR)/usr/bin/calp
- @env CACHE_DIR=$(DESTDIR)/var/cache/calp/ ./tzget
- # TODO zoneinfo files
+ install -m 755 -D -t $(DESTDIR)/usr/lib/calp/ scripts/tzget
+ install -D production-main $(DESTDIR)/usr/bin/calp
README: README.in
./main text < README.in | sed "s/<<today>>/`date -I`/" > README
diff --git a/module/.gitignore b/module/.gitignore
deleted file mode 100644
index 0eaae741..00000000
--- a/module/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-autoconfig.scm
diff --git a/production-main b/production-main
new file mode 100644
index 00000000..44db76e5
--- /dev/null
+++ b/production-main
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec $(which guile) -c '((@ (calp main) main) (command-line))' "$@"
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)