diff options
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | Makefile | 21 | ||||
-rw-r--r-- | config/config.go | 12 | ||||
-rw-r--r-- | doc/aerc-config.5.scd | 7 | ||||
-rw-r--r-- | doc/aerc-templates.7.scd | 4 |
5 files changed, 35 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d8db972..ea9ca1d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - New column-based message list format with `index-columns`. - Add a `msglist_answered` style for answered messages. +### Changed + +- Filters are now installed in `$PREFIX/libexec/aerc/filters`. The default exec + `PATH` has been modified to include all variations of the `libexec` subdirs. + ### Deprecated - `[ui].index-format` setting has been replaced by `index-columns`. @@ -7,6 +7,7 @@ VPATH=doc PREFIX?=/usr/local BINDIR?=$(PREFIX)/bin SHAREDIR?=$(PREFIX)/share/aerc +LIBEXECDIR?=$(PREFIX)/libexec/aerc MANDIR?=$(PREFIX)/share/man GO?=go GOFLAGS?= @@ -17,6 +18,7 @@ GO_LDFLAGS:= GO_LDFLAGS+=-X main.Version=$(VERSION) GO_LDFLAGS+=-X main.Flags=$(flags) GO_LDFLAGS+=-X git.sr.ht/~rjarry/aerc/config.shareDir=$(SHAREDIR) +GO_LDFLAGS+=-X git.sr.ht/~rjarry/aerc/config.libexecDir=$(LIBEXECDIR) GO_LDFLAGS+=$(GO_EXTRA_LDFLAGS) GOSRC!=find * -name '*.go' | grep -v filters/wrap.go @@ -112,7 +114,7 @@ clean: install: $(DOCS) aerc wrap mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(MANDIR)/man5 $(DESTDIR)$(MANDIR)/man7 \ $(DESTDIR)$(SHAREDIR) $(DESTDIR)$(SHAREDIR)/filters $(DESTDIR)$(SHAREDIR)/templates $(DESTDIR)$(SHAREDIR)/stylesets \ - $(DESTDIR)$(PREFIX)/share/applications + $(DESTDIR)$(PREFIX)/share/applications $(DESTDIR)$(LIBEXECDIR)/filters install -m755 aerc $(DESTDIR)$(BINDIR)/aerc install -m644 aerc.1 $(DESTDIR)$(MANDIR)/man1/aerc.1 install -m644 aerc-search.1 $(DESTDIR)$(MANDIR)/man1/aerc-search.1 @@ -130,14 +132,14 @@ install: $(DOCS) aerc wrap install -m644 config/accounts.conf $(DESTDIR)$(SHAREDIR)/accounts.conf install -m644 config/aerc.conf $(DESTDIR)$(SHAREDIR)/aerc.conf install -m644 config/binds.conf $(DESTDIR)$(SHAREDIR)/binds.conf - install -m755 filters/calendar $(DESTDIR)$(SHAREDIR)/filters/calendar - install -m755 filters/colorize $(DESTDIR)$(SHAREDIR)/filters/colorize - install -m755 filters/hldiff $(DESTDIR)$(SHAREDIR)/filters/hldiff - install -m755 filters/html $(DESTDIR)$(SHAREDIR)/filters/html - install -m755 filters/html-unsafe $(DESTDIR)$(SHAREDIR)/filters/html-unsafe - install -m755 filters/plaintext $(DESTDIR)$(SHAREDIR)/filters/plaintext - install -m755 filters/show-ics-details.py $(DESTDIR)$(SHAREDIR)/filters/show-ics-details.py - install -m755 wrap $(DESTDIR)$(SHAREDIR)/filters/wrap + install -m755 filters/calendar $(DESTDIR)$(LIBEXECDIR)/filters/calendar + install -m755 filters/colorize $(DESTDIR)$(LIBEXECDIR)/filters/colorize + install -m755 filters/hldiff $(DESTDIR)$(LIBEXECDIR)/filters/hldiff + install -m755 filters/html $(DESTDIR)$(LIBEXECDIR)/filters/html + install -m755 filters/html-unsafe $(DESTDIR)$(LIBEXECDIR)/filters/html-unsafe + install -m755 filters/plaintext $(DESTDIR)$(LIBEXECDIR)/filters/plaintext + install -m755 filters/show-ics-details.py $(DESTDIR)$(LIBEXECDIR)/filters/show-ics-details.py + install -m755 wrap $(DESTDIR)$(LIBEXECDIR)/filters/wrap install -m644 templates/new_message $(DESTDIR)$(SHAREDIR)/templates/new_message install -m644 templates/quoted_reply $(DESTDIR)$(SHAREDIR)/templates/quoted_reply install -m644 templates/forward_as_body $(DESTDIR)$(SHAREDIR)/templates/forward_as_body @@ -180,6 +182,7 @@ uninstall: $(RM) $(DESTDIR)$(MANDIR)/man7/aerc-templates.7 $(RM) $(DESTDIR)$(MANDIR)/man7/aerc-stylesets.7 $(RM) -r $(DESTDIR)$(SHAREDIR) + $(RM) -r $(DESTDIR)$(LIBEXECDIR) ${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR) $(RMDIR_IF_EMPTY) $(DESTDIR)$(MANDIR)/man1 $(RMDIR_IF_EMPTY) $(DESTDIR)$(MANDIR)/man5 diff --git a/config/config.go b/config/config.go index 09fb5efc..12da665b 100644 --- a/config/config.go +++ b/config/config.go @@ -31,12 +31,14 @@ func mapName(raw string) string { // Set at build time var shareDir string +var libexecDir string func buildDefaultDirs() []string { var defaultDirs []string prefixes := []string{ xdg.ConfigHome(), + "~/.local/libexec", xdg.DataHome(), } @@ -51,7 +53,13 @@ func buildDefaultDirs() []string { } } - // Add custom buildtime shareDir + // Add custom buildtime dirs + if libexecDir != "" && libexecDir != "/usr/local/libexec/aerc" { + libexecDir, err := homedir.Expand(libexecDir) + if err == nil { + defaultDirs = append(defaultDirs, libexecDir) + } + } if shareDir != "" && shareDir != "/usr/local/share/aerc" { shareDir, err := homedir.Expand(shareDir) if err == nil { @@ -60,7 +68,9 @@ func buildDefaultDirs() []string { } // Add fixed fallback locations + defaultDirs = append(defaultDirs, "/usr/local/libexec/aerc") defaultDirs = append(defaultDirs, "/usr/local/share/aerc") + defaultDirs = append(defaultDirs, "/usr/libexec/aerc") defaultDirs = append(defaultDirs, "/usr/share/aerc") return defaultDirs diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index 474c005b..410b40a3 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -606,8 +606,8 @@ filters need to be able to read from standard input. Many programs support reading from stdin by putting _-_ instead of a path to a file. You can also chain together multiple filters by piping with _|_. -aerc ships with some default filters installed in the share directory (usually -_/usr/share/aerc/filters_). Note that these may have additional dependencies +aerc ships with some default filters installed in the libexec directory (usually +_/usr/libexec/aerc/filters_). Note that these may have additional dependencies that aerc does not have alone. The filter commands are invoked with _sh -c command_. The following folders are @@ -615,8 +615,11 @@ appended to the system *$PATH* to allow referencing filters from their name only ``` ${XDG_CONFIG_HOME:-~/.config}/aerc/filters +~/.local/libexec/aerc/filters ${XDG_DATA_HOME:-~/.local/share}/aerc/filters +$PREFIX/libexec/aerc/filters $PREFIX/share/aerc/filters +/usr/libexec/aerc/filters /usr/share/aerc/filters ``` diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd index 67d5c112..8e616188 100644 --- a/doc/aerc-templates.7.scd +++ b/doc/aerc-templates.7.scd @@ -214,7 +214,7 @@ aerc provides the following additional functions: Execute external command, provide the second argument to its stdin. ``` - {{exec `/usr/local/share/aerc/filters/html` .OriginalText}} + {{exec `/usr/libexec/aerc/filters/html` .OriginalText}} ``` *.Local* @@ -267,7 +267,7 @@ aerc provides the following additional functions: Example: Automatic HTML parsing for text/html mime type messages ``` {{if eq .OriginalMIMEType "text/html"}} - {{exec `/usr/local/share/aerc/filters/html` .OriginalText | wrap 72 | quote}} + {{exec `/usr/libexec/aerc/filters/html` .OriginalText | wrap 72 | quote}} {{else}} {{wrap 72 .OriginalText | quote}} {{end}} |