@@ -19,19 +19,22 @@ ifdef INSTALL_DIR
1919else
2020 bindir = $(prefix)/bin
2121endif
22+ DEST_COMMAND = $(DESTDIR )$(bindir ) /todo.sh
2223
2324# The directory to install the config file in.
2425ifdef CONFIG_DIR
2526 sysconfdir = $(CONFIG_DIR)
2627else
2728 sysconfdir = $(prefix)/etc
2829endif
30+ DEST_CONFIG = $(DESTDIR )$(sysconfdir ) /todo/config
2931
3032ifdef BASH_COMPLETION
3133 datarootdir = $(BASH_COMPLETION)
3234else
33- datarootdir = $(prefix)/share/bash_completion.d
35+ datarootdir = $(prefix)/share/bash-completion/completions
3436endif
37+ DEST_COMPLETION = $(DESTDIR )$(datarootdir ) /todo.sh
3538
3639# generate list of targets from this Makefile
3740# looks for any lowercase target with a double hash mark (##) on the same line
@@ -95,18 +98,18 @@ clean: test-pre-clean VERSION-FILE ## remove dist directory and all release fi
9598
9699.PHONY : install
97100install : build installdirs # # local package install
98- $(INSTALL_PROGRAM ) $(DISTNAME ) /todo.sh $(DESTDIR )$( bindir ) /todo.sh
99- $(INSTALL_DATA ) $(DISTNAME ) /todo_completion $(DESTDIR )$( datarootdir ) /todo.sh
100- [ -e $( DESTDIR ) $( sysconfdir ) /todo/config ] || \
101- sed " s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" $(DISTNAME ) /todo.cfg > $(DESTDIR )$( sysconfdir ) /todo/config
101+ $(INSTALL_PROGRAM ) $(DISTNAME ) /todo.sh $(DEST_COMMAND )
102+ $(INSTALL_DATA ) $(DISTNAME ) /todo_completion $(DEST_COMPLETION )
103+ [ -e $( DEST_CONFIG ) ] || \
104+ sed " s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" $(DISTNAME ) /todo.cfg > $(DEST_CONFIG )
102105
103106.PHONY : uninstall
104107uninstall : # # uninstall package
105- rm -f $(DESTDIR )$( bindir ) /todo.sh
106- rm -f $(DESTDIR )$( datarootdir ) /todo
107- rm -f $(DESTDIR )$( sysconfdir ) /todo/config
108+ rm -f $(DEST_COMMAND )
109+ rm -f $(DEST_COMPLETION )
110+ rm -f $(DEST_CONFIG )
108111
109- rmdir $(DESTDIR)$(datarootdir)
112+ rmdir $(DESTDIR)$(datarootdir) 2>/dev/null || :
110113 rmdir $(DESTDIR)$(sysconfdir)/todo
111114
112115# create local installation directories
0 commit comments