Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/Makefile.am
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2016-10-09 22:21:45 +1000
committerAllan McRae <allan@archlinux.org>2016-10-10 10:38:05 +1000
commit2e76c184aac74c4848fa5ee092fe54c9954c4054 (patch)
tree5dff5536f7a67cf032a0bd8b7e43f4192a96f030 /scripts/Makefile.am
parentd590a45795b30a14cdb697754749c85907053570 (diff)
Move bash/zsh completion out of contrib
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/Makefile.am')
-rw-r--r--scripts/Makefile.am29
1 files changed, 28 insertions, 1 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 86624968..8278b6fd 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -26,6 +26,7 @@ EXTRA_DIST = \
pacman-key.sh.in \
pkgdelta.sh.in \
repo-add.sh.in \
+ $(COMPLETION_DIST) \
$(LIBRARY) \
$(LIBMAKEPKG_DIST)
@@ -102,8 +103,15 @@ LIBMAKEPKG_DIST = \
$(LIBMAKEPKG) \
$(addsuffix .in, $(LIBMAKEPKG_IN))
+COMPLETION_IN = \
+ completion/bash_completion \
+ completion/zsh_completion
+
+COMPLETION_DIST = \
+ $(addsuffix .in, $(COMPLETION_IN))
+
# Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(bin_SCRIPTS) $(LIBMAKEPKG_IN)
+MOSTLYCLEANFILES = $(bin_SCRIPTS) $(LIBMAKEPKG_IN) $(COMPLETION_IN)
clean-local:
$(AM_V_at)$(RM) -r .lib
@@ -157,6 +165,14 @@ $(LIBMAKEPKG_IN): %: %.in Makefile
$(AM_V_at)chmod a-w $@
@$(BASH_SHELL) -O extglob -n $@
+$(COMPLETION_IN): %: %.in Makefile
+ $(AM_V_at)$(RM) $@
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@
+ $(AM_V_at)chmod a-w $@
+
+all-am: $(COMPLETION_IN)
+
makepkg: \
$(srcdir)/makepkg.sh.in \
$(srcdir)/makepkg-wrapper.sh.in \
@@ -213,6 +229,16 @@ makepkg-wrapper: \
$(AM_V_at)chmod +x,a-w $@
$(AM_V_at)$(LN_S) makepkg-wrapper makepkg
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
+ $(INSTALL_DATA) completion/bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
+ $(MKDIR_P) $(DESTDIR)$(datarootdir)/zsh/site-functions/
+ $(INSTALL_DATA) completion/zsh_completion $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
+
+uninstall-local:
+ $(RM) $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
+ $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
+
install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) makepkg makepkg-wrapper
@@ -247,4 +273,5 @@ uninstall-hook:
$(RM) -r $(DESTDIR)$(libmakepkgdir)/$$dir; \
done
+
# vim:set noet: