From 3224624c56954ce2fc771e31cb73739049ffb3d4 Mon Sep 17 00:00:00 2001 From: Ayush Agarwal Date: Wed, 22 Mar 2023 18:57:34 +0530 Subject: make: install default config in XDG_CONFIG_DIRS The XDG_CONFIG_DIRS environment variable should define the base directory to search for default configuration files of applications. This is a system level directory that complements XDG_CONFIG_HOME. It should default to `/etc/xdg` although this can be bypassed if needed when using make. In addition, this commit makes the minimal target also install the default configuration file in XDG_CONFIG_DIRS. The 'install' target now depends on the 'minimal' target. --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c9016c5..a58a6e7 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,9 @@ DATAROOTDIR := $(PREFIX)/share MANDIR := $(DATAROOTDIR)/man BASHCOMPDIR := $(DATAROOTDIR)/bash-completion/completions FISHCOMPDIR := $(DATAROOTDIR)/fish/vendor_completions.d +CONFDIRS = /etc/xdg PROG = tessen - +PROGCFG = config SCDOC = scdoc SHCHK = shellcheck SHFMT = shfmt @@ -20,15 +21,13 @@ all: @echo "$(PROG) is a shell script and doesn't need to be compiled" @echo "To install it, enter \"make install\"" -install: man bashcomp fishcomp - $(INSTALL) -Dm 0755 $(PROG) -t $(DESTDIR)$(BINDIR) +install: man bashcomp fishcomp minimal @echo "" @echo "$(PROG) has been installed succesfully" minimal: $(INSTALL) -Dm 0755 $(PROG) -t $(DESTDIR)$(BINDIR) - @echo "" - @echo "$(PROG) has been installed succesfully" + $(INSTALL) -Dm 0644 $(PROGCFG) -t $(DESTDIR)$(CONFDIRS)/$(PROG) man: man/$(PROG).1 man/$(PROG).5 $(INSTALL) -Dm 0644 man/$(PROG).1 -t $(DESTDIR)$(MANDIR)/man1 @@ -57,3 +56,4 @@ uninstall: rm -f "$(DESTDIR)$(MANDIR)/man5/$(PROG).5" rm -f "$(DESTDIR)$(BASHCOMPDIR)/$(PROG)" rm -f "$(DESTDIR)$(FISHCOMPDIR)/$(PROG).fish" + rm -f "$(DESTDIR)$(CONFDIRS)/$(PROG)/$(PROGCFG)" -- cgit v1.2.3