config: Add pkg-dir and db-dir.
authorRicardo Wurmus <rekado@elephly.net>
Thu, 12 Mar 2020 07:26:57 +0000 (08:26 +0100)
committerRicardo Wurmus <rekado@elephly.net>
Thu, 12 Mar 2020 07:26:57 +0000 (08:26 +0100)
* mumi/config.scm.in (%config): Add fields for pkg-dir and db-dir.

mumi/config.scm.in

index a7500a0..7280e46 100644 (file)
                                  maybe-dir
                                  ;; TODO: use @assetsdir@ variable here
                                  "@prefix@/share/mumi/assets")))
+           (pkg-dir     . ,(let ((maybe-dir
+                                  (string-append (getcwd) "/etc")))
+                             (if (and (getenv "MUMI_UNINSTALLED")
+                                      (file-exists? maybe-dir))
+                                 maybe-dir
+                                 (let ((dir "@datarootdir@/mumi"))
+                                   (if (string-prefix? "${prefix}" dir)
+                                       (string-replace dir "@prefix@"
+                                                       0 (string-length "${prefix}"))
+                                       dir)))))
+           (db-dir      . ,(let ((maybe-dir (getcwd)))
+                             (if (and (getenv "MUMI_UNINSTALLED")
+                                      (file-exists? maybe-dir))
+                                 maybe-dir
+                                 (let ((dir "@localstatedir@/mumi/db"))
+                                   (if (string-prefix? "${prefix}" dir)
+                                       (string-replace dir "@prefix@"
+                                                       0 (string-length "${prefix}"))
+                                       dir)))))
            (mail-dir . ,(let ((maybe-dir
                                (string-append (getcwd) "/mails")))
                           (if (and (getenv "MUMI_UNINSTALLED")