aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2022-02-23 20:00:28 +0100
committerGuilhem Moulin <guilhem@fripost.org>2022-02-23 22:55:44 +0100
commit4d36557a007f06196affe14afd1a2bd2a4945c44 (patch)
tree61ea9ec361dba9164a8774bc1edd7df1ef3ff6cd
parent09d85b13359aabb377aeea489cd1f9c9bd1b1d63 (diff)
Document how to install without root privileges.
And make location for systemd user unit files configurable with systemd_userunitdir=.
-rw-r--r--Makefile7
-rw-r--r--doc/build.md27
2 files changed, 31 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 14656c4..7bcda70 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ sitelib ?= $(libdir)/site_perl
datarootdir ?= $(prefix)/share
mandir ?= $(datarootdir)/man
man1dir ?= $(mandir)/man1
+systemd_userunitdir ?= $(libdir)/systemd/user
CSS ?= /usr/share/javascript/bootstrap4/css/bootstrap.css
HTML_TEMPLATE ?= $(srcdir)/doc/template.html
@@ -89,11 +90,11 @@ install: install-nodoc
install-nodoc: all-nodoc
$(INSTALL_PROGRAM) -vDt $(DESTDIR)$(bindir) $(builddir)/interimap $(builddir)/pullimap
$(INSTALL_DATA) -vDT $(srcdir)/lib/Net/IMAP/InterIMAP.pm $(DESTDIR)$(sitelib)/Net/IMAP/InterIMAP.pm
- $(INSTALL_DATA) -vDt $(DESTDIR)$(libdir)/systemd/user $(SERVICE_FILES)
+ $(INSTALL_DATA) -vDt $(DESTDIR)$(systemd_userunitdir) $(SERVICE_FILES)
uninstall:
- rm -vf -- $(DESTDIR)$(bindir)/interimap $(DESTDIR)$(man1dir)/interimap.1 $(DESTDIR)$(libdir)/systemd/user/interimap*.service
- rm -vf -- $(DESTDIR)$(bindir)/pullimap $(DESTDIR)$(man1dir)/pullimap.1 $(DESTDIR)$(libdir)/systemd/user/pullimap*.service
+ rm -vf -- $(DESTDIR)$(bindir)/interimap $(DESTDIR)$(man1dir)/interimap.1 $(DESTDIR)$(systemd_userunitdir)/interimap*.service
+ rm -vf -- $(DESTDIR)$(bindir)/pullimap $(DESTDIR)$(man1dir)/pullimap.1 $(DESTDIR)$(systemd_userunitdir)/pullimap*.service
rm -vf -- $(DESTDIR)$(sitelib)/Net/IMAP/InterIMAP.pm
rm -rvf -- $(DESTDIR)$(datarootdir)/doc/interimap $(DESTDIR)$(datarootdir)/doc/pullimap
diff --git a/doc/build.md b/doc/build.md
index 6c812dc..1936c13 100644
--- a/doc/build.md
+++ b/doc/build.md
@@ -71,6 +71,33 @@ The `doc` target generates all documentation, manuals as well as HTML
pages.
+Installation without root privileges
+====================================
+
+By default `` `make install` `` installs [`interimap`(1)] under
+`/usr/local`, hence requires root privileges. However another prefix
+can be used in order to perform the (un)installation as an unprivileged
+user. For instance
+
+ $ install -m0700 -vd "${XDG_DATA_HOME:-~/.local/share}/interimap"
+ $ make install-nodoc \
+ prefix=~/.local \
+ sitelib="${XDG_DATA_HOME:-~/.local/share}/interimap/lib" \
+ systemd_userunitdir="${XDG_DATA_HOME:-~/.local/share}/systemd/user"
+
+skips documentation and installs
+
+ * executables into `~/.local/bin` (instead of `/usr/local/bin`);
+ * libraries into `$XDG_DATA_HOME/interimap/lib` or `~/.local/share/interimap/lib`
+ (instead of `/usr/local/lib/site_perl`); and
+ * [systemd user unit files][`systemd.unit`(5)] into `$XDG_DATA_HOME/systemd/user`
+ or `~/.local/share/systemd/user` (instead of `/usr/local/lib/systemd/user`).
+
+Note that for uninstallation one must call `` `make uninstall prefix=…` ``
+with the very same assignment(s) used for installation.
+
+[`systemd.unit`(5)]: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
+
Build custom Debian packages
============================